News: 1667287748

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

Linux world gains ability to repair exFAT drives

(2022/11/01)


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 called exFAT forms part of the [1]specification of SDXC (32GB—2TB) and SDUC (2—128TB) cards, and is the default format of SD cards over 32GB in size.

A forthcoming version of the Linux exFAT utilities will make fsck able to repair the filesystem on those devices and other storage.

[2]

At one point, [3]using exFAT meant buying a license, but it later got an [4]official free open description and indeed was [5]adopted by the Open Invention Network. Microsoft's own [6]description eases you in quite gently. Essentially, exFAT is to FAT32 as FAT32 is to the old 16-bit FAT of the DOS era. It's not totally unfair to call it FAT64.

[7]

[8]

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 Linux kernel gained the ability to mount exFAT volumes in version 5.4, via a [9]Samsung driver that the company [10]donated . This [11]later got a substantial upgrade. So, for instance, while in Ubuntu 18.04 you had to [12]load a driver, since [13]Ubuntu 20.04 appeared exFAT-formatted media should Just Work™.

[14]

That's great. The problem is if it Just Doesn't™. The exFAT system allows for disks up to 128PB – although 512TB is the recommended maximum. That's a lot of data to risk losing. This is where the [15]exfatprogs tools come in. The forthcoming [16]version 1.2 promises a handy new feature: a fsck.exfat command that can repair filesystem damage.

[17]Google kills forthcoming JPEG XL image format from Chromium

[18]Ubuntu continues expanding RISC-V support – now, the $17 Sipeed LicheeRV

[19]Clonezilla 3: Copy and clone disk images to your heart's content

The command was already there, but until this release it could only find and report damage – not fix it. The easiest way to do that was to insert your card into a Windows computer, and not everyone has one of those available. (The fsck command is the Unixy way of checking and repairing a disk volume, as well as a handy Reg stand-in for a Rude Word.)

It's very much not unprecedented for Linux to support a particular filesystem, but not be able to repair it. While the Linux kernel has had a [20]built-in read-write NTFS driver since version 5.15, it can't fsck NTFS volumes, as the NTFS3 [21]FAQ mentions.

For now, you still need to have the older FUSE-based [22]NTFS-3G installed, which provides the ntfsfix [23]command . Even so, it can only repair some fairly minor types of damage, and flag a volume so that Windows will check it next boot. Meanwhile the fsck.btrfs [24]command will, as per its own description:

fsck.btrfs - do nothing, successfully

The btrfs-check [25]command actually does something, but we advise you to pay close heed to the dire warning in that link. In our experience, it is more akin to a secure data-erasure tool than anything liable to help. ®

Bootnote

FAT32 hasn't gone away, either. It's integral to any modern PC, because UEFI firmware needs an EFI System Partition (ESP). Those are formatted with FAT32, which caused the Reg FOSS desk [26]problems with some recent distros.

Get our [27]Tech Resources



[1] https://www.sdcard.org/developers/sd-standard-overview/capacity-sd-sdhc-sdxc-sduc/

[2] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2Y2D8UsVKi42JjabR8I1PPgAAAJI&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0

[3] https://www.theregister.com/2009/12/11/exfat_licensing_linux_who_they/

[4] https://www.theregister.com/2019/08/28/microsoft_exfat_spec_linux_kernel/

[5] https://www.theregister.com/2020/10/13/oin_exfat_linux/

[6] https://learn.microsoft.com/en-us/windows/win32/fileio/exfat-specification

[7] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44Y2D8UsVKi42JjabR8I1PPgAAAJI&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0

[8] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33Y2D8UsVKi42JjabR8I1PPgAAAJI&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0

[9] https://sfconservancy.org/news/2013/aug/16/exfat-samsung/

[10] https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git/commit/?h=for-next&id=88ab55f16aae90e2e974eb67cc2380edb92b0661

[11] https://www.theregister.com/2020/06/15/torvalds_linux_kernel_58_one/

[12] https://linuxize.com/post/how-to-mount-an-exfat-drive-on-ubuntu/

[13] https://www.theregister.com/2020/04/23/canonical_releases_ubuntu_2004_claims/

[14] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44Y2D8UsVKi42JjabR8I1PPgAAAJI&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0

[15] https://github.com/exfatprogs/exfatprogs

[16] https://github.com/exfatprogs/exfatprogs/releases/tag/1.2.0

[17] https://www.theregister.com/2022/10/31/jpeg_xl_axed_chrome/

[18] https://www.theregister.com/2022/10/28/ubuntu_riscv_sbc/

[19] https://www.theregister.com/2022/05/27/clonezilla_3/

[20] https://www.theregister.com/2021/10/13/how_ntfs_finally_made_it/

[21] https://www.paragon-software.com/home/ntfs3-driver-faq/

[22] https://github.com/tuxera/ntfs-3g

[23] https://manpages.ubuntu.com/manpages/focal/en/man8/ntfsfix.8.html

[24] https://man7.org/linux/man-pages/man8/fsck.btrfs.8.html

[25] https://man7.org/linux/man-pages/man8/btrfs-check.8.html

[26] https://www.theregister.com/2021/12/16/pop_os_2110_new_system76/

[27] https://whitepapers.theregister.com/



I like the section "Dangerous options" in the manpage

Joe W

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...

Anonymous South African Coward

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.

You don't use removable media?

Richard 12

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.

FAT3.1415926...

Flocke Kroes

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.

Liam Proven

>> 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.

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.

b0llchit

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?

Never mind the theatrics

Will Godfrey

Just give us the FATs Ma'am.

Military secrets are the most fleeting of all.
-- Spock, "The Enterprise Incident", stardate 5027.4