FAT filesystem and Linux: Difference between revisions

Content deleted Content added
#suggestededit-add 1.0
Tags: Mobile edit Mobile app edit Android app edit
Bender the Bot (talk | contribs)
m HTTP to HTTPS for SourceForge
 
(4 intermediate revisions by 3 users not shown)
Line 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 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 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>{{Cite web|url=httphttps://sourceforge.net/projects/posixovl/|title = POSIX Overlay Filesystem}}</ref>
 
==See also==