Please check the status of this specification in Launchpad before editing it. If it is Approved, contact the Assignee or another knowledgeable person before making changes.
Created: 20 March, 2007
Author: Onno Benschop
Launchpad entry: dos-dirty-flag
Packages affected: dosfstools
Make dosfstools aware of the status of a (v)FAT file system, stopping it from checking a known clean partition.
As more and more users have access to USB sticks, external drives, digital cameras and larger drives that co-exist with other operating systems, dosfstools needs to participate in the existing file system integrity procedures, rather than just fix every (v)FAT partition it encounters.
- Peter has a large drive with many partitions. When he boots Ubuntu, the process takes forever because Ubuntu checks his Windows Recovery Partition at every bootup. (Windows does not do such checking at every bootup.)
- Paul has an external USB thumb drive. When he inserts the key, the drive content is changed because the mount process checks the drive regardless of its state.
- Mary has a digital camera. When she connects the camera, the computer attempts to check the file system because the camera shows itself to the computer as an external flash drive.
This specification purposefully only addresses changes made to dosfstools, not to the kernel.
Wikepedia Article on FAT implementation:
Microsoft Knowlegebase article describing the Boot Sector:
LKML emails commenting on the implementation:
Current version of the boot sector definition:
Alternative description of the Boot Sector:
Partition surprise manual containing comments about the dirty flag:
- The implementation initially should check only those file systems that are marked dirty, skipping a clean file system.
- A command line parameter should be added to force a check on a clean file system. Perhaps -c for "check clean", rather than -F for "force check", since -f is used for "salvage to files"
Data preservation and migration
The dirty flag does not currently get used. Some suggestions have been made to create a configuration file on the file system being checked, or in the appropriate location in the system tree. This would create more problems than it solves. There should be no additional configuration files at all. The existing system as used by other operating systems, for example Windows, should be used to maintain integrity.
- The kernel provides the actual access to the file system. It should maintain the dirty flag when changes to the file system are made. This specification says nothing about the kernel.
- If a file system is dirty, it is checked. After the check, the file system is clean. How do we update the partition to note this, given that the kernel doesn't appear to support a dirty flag?
- If we resolve the dirty flag write, we will likely have a solution for the kernel to maintain the dirty flag as well.
- Auto mounted file systems should be checked if they are dirty. That is, those devices that are connected after boot and detected by various sub-systems and consequently mounted.
- Extensive searches indicate that the kernel supports dirty flags at an abstraction level, but this does not appear to have been implemented within the fat code.