back to article Linux world gains ability to repair exFAT drives

In case you thought the FAT filesystem died out with Windows ME – and good riddance – we have bad news for you. Several versions of it are alive, well, and essential to modern PCs, cameras, phones, fondleslabs, and more. The good news is, you'll soon be able to fix the FS with Linux. A version of Microsoft's FAT filesystem …

  1. Joe W Silver badge
    Happy

    I like the section "Dangerous options" in the manpage

    of brtfs-check.

    "Along with it [Unix] cam a set of disgustingly dangerous utilities that meant nothing, but could render a system useless within seconds."

    I'm unsure of the source...

    1. david 12 Silver badge

      Re: I like the section "Dangerous options" in the manpage

      "Dangerous options" inescapably reminded me of that other great FAT utility: RECOVER.

      I know I wasn't the first one to attempt to 'recover' a floppy disk, because I was sent along to an office guru (an Autocad tradesman) who knew immediately what I had done.

  2. Anonymous South African Coward Bronze badge

    But leave it at that. Don't call it "FATty FAT FAT FAT" or anything like that. The Reg does not condone FAT-shaming.

    The more things change, the more they stay the same... and crosslinked files really are great fun to have.

    I haven't used FAT in ages, can't remember since last I've used it.

    1. Richard 12 Silver badge

      You don't use removable media?

      USB sticks come formatted FAT32 or exFAT, have for years. Yes, you can reformat it but most people don't as there aren't many options that are fully supported by all major OS.

      And as TFA says, they're the default SD card format.

      1. Anonymous Coward
        Anonymous Coward

        Re: You don't use removable media?

        I found this out when Windows10 wanted to do an update on my tablet with 32GB storage. It's OK, you can plug a USB key in and use that as extra storage. Left it updating overnight and it failed. After much digging I found an eight-digit failure number hidden in a log file. Googled it to discover that the USB key must be NTFS-formatted for the update to work. A minor thing that the update could have checked in milliseconds before starting the whole sorry process. Windows 10 was even capable of re-formatting the USB key to NTFS for me. Bloody Microsoft.

      2. JimboSmith Silver badge

        Re: You don't use removable media?

        I have a Sony TV to which I have connected a 1TB hard drive turning it into a DVR for time shifting tv shows onto. The file systems supported are FAT32, eXFAT and NTFS, the former up to 2TB and the latter two up to 16TB. However the system can go wrong occasionally with a problem on the hard drive meaning your shows are inaccessible on the existing hard drive. The contents are also encrypted though to prevent copying of shows. You therefore have to register the hard drive with the TV before it can be used for this purpose. If that drive does fail you can just register a new one on the TV, I made mine a larger one at this point.

        Then using a Linux (or possibly Mac) but not Windows computer, you can connect the two hard drives to it. Copy the contents of your old one to the new one and plug back into the telly. I performed this feat in front of an astonished audience of a mate of mine and his other half who had found all the recorded but unwatched Strictly episodes and some Sandi Noir series or other were unwatchable. That bought me a few drinks in the pub and undying praise from his girlfriend who had recorded those. When she asked what I’d done and I started mentioning file systems she said “Stop right there, I actually don’t give a sh!t, let’s just say it was magic - do you want another drink?”

        1. Youngone Silver badge

          Re: You don't use removable media?

          “Stop right there, I actually don’t give a sh!t, let’s just say it was magic - do you want another drink?”

          I might be in love with your mate's girlfriend.

    2. Flocke Kroes Silver badge

      FAT3.1415926...

      The boot partition of a Raspberry Pi must be formatted VFAT. VFAT is one of FAT12, FAT16 or FAT32 with an extension to handle filenames longer than 8.3.

    3. Liam Proven (Written by Reg staff) Silver badge

      >> The Reg does not condone FAT-shaming.

      Aaaaaand that's how I find my editor inserted an extra gag.

      > and crosslinked files really are great fun to have.

      Don't remind me.

      > can't remember since last I've used it.

      More recently than you think. Do you use any PC younger than a decade old? It has to boot from FAT. Do you use a Raspberry Pi? It has to boot from FAT. Do you use any media-handling device with an SD card bigger than 32GB? Then it uses FAT.

      That was my point: you probably use it every day, but don't realise.

      1. Anonymous Coward
        Anonymous Coward

        >> can't remember since last I've used it.

        > Do you use any PC younger than a decade old?

        Reading comments 'ere on El'Reg there are those that think UEFI is a M$ plot to take over the world* so maybe the first thing they do with a new motherboard is to put it into Legacy mode so they can boot from an M$DOS** style MBR.

        * uses the wrong sort of slashes and everyone knows that's not natural like.

        ** just ask parted what it thinks of your legacy BIOS boot disk.

    4. Jou (Mxyzptlk) Silver badge

      > crosslinked files

      This is where NTFS shines: Crosslinked file are allowed there by design, if you want. Since Vista that trick, specifically hardlinks, is used to save space on the OS partition, was perfected with Windows 8 and higher.

      1. Liam Proven (Written by Reg staff) Silver badge

        [Author here]

        > Crosslinked file are allowed there by design

        Links and crosslinks are rather different things. :-)

        Soft links (and hard links) are useful tools and used judiciously are very powerful tools.

        Crosslinks are pretty much _always_ very bad news.

        Top (if mostly obsolete) tip: before you CHKDSK your drive, empty the TEMP directories. (The global one in \WINDOWS *and* the user-specific ones). Then the chances of crosslinks are much reduced, since all the garbage in the temp folders is gone, and your disk check will be faster anyway.

    5. Gene Cash Silver badge

      I haven't used FAT in ages, can't remember since last I've used it.

      All the digital cameras out there use it. I had a couple GPS units with removable map media that used it.

      I sneakernet gcode to my Prusa 3D printer on an SD card formatted in FAT. The SD card in my Android phone is FAT.

      Of course all 4 of my Raspberry Pis doing various things like controlling my garage door and monitoring my EV charging use it.

      1. Anonymous Coward
        Anonymous Coward

        It's the one filesystem that is guaranteed to work on anything out there. A least common denominator, if you will.

    6. Someone Else Silver badge

      The Reg does not condone FAT-shaming.

      Not necessary. FAT shames itself quite nicely, thank you.

  3. b0llchit Silver badge
    Joke

    The Reg does not condone FAT-shaming.

    I like my kernels slim.

    I like my fs sexy.

    Well then, that means to remove the FAT, doesn't it?

  4. Will Godfrey Silver badge
    Joke

    Never mind the theatrics

    Just give us the FATs Ma'am.

  5. BenDwire Silver badge
    Facepalm

    Don't call it "FATty FAT FAT FAT"

    Don't call it "FATty FAT FAT FAT" or anything like that. The Reg does not condone FAT-shaming.

    OK. Fatty McFatFace it is then.

    1. Anonymous Coward
      Anonymous Coward

      Re: Don't call it "FATty FAT FAT FAT"

      You only got there first 'cos I was in the toilet*

      * Having a Pooey McPoopoo

      1. BenDwire Silver badge
        Facepalm

        Re: Don't call it "FATty FAT FAT FAT"

        At least it wasn't a Pooey McPooFace ...

  6. Norman Nescio Silver badge
    Headmaster

    EFI System Partition - FAT?

    !Pedant Alert

    The UEFI Specification (Available here: https://uefi.org/specifications) makes it clear that the EFI System Partition is subtly different from vanilla FAT:

    The file system supported by the Extensible Firmware Interface is based on the FAT file system. EFI defines a specific version of FAT that is explicitly documented and testable. Conformance to the EFI specification and its associate reference documents is the only definition of FAT that needs to be implemented to support EFI. To differentiate the EFI file system from pure FAT, a new partition file system type has been defined

    ( Unified Extensible Firmware Interface (UEFI) Specification, Release 2.10, Section 13.3)

    One minor difference:

    Note: Although the FAT32 specification allows file names to be encoded using UTF-16, this specification only recognizes the UCS-2 subset for the purposes of sorting or collation.

    ( Unified Extensible Firmware Interface (UEFI) Specification, Release 2.10, Section 13.3.1.2)

    NN

    1. Roland6 Silver badge

      Re: EFI System Partition - FAT?

      I remember the fun and games around what was and was not OSI.

      The OSI purists insisted that profiles that selected subsets of the OSI protocol suite weren't true 'OSI'...

      Also, there are IEEE/OSI Standards where a header setting has been changed just to ensure that implementations of the 'Draft' Standard are unable to interoperate with full 'Standard' implementations.

      In conclusion UEFI FAT is FAT, albeit with a few trimmings.

      1. Waseem Alkurdi

        Re: EFI System Partition - FAT?

        Mixing things up are UEFI implementations that are able, by virtue of a DXE, to boot from a (normal) EFI FAT32 partition, or even NTFS.

  7. captain veg Silver badge

    exFAT forms part of the specification of SDXC (32GB—2TB) and SDUC (2—128TB) cards

    Does it still have the redundant copy of the cluster table that no one ever uses for anything?

    -A.

  8. Ozan
    Happy

    Wasn't second letter of fsck was different at start?

    1. Arthur the cat Silver badge

      Wasn't second letter of fsck was different at start?

      Yes, the command was fſck in medieval times.

      1. Someone Else Silver badge
        Coffee/keyboard

        OK, enough of that, please! - - - - ->

  9. Jou (Mxyzptlk) Silver badge

    "akin to a secure data-erasure tool"

    Huh, sounds like ReFS... There are some weird things which makes ReFS not trustworthy, especially its way to handle Checksum errors - if you activated that feature.

    1. Anonymous South African Coward Bronze badge

      Re: "akin to a secure data-erasure tool"

      Haven't used ReFS yet, decided that others can have the fun and games that goes with anything new from M$.

      Once the bugs are ironed out, and it is proven solid and reliable, then I'll start using it. Not before.

  10. martinusher Silver badge

    FAT -- File Allocation Table

    Not a big deal , its just a cluster index. It predates PCs (and Microsoft) and originally had 12 bit entries which meant either restricted total disk size or very large clusters of sectors. I never quite figured out how making the table entries larger qualified for a patent but then that's the USPTO for you.

    Its a cheap 'n relatively dirty simple filesystem allocation method. Its quite robust (the FAT table is duplicated) that's self contained. Ideal for removable medium. You can obviously design better file systems but there will be tradeoffs -- you might have the allocation data cached in RAM or you might make the filesystem journaling for example but its just tradeoffs.

    1. Richard 12 Silver badge

      Re: FAT -- File Allocation Table

      It's not atomic, which makes it a poor choice for removable media. Ideally you want a removable media filesystem to cope with being ripped untimely from its mother's womb and have every write either safely completed, or as if it never happened.

      But it is simple. And simple is good, especially for small embedded systems like cameras and the like.

      1. Brewster's Angle Grinder Silver badge

        Re: FAT -- File Allocation Table

        Simple enough you can open up a sector editor and unravel it - at a push.

  11. Kevin McMurtrie Silver badge

    Yea!

    My Sony phone only accepts exFAT for it's microSd card and it leaks free space like mad. My current workaround is to update my backup, erase, and restore using my Linux desktop. It all takes a few hours for a 1TB card. Repairing would be a welcome feature.

    PS - I hate you, Sony

    1. Jou (Mxyzptlk) Silver badge

      Re: Yea!

      Try formatting as FAT32 instead of EXFAT with Fat32 formatter. Might work better, and FAT32 checking should be possible with Linux.

      1. Kevin McMurtrie Silver badge

        Re: Yea!

        I don't think FAT32 would like me.

        $ ls -lh Kiwix/

        total 182G

        -rwxrwx--- 1 media_rw media_rw 68G Aug 4 01:36 gutenberg_en_all_2022-07.zim

        -rwxrwx--- 1 media_rw media_rw 13M Aug 3 23:01 gutenberg_ja_all_2022-07.zim

        -rwxrwx--- 1 media_rw media_rw 89G Jun 6 00:46 wikipedia_en_all_maxi_2022-05.zim

        -rwxrwx--- 1 media_rw media_rw 20G Feb 17 2022 wikipedia_ja_all_maxi_2021-03.zim

        -rwxrwx--- 1 media_rw media_rw 6.2G Feb 17 2022 wiktionary_en_all_maxi_2022-01.zim

        -rwxrwx--- 1 media_rw media_rw 293M Feb 17 2022 wiktionary_ja_all_maxi_2022-02.zim

        PS - Reg, your pre and code tag rendering is full of paragraph tags!

  12. Phones Sheridan Silver badge

    "Don't call it "FATty FAT FAT FAT" or anything like that. The Reg does not condone FAT-shaming."

    There's precedent tho! Who remembers the Address Generator Chip on the Commodore Amiga "Agnus" and it's variants, Thin Agnus Big Agnus, Big Fat Agnus, Fatter Agnus, Super Agnus, Super Fat Agnus, Fat Lady*

    *Tho that may not have been the order they were released in.

    1. Anonymous Coward
      Anonymous Coward

      I adored my Amigas but didn't give a damn about the chipsets in them. Does that make me an Agnustic?

    2. Anonymous South African Coward Bronze badge
      Joke

      I read Agnus as Anus.

      Think I've had too much internet for the day.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like