UMSDOS
Encyclopedia
Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

 has several filesystem drivers for the File Allocation Table
File Allocation Table
File Allocation Table is a computer file system architecture now widely used on many computer systems and most memory cards, such as those used with digital cameras. FAT file systems are commonly found on floppy disks, flash memory cards, digital cameras, and many other portable devices because of...

 (FAT) filesystem format. These are commonly known by the names used in the mount
Mount (Unix)
The Unix command line utility mount instructs the operating system that a file system is ready to use, and associates it with a particular point in the system's file system hierarchy . The counterpart umount instructs the operating system that the file system should be disassociated from its mount...

command to invoke particular drivers in the kernel: msdos, vfat, and umsdos.

Differences, advantages, and disadvantages

All of the Linux filesystem drivers support all of the three File Allocation Table sizes, 12-bit, 16-bit, and 32-bit (the last commonly known as FAT32). Where they differ is in the provision of support for long filename
Long filename
Long filenames , are Microsoft's way of implementing filenames longer than the 8.3 filename, or short-filename, naming scheme used in Microsoft DOS in their modern FAT and NTFS filesystems. Because these filenames can be longer than an 8.3 filename, they can be more descriptive...

s, beyond the 8.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 as file permissions. The filesystem drivers are mutually exclusive. Only one can be used to mount any given disc 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 disc volume.

The msdos filesystem driver provides no extra Unix file semantics and no long filename support. If a FAT disc 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 disc volume be maintained. The vfat filesystem driver provides long filename support using the same disc data structures that Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 uses for long filename support on FAT format volumes, but it does not support any extra Unix file semantics. The umsdos filesystem driver provides long filename support, and extra Unix file semantics. However, it does so using on-disc data structures that are not recognized by any filesystem drivers for any operating systems other than Linux.

The key advantage to umsdos 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 disc volume, which require such semantics to be available. However, Linux installed on and running from such a disc volume is slower than Linux installed on and running from a disc volume formatted with, for example, the ext2
Ext2
The ext2 or second extended filesystem is a file system for the Linux kernel. It was initially designed by Rémy Card as a replacement for the extended file system ....

 filesystem format. 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 disc by Windows will cause error messages about inaccessible files in Linux.

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

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 -o option to the mount command):
uid and gid:These two options tell the filesystem driver to set the (default, in the case of umsdos) owner 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 the vfat filesystem driver that all files and directories are to have owner ID 745 and group ID 15, the mount command would be invoked as mount -t vfat -o uid=745,gid=15 .
umask:This option sets the umask
Umask
umask is a command and a function in POSIX environments that sets the file mode creation mask of the current process which limits the permission modes for files and directories created by the process...

 to apply globally to all files in the volume. For example, to specify to the vfat filesystem driver that no "group" or "other" access is to be allowed, the mount command would be invoked as mount -t vfat -o umask=077 .
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 structures of umsdos

The umsdos 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 umsdos filesystem driver provides the same semantics as the msdos filesystem driver does for the directory: only 8.3 filenames and no extra Unix file semantics. To enable the umsdos 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 umsdos 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.

Installing Linux on and booting it from FAT volumes using umsdos

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 where DOS
DOS
DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...

 is already installed, without requiring that the hard disc be repartitioned. Linux is not bootstrapped directly from a Volume Boot Record
Volume Boot Record
A volume boot record is a type of boot sector introduced by the IBM Personal Computer...

 in such a scenario. Instead DOS is first bootstrapped, and loadlin
Loadlin
loadlin is a Linux boot loader that runs under DOS or Microsoft Windows . It allows the Linux system to load and replace the running DOS/Windows without altering existing DOS/Windows system files....

 is used to then bootstrap Linux from DOS.

The convention for such an installation is for the Linux root directory
Root directory
In computer file systems, the root directory is the first or top-most directory in a hierarchy. It can be likened to the root of a tree — the starting point where all branches originate.-Metaphor:...

 to be a subdirectory of the actual root directory of the DOS boot volume
System partition and boot partition
In Microsoft Windows, the system partition and boot partition refer to:*The system partition is a disk partition that contains the boot sector and files such as NTLDR that are needed for booting Windows XP and earlier...

, 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 umsdos filesystem driver automatically prepends the C:\LINUX\ to all pathnames. The location of the Linux root directory is supplied to the umsdos filesystem driver in the first place via an option to the loadlin command. So, for example, for the aforegiven root directory 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 umsdos filesystem driver per se.

Development history and kernel/distribution support

Most of the major Linux distributions, including RedHat, SuSE, and Debian, do not employ umsdos to permit installation of Linux on a FAT disc volume. A few distributions do, however. These include distributions such as Phat Linux, a distribution created by two schoolchildren which installs in C:\PHAT on DOS by unpacking a ZIP file and is booted by running a COMMAND.COM
COMMAND.COM
COMMAND.COM is the filename of the default operating system shell for DOS operating systems and the default command line interpreter on Windows 95, Windows 98 and Windows Me...

 script named LINUX.BAT , and ZipSlack
ZipSlack
ZipSlack was a specially compiled release of the Slackware Linux distribution which was designed to be lightweight and portable. It was distributed in a ZIP archive along with the Slackware release....

.

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. UMSDOS was removed from the Linux 2.6.11 kernel for lack of maintenance. UVFAT, an extension of UMSDOS to use the Windows data structures for long filenames instead of its own, was discontinued before release. They should work in 2.4.x kernels.

Earlier Linux distributions which used UMSDOS are MuLinux
MuLinux
muLinux was an Italian, English-language lightweight Linux distribution maintained by mathematics and physics professor Michele Andreoli, meant to allow very old and obsolete computers to be used as basic intranet/Internet servers or text-based workstations with a UNIX-like operating system...

, Monkey Linux and Winlinux 2000.

Accessing FAT formatted volumes without kernel support

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
Mtools
Mtools is an open source collection of tools to allow a Unix operating system to manipulate files on an MS-DOS filesystem, typically a floppy disk or floppy disk image.The mtools are part of the GNU Project and are released under the GPL licence.-Usage:...

utility suite. Like the vfat FAT filesystem driver, mtools provides long filename support using the same disc data structures that Microsoft Windows uses.

POSIX Overlay Filesystem

A modern equivalent of UMSDOS is POSIX Overlay Filesystem (posixovl). It works in FUSE. http://sourceforge.net/projects/posixovl/

Further reading

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK