FAT filesystem and Linux

Linux has several filesystem drivers for the File Allocation Table (FAT) filesystem format.

Uses your system voice; voice and rate in settings.

Snapshot

≈ 4 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

Linux has several filesystem drivers for the File Allocation Table (FAT) filesystem format. These are commonly known by the names used in the mount command to invoke particular drivers in the kernel: , , and . conv :This option specifies file content conversion semantics.

It is possible for the filesystem drivers to convert the newline conventions in files, between LF termination and CRLF termination, on the fly as files are read and written. By default this conversion is entirely disabled.

The filesystem drivers can perform conversion for some files, attempting to auto-detect what files to convert based upon the extension portion of the filename, or globally for all files. These three conversion levels are specified as conv=b (for "binary"), conv=a (for "auto-detect"), and conv=t (for "text"), respectively.

The latter two options carry an inherent risk of corrupting non-text file data. No conversion at all is the default.

Data structure

The FAT filesystem driver stores all of the extra information relating to Unix file semantics in what, to another FAT filesystem driver, appears to be just a normal file in each directory and subdirectory, named --LINUX-.--- . In the absence of this file in any given directory, and thus by default, the filesystem driver provides the same semantics as the filesystem driver does for the directory: only 8.3 filenames and no extra Unix file semantics.

To enable the driver's extra abilities, it is necessary to create that file in the directory and synchronize its internal data with the normal FAT data for any existing entries already in the directory. This is done with a tool called umssync .

This is the utility program that is run, across every directory on the disc volume, every time that one switches from running Windows to running Linux, in order for the filesystem driver to incorporate any changes made to files and directories by Windows into its private data structures in its --LINUX-.--- file. By default, the umssync tool creates --LINUX-.--- files in directories if they do not already exist, resulting in such a file in every directory in the disc volume.

When switching between Windows and Linux this behaviour is not often considered desirable. Therefore, the normal mode of operation when invoking umssync after switching from Windows to Linux (which is usually done by running the tool at Linux boot time from a startup script) is to employ the -c option to the command, which prevents the creation of any new --LINUX-.--- files in directories that do not already possess them.

The convention for such an installation is for the Linux root directory to be a subdirectory of the root directory of the DOS boot volume, e.g. C:\LINUX . The various Linux top-level directories are thus, to DOS, directories such as C:\LINUX\ETC (for /etc ), C:\LINUX\BIN (for /bin ), C:\LINUX\LIB (for /lib ), and so forth.

The filesystem driver automatically prepends the C:\LINUX\ to all pathnames. The location of the Linux root directory is supplied to the filesystem driver in the first place via an option to the loadlin command. So, for example, loadlin would be invoked with a command line such as loadlin c:\linux\boot\vmlinuz rw root=c:\linux .

The installation of Linux into such a directory in the first place simply involves unpacking files from an archive into that directory and its subdirectories. Such an installation also generally requires the use of a swap file rather than a swap partition for Linux, however this is related to the desire not to repartition the hard disc and unrelated to the filesystem driver per se.

See also

DMSDOS (DoubleSpace/DriveSpace/Stacker compatible compressed FAT volumes for Linux) Design of the FAT file system

Further reading

UMSDOS developer’s page New Linux patch could circumvent Microsoft's FAT patents by Ryan Paul

Text derived from https://en.wikipedia.org/w/index.php?oldid=1373590531 under CC BY-SA 4.0; modifications have been made.

Sources cited in this revision

12 named source(s) extracted from the cited revision. A source with no author is shown by its publication; nothing is invented.