[Tip] Auto/custom sort your files/folders on SD card with FATsort

Others here may already know about this, but just in case…

fatsort - FATSort Utility

FATSort is a C utility that sorts FAT12, FAT16, FAT32 and exFAT partitions. It even can handle long file name entries. It was developed because I wanted to sort my MP3 files on my MP3 hardware player. Unfortunately, there was no utility out there so far, so I had to write it myself. FATSort reads the boot sector and sorts the directory structure recursively. FATSort is released under GPLv2.

Since the Flipper Zero doesn’t appear to do any sorting on the device in the browser/archive view (future improvement?), things can get out of order.

You can also tell FATsort to sort things in different ways, not just by filename - see the manual page.

Usage (Linux, macOS)

I’m on Kubuntu 20.04, but this should work on macOS and any Linux installation.

  1. sudo apt install fatsort
    • You’ll need to adjust this if you’re on a different platform (this is for Ubuntu and Debian)
  2. Unmount your SD card from your Flipper in Settings :arrow_right: Storage :arrow_right: Unmount SD Card, then press the right arrow to confirm
  3. Connect your SD card to your computer
  4. If your SD card mounts automatically, unmount it - FATsort needs the partition to be unmounted
    • sudo umount /path/to/mount
  5. Run FATsort on the partition
    • sudo fatsort -n -c /dev/mmcblk0p1 && sudo sync
    • I prefer using the -n natural sort order option, -c to ignore casing when sorting
    • sudo sync ensures changes are written (might not be required)
  6. Eject the SD card from your computer and put it back into your Flipper

Windows

I haven’t tried any software, but I’m sure it’s out there somewhere.

5 Likes