Ubuntu – Does Ubuntu damage USB drives

fat32filesystemntfswindows

Whenever I unmount a USB drive with Nautilus and plug it to a Windows machine, I receive a warning that the drive needs to be repaired.


(the same message like in this screenshot)

For 10+ years working with windows I never had a corrupted or damaged USB drive but during the last two years three of my USB drives became inoperative, so I cannot prove it, but it's obvious that this is related to Ubuntu's (un)mount behavior.

A friend told me I can prevent such damage using udisks and sync, but I hope this is not the way to do it, mounting drives with shell commands in 2016.

Best Answer

No worries Ubuntu did not damage your USB drive. But we do not use poorly documented bit flags of a FAT32, FAT16, or NTFS filesystem. On Windows these flags indicate a possibly corrupted filesystem when we had not properly unmounted the drive or an I/O error had occured.

Those bits are located in a reserved entry of a FAT partition table. According to an internal Microsoft paper of 2004 the purpose of these bits are:

  • ClnShutBitMask:
    If bit is 1, the volume is “clean”. The volume can be mounted for access. If bit is 0, the volume is “dirty” indicating that a FAT file system driver was unable to dismount the volume properly (during a prior mount operation). The volume contents should be scanned for any damage to file system metadata.
  • HrdErrBitMask:
    If this bit is 1, no disk read/write errors were encountered. If this bit is 0, the file system driver implementation encountered a disk I/O error on the volume the last time it was mounted, which is an indicator that some sectors may have gone bad. The volume contents should be scanned with a disk repair utility that does surface analysis on it looking for new bad sectors.

There was some discussion with the kernel file system developers some years ago on how to overcome this but I was unable to follow up the results. Apparently it did not make it into recent kernels.

As only a bit flag is involved but generally our data should be in perfect shape we can ignore the warning Windows issues on those drives we had previously used in Ubuntu.