Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

FAT filesystem and Linux

From Wikipedia, the free encyclopedia
Widely used Linux filesystem format

Linux has severalfilesystem drivers for theFile Allocation Table (FAT) filesystem format. These are commonly known by the names used in themount command to invoke particular drivers in the kernel:msdos,vfat, andumsdos.[1][2]

History and support

[edit]

Most of the major Linux distributions, including RedHat, SuSE, and Debian, do not employumsdos to permit installation of Linux on a FAT disc volume. A few distributions do, however.[3] These include distributions such as Phat Linux, which installs inC:\PHAT on DOS by unpacking aZIP file and is booted by running aCOMMAND.COM script namedLINUX.BAT,[4] andZipSlack[citation needed].

The UMSDOS project was started in 1992 by Jacques Gelinas and made available to the net in January 1994 as a patch. It was included in the standard distribution starting with kernel 1.1.36.[citation needed] UMSDOS was removed from the Linux 2.6.11 kernel for lack of maintenance.[5] UVFAT, an extension of UMSDOS to use the Windows data structures for long filenames instead of its own, was discontinued before release.[6] They should work in 2.4.x kernels.[citation needed]

Earlier Linux distributions which used UMSDOS areMuLinux,[7] Monkey Linux[8] and Winlinux 2000.[9]

Feature comparison

[edit]

All of the Linux filesystem drivers support all three FAT types, namelyFAT12,FAT16 andFAT32. Where they differ is in the provision of support forlong filenames, beyond the8.3 filename structure of the original FAT filesystem format, and in the provision of Unix file semantics that do not exist as standard in the FAT filesystem format such asfile permissions.[1] The filesystem drivers are mutually exclusive. Only one can be used to mount any given disk volume at any given time. Thus the choice among them is determined by what long filenames and Unix semantics they support and what use one wants to make of the disk volume.[10]

msdos

[edit]

Themsdos filesystem driver provides no extra Unix file semantics and no long filename support. If a FAT disk filesystem is mounted using this driver, only 8.3 filenames will be visible, no long filenames will be accessible, nor will any long filename data structures of any kind on the disk volume be maintained. Thevfat filesystem driver provides long filename support using the same disk data structures thatMicrosoft Windows uses forVFAT long filename support on FAT format volumes, but it does not support any extra Unix file semantics. Theumsdos filesystem driver provides long filename support, and extra Unix file semantics. However, it does so using on-disk data structures that are not recognized by any filesystem drivers for any operating systems other than Linux.[1][2][10][11]

umsdos

[edit]

The key advantage toumsdos out of the three is that it provides full Unix file semantics. Therefore, it can be used in situations where it is desirable to install Linux on and run it from a FAT disk volume, which require such semantics to be available. However, Linux installed on and running from such a disk volume is slower than Linux installed on and running from a disk volume formatted with, for example, theext2 filesystem format.[1][12] Further, unless a utility program is regularly run every time that one switches from running Windows to running Linux, certain changes made to files and directories on the disk by Windows will cause error messages about inaccessible files in Linux.[4]

vfat

[edit]

vfat, although lacking full Unix file semantics and lacking the ability to have Linux installed on and running from a FAT disk volume, does not have the aforementioned disadvantages ofumsdos when it comes to simply sharing data on a FAT disk volume between Linux and other operating systems such as Windows. Its data structures are the same as those used by Windows for VFAT long filenames, and it does not require running a synchronization utility in order to prevent Windows and Linux data structures from becoming disjointed. For this reason, it is the most appropriate of Linux's FAT filesystem drivers to use in the majority of situations.[1][10][4]

FS-DriverLong filenamesUnix file semanticsComment
msdosNoNo8.3 filenames only
vfatYesNoUses same data structures that Windows uses
umsdosYesYesCan host Linux; may need maintenance when switching OS

Commonalities

[edit]

As mentioned previously, all of the Linux filesystem drivers support all of the three File Allocation Table sizes, 12-bit, 16-bit, and 32-bit. Other common features that they all support are various Linux mounting options (specified with the-o option to themount command):[10][3]

uid andgid
These two options tell the filesystem driver to set the (default, in the case ofumsdos) owner user ID and group ID to be a single, specified, value for all files in the volume. Both IDs are specified as numeric values (as to be found in the/etc/passwd file). So, for example, to specify to thevfat filesystem driver that all files and directories are to have owner ID 745 and group ID 15, themount command would be invoked asmount -t vfat -o uid=745,gid=15.[10][3] Linux filesystem drivers do not at present incorporate support forfile/directory passwords on FAT12/FAT16/FAT32 volumes and multi-userworld/group/owner access permissions for read/write/delete/execute rights on FAT12/FAT16 volumes as implemented in various operating systems of the Digital Research family, includingDR-DOS,PalmDOS,Novell DOS,OpenDOS,FlexOS,Concurrent DOS,Multiuser DOS, System Manager andREAL/32.
umask
This option sets theumask to apply globally to all files in the volume. For example, to specify to thevfat filesystem driver that no "group" or "other" access is to be allowed, themount command would be invoked asmount -t vfat -o umask=077.[10][3]
conv
This option specifiesfile 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 asconv=b (for "binary"),conv=a (for "auto-detect"), andconv=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.[10][3]

umsdos

[edit]

Data structure

[edit]

Theumsdos 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-.---.[1][10][4][3][13]

In the absence of this file in any given directory, and thus by default, theumsdos filesystem driver provides the same semantics as themsdos filesystem driver does for the directory: only 8.3 filenames and no extra Unix file semantics. To enable theumsdos 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 calledumssync.[1][10][4]

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 theumsdos filesystem driver to incorporate any changes made to files and directories by Windows into its private data structures in its--LINUX-.--- file. By default, theumssync 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 invokingumssync 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.[1][10][4]

Installing Linux on FAT

[edit]

As mentioned,umsdos permits installing Linux on, and then bootstrapping and running it from, a FAT format disc volume. The advantage of this is that it permits the use of Linux on a computer whereDOS is already installed, without requiring that the hard disc berepartitioned. Linux is not bootstrapped directly from aVolume Boot Record in such a scenario. Instead DOS is first bootstrapped, andloadlin or linld is used to then bootstrap Linux from DOS.[4]

The convention for such an installation is for the Linuxroot directory to be a subdirectory of the root directory of the DOSboot volume, e.g.C:\LINUX . The various Linux top-level directories are thus, to DOS, directories such asC:\LINUX\ETC (for/etc),C:\LINUX\BIN (for/bin),C:\LINUX\LIB (for/lib), and so forth. Theumsdos filesystem driver automatically prepends theC:\LINUX\ to all pathnames. The location of the Linux root directory is supplied to theumsdos filesystem driver in the first place via an option to theloadlin command. So, for example,loadlin would be invoked with a command line such asloadlin c:\linux\boot\vmlinuz rw root=c:\linux .[4][13]

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 aswap file rather than aswap partition for Linux, however this is related to the desire not to repartition the hard disc and unrelated to theumsdos filesystem driver per se.[4]

Accessing FAT formatted volumes without kernel support

[edit]
Further information:mtools

Although the filesystem drivers in the kernel make it possible to access files and directories on FAT formatted volumes in the normal manner, it is also possible to do so without kernel driver support, using the utility programs that form themtools utility suite. Like thevfat FAT filesystem driver, mountlo provides long filename support using the same disc data structures that Microsoft Windows uses.[3][14][15]

Alternately, one of theFUSE filesystem drivers may be used—FatFuse, FuseFat or mountlo.[16]

POSIX overlay filesystem

[edit]

A modern equivalent of UMSDOS is POSIX Overlay Filesystem (posixovl). It works in FUSE.[17]

See also

[edit]

References

[edit]
  1. ^abcdefghStanfield, Vicki; Smith, Roderick W. (2002).Linux system administration. Craig Hunt Linux library (2nd ed.).John Wiley and Sons. p. 166.ISBN 978-0-7821-4138-2.
  2. ^abWard, Brian (2004).How Linux works: what every superuser should know. No Starch Press Series.No Starch Press. p. 41.ISBN 978-1-59327-035-3.
  3. ^abcdefgSmith, Roderick W. (2000).The multi-boot configuration handbook. Handbook Series.Que Publishing. pp. 256, 341–342.ISBN 978-0-7897-2283-6.
  4. ^abcdefghiMcCune, Mike (2001).Integrating Linux and Windows. Open source technology series.Prentice Hall PTR. pp. 7–9.ISBN 978-0-13-030670-8.
  5. ^"Summary of changes from v2.6.10 to v2.6.11".www.kernel.org. Retrieved2017-11-15.
  6. ^"UMSDOS filesystem: UVFAT support".linux.voyager.hr. Retrieved2015-07-16.
  7. ^MuLinux Project
  8. ^Monkey Linux Explained
  9. ^The Linux/Windows combo: Use these resources to make it work
  10. ^abcdefghijRoderick W. Smith (2005).Linux in a Windows world.O'Reilly Media, Inc. p. 449.ISBN 0-596-00758-2.
  11. ^Negus, Christopher (2007).Linux bible: boot up to Ubuntu, Fedora, KNOPPIX, Debian, SUSE, and 11 other distributions. Bible Series.John Wiley and Sons. pp. 159.ISBN 978-0-470-08279-9.
  12. ^Strobel, Stefan; Elling, Volker (1997).Linux, unleashing the workstation in your PC. The Complete Linux Kit, Rainer Maurer (3rd ed.). Springer. p. 43.ISBN 978-0-387-94880-5.
  13. ^abDanesh, Arman (2002).Making Linux work: essential tips & techniques. 1001 Tips Series. Cengage Learning. pp. 19.ISBN 978-1-884133-78-7.
  14. ^Rajagopal, Raj (2000).Multi-operating system networking: living with Unix, Netware, and NT. Auerbach Best Practices Series.CRC Press. pp. 25–21.ISBN 978-0-8493-9831-5.
  15. ^Welsh, Matt (2003).Running Linux. Essential Guide to Linux (4th ed.).O'Reilly Media, Inc. p. 405.ISBN 978-0-596-00272-5.
  16. ^"FUSE: NonNativeFileSystems". Archived fromthe original on 2015-09-15.
  17. ^"POSIX Overlay Filesystem".

Further reading

[edit]
Retrieved from "https://en.wikipedia.org/w/index.php?title=FAT_filesystem_and_Linux&oldid=1305051706"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp