FAT filesystem and Linux: Difference between revisions

Content deleted Content added
m not a typo templates to avoid spellchecker
Bender the Bot (talk | contribs)
m HTTP to HTTPS for SourceForge
 
(8 intermediate revisions by 7 users not shown)
Line 1:
{{Short description|Widely used Linux filesystem format}}
[[Linux]] has several [[filesystem]] drivers for the [[File Allocation Table]] (FAT) filesystem format. These are commonly known by the names used in the <code>[[mount (Unix)|mount]]</code> command to invoke particular drivers in the kernel: ''{{Not a typo|msdos}}'', ''{{Not a typo|vfat}}'', and ''{{Not a typo|umsdos}}''.<ref name="StanfieldSmith">{{cite book |title=Linux system administration |series=Craig Hunt Linux library |author-first1=Vicki |author-last1=Stanfield |author-first2=Roderick W. |author-last2=Smith |edition=2nd |publisher=[[John Wiley and Sons]] |year=2002 |isbn=978-0-7821-4138-2 |pages=166}}</ref><ref name="Ward">{{cite book |title=How Linux works: what every superuser should know |series=No Starch Press Series |author-first=Brian |author-last=Ward |publisher=[[No Starch Press]] |year=2004 |isbn=978-1-59327-035-3 |pages=41}}</ref>
 
Line 6 ⟶ 7:
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|date=September 2009}} UMSDOS was removed from the Linux 2.6.11 kernel for lack of maintenance.<ref>{{Cite web |title=Summary of changes from v2.6.10 to v2.6.11 |url=https://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.11|website=www.kernel.org |access-date=2017-11-15}}</ref> UVFAT, an extension of UMSDOS to use the Windows data structures for long filenames instead of its own, was discontinued before release.<ref>{{Cite web |title=UMSDOS filesystem: UVFAT support |url=http://linux.voyager.hr/umsdos/#uvfat |website=linux.voyager.hr |access-date=2015-07-16}}</ref> They should work in 2.4.x kernels.{{Citation needed|date=September 2009}}
 
Earlier Linux distributions which used UMSDOS are [[MuLinux]],<ref>[http://mulinux.narod.ru/en_index.html MuLinux Project]</ref> Monkey Linux<ref>[http://projectdevolve.tripod.com/text/descript.htm Monkey Linux Explained]</ref> and Winlinux 2000.<ref>[https://archive.istoday/20120707065033/http://articles.techrepublic.com.com/5100-10878_11-1044390.html The Linux/Windows combo: Use these resources to make it work]</ref>
 
== Feature comparison ==
Line 19 ⟶ 20:
 
=== {{Not a typo|vfat}} ===
''{{Not a typo|vfat}}'', whilstalthough 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 of ''{{Not a typo|umsdos}}'' 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.<ref name="StanfieldSmith"/><ref name="Smith1"/><ref name="McCune"/>
 
{| class="wikitable sortable"
Line 33 ⟶ 34:
 
== Commonalities ==
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 <code>-o</code> option to the <code>[[mount (Unix)|mount]]</code> command):<ref name="Smith1"/><ref name="Smith2"/>
;<code>uid</code> and <code>gid</code>:These two options tell the filesystem driver to set the (default, in the case of ''{{Not a typo|umsdos}}'') 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 <code>[[/etc/passwd]]</code> file). So, for example, to specify to the ''{{Not a typo|vfat}}'' filesystem driver that all files and directories are to have owner ID 745 and group ID 15, the <code>mount</code> command would be invoked as <syntaxhighlight lang{{nowrap|1="bash" inline<code>mount -t vfat -o uid=745,gid=15</syntaxhighlightcode>.<ref name="Smith1"/><ref name="Smith2"/>}} Linux filesystem drivers do not at present incorporate support for [[FAT file password|file/directory password]]s on FAT12/FAT16/FAT32 volumes and multi-user [[FAT file access rights|world/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, including [[DR-DOS]], [[PalmDOS]], [[Novell DOS]], [[OpenDOS]], [[FlexOS]], [[Concurrent DOS]], [[Multiuser DOS]], System Manager and [[REAL/32]].<!-- not sure if REAL/32 supports owner-IDs on FAT32. If it does it would require certain tweaks as the owner-ID entry is used for the high-word of the cluster number on FAT32 volumes now -->
;<code>umask</code>:This option sets the [[umask]] to apply globally to all files in the volume. For example, to specify to the ''{{Not a typo|vfat}}'' filesystem driver that no "group" or "other" access is to be allowed, the <code>mount</code> command would be invoked as {{nowrap|1=<syntaxhighlight lang="bash"code inline>mount -t vfat -o umask=077</syntaxhighlightcode>.<ref name="Smith1"/><ref name="Smith2"/>}}
;<code>conv</code>: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 <code>conv=b</code> (for "binary"), <code>conv=a</code> (for "auto-detect"), and <code>conv=t</code> (for "text"), respectively. The latter two options carry an inherent risk of corrupting non-text file data. No conversion at all is the default.<ref name="Smith1"/><ref name="Smith2"/>
 
Line 50 ⟶ 51:
As mentioned, ''{{Not a typo|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 where [[DOS]] is already installed, without requiring that the hard disc be [[partition (computing)|repartitioned]]. Linux is not bootstrapped directly from a [[Volume Boot Record]] in such a scenario. Instead DOS is first bootstrapped, and [[loadlin]] or {{Not a typo|linld}} is used to then bootstrap Linux from DOS.<ref name="McCune"/>
 
The convention for such an installation is for the Linux [[root directory]] to be a subdirectory of the root directory of the DOS [[system partition and boot partition|boot volume]], e.g. <code>C:\LINUX</code> . The various Linux top-level directories are thus, to DOS, directories such as <code>C:\LINUX\ETC</code> (for <code>/etc</code>), <code>C:\LINUX\BIN</code> (for <code>/bin</code>), <code>C:\LINUX\LIB</code> (for <code>/lib</code>), and so forth. The ''{{Not a typo|umsdos}}'' filesystem driver automatically prepends the <code>C:\LINUX\</code> to all pathnames. The ___location of the Linux root directory is supplied to the ''{{Not a typo|umsdos}}'' filesystem driver in the first place via an option to the <code>loadlin</code> command. So, for example, <code>loadlin</code> would be invoked with a command line such as <syntaxhighlight inline lang="dos"code>loadlin c:\linux\boot\vmlinuz rw root=c:\linux</syntaxhighlightcode> .<ref name="McCune"/><ref name="Danesh">{{cite book |title=Making Linux work: essential tips & techniques |series=1001 Tips Series |author-first=Arman |author-last=Danesh |publisher=Cengage Learning |year=2002 |isbn=978-1-884133-78-7 |pages=[https://archive.org/details/makinglinuxworke00dane/page/19 19] |url=https://archive.org/details/makinglinuxworke00dane/page/19 }}</ref>
 
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 ''{{Not a typo|umsdos}}'' filesystem driver per se.<ref name="McCune"/>
Line 58 ⟶ 59:
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 the [[mtools]] utility suite. Like the ''{{Not a typo|vfat}}'' FAT filesystem driver, {{Not a typo|mountlo}} provides long filename support using the same disc data structures that Microsoft Windows uses.<ref name="Smith2"/><ref name="Rajagopal">{{cite book |title=Multi-operating system networking: living with Unix, Netware, and NT |series=Auerbach Best Practices Series |author-first=Raj |author-last=Rajagopal |publisher=[[CRC Press]] |year=2000 |pages=[https://archive.org/details/multioperatingsy0000unse/page/25 25–21] |isbn=978-0-8493-9831-5 |url=https://archive.org/details/multioperatingsy0000unse/page/25 }}</ref><ref name="Welsh">{{cite book |title=Running Linux |series=Essential Guide to Linux |author-first=Matt |author-last=Welsh |edition=4th |publisher=[[O'Reilly Media, Inc.]] |year=2003 |isbn=978-0-596-00272-5 |pages=405}}</ref>
 
Alternately, one of the [[FUSE (Linux)|FUSE]] filesystem drivers may be used—FatFuse, FuseFat or {{Proper name|mountlo}}.<ref>{{cite web |url=httphttps://sourceforge.net/p/fuse/wiki/NonNativeFileSystems/ |title=FUSE: NonNativeFileSystems |url-status=dead |archive-url=https://web.archive.org/web/20150915191135/http://sourceforge.net/p/fuse/wiki/NonNativeFileSystems/ |archive-date=2015-09-15 }}</ref>
 
== POSIX overlay filesystem ==
A modern equivalent of UMSDOS is POSIX Overlay Filesystem ({{Not a typo|posixovl}}). It works in FUSE.<ref>http{{Cite web|url=https://sourceforge.net/projects/posixovl/|title = POSIX Overlay Filesystem}}</ref>
 
==See also==