The Fedora file system, like all UNIX file systems, is used for storing not only data, but also metadatainformation about the files, such as who the file owner is, what permissions are associated with the file, and other file attributes. The Fedora file system is much more complex than most people care to know about. Its features are patterned after features found on commercial UNIX systems, as well as those included in research or experimental file systems. Fortunately, the native Linux file system is robust and works well with the default settings. Fedora has conveniently provided an easy-to-use setup tool for use during the installation, but here, you also learn how to manage file system settings manually. Providing a great deal of flexibility, the file system support allows Linux users to access files on file systems used by other operating systems, many of which are obscure. A sampling of the Fedora kernel modules for supported file systems is as follows:
Support for ext3, ext2, NFS, and iso9660 file systems is compiled into the Linux kernel; all others are available as modules. There is not an exact correlation between the file system source code and the modules compiled for the default kernel. The kernel documentation for the file systems can be found at /usr/src/linux-2.6/Documentation/file systems/. The usage of some of these file system modules is mentioned in the man page for mount. Physical Structure of the File System on the DiskIf you were to visualize the file system on the physical disk, it would resemble a series of boxes known as blocks. The first block on the disk is a special block that contains the boot sector; subsequent blocks contain the operating system, applications, and your data. Each individual block is made up of smaller groups of data:
How big are these blocks? The default size is 1,024 bytes, but the size can be made smaller or larger when the file system is first created. The optimum size is determined by the application of the particular machine. If you typically use very large files, a larger block size can speed up disk I/O operations at the expense of slower I/O for smaller files; the reverse is also true. For an individual system, block size might require monitoring over time and benchmarking before an optimal value is determined. For most users, the defaults have been found satisfactory. File System PartitionsFile system partitions are ways to organize blocks of data on the physical drive media and are parts of the overall file system on your computer. No single universal partition format exists. In addition to the commonly used DOS partition format (used by Linux as well), Fedora also provides support for the following partition types:
Note Other modules and support are likely available if you care to search the Internet for them; try searching on the keyword file systems on http://freshmeat.net/ and http://www.google.com/linux/. As is always the case with open-source operating systems, any skilled and enterprising soul can write his own file system modules. Network and Disk File SystemsWe can separate file systems into two broad categories: those that can be used over a network and local disk file systems. You are provided with all the applications necessary to work with both categories of file systems when using Fedora Core Linux. Network file systems are physically stored somewhere other than your local computer but appear as if they are mounted on your local computer. Note Mounting is the UNIX method of attaching a file system (also referred to as a volume) to the file system tree at a mount point. Using the mount command is covered later in this chapter. Some common network file system types are
Disk file systems are found on a physical device; they are the hard drive in your desktop or laptop computer. Some common disk file system types are
The JFS (Journaled File System from IBM) and XFS (from Silicon Graphics) file systems are available for use with Fedora Core Linux, but primarily as migration aids for those migrating existing file systems to Linux. A journaling file system adds a journal, or hidden file, to the data on the drive. Because of the way data is written to a disk, the kernel might be holding some of the data while it is deciding where to place it. If your computer were to suffer a failure, that cached data would be lost. A journaling file system keeps that data in a special place until the kernel decides to formally write it to the disk. If a system failure occurs, a special application (fsck) knows that the data was never formally written and will make certain that it is written in the correct place. This ensures that no data is lost. Journaling file systems are actually much more complex than this, but the mechanics of them are beyond the scope of this chapter. Journaling file systems such as ext3, reiserfs, JFS, and XFS are major improvements over older, nonjournaling file systems. Viewing Your System's File SystemsYour installation of Fedora might have its own unique set of useable virtual file system modules. You can view the file systems that your system can access right now (and verify your kernel's support for these file systems) by using the following command: # cat /proc/file systems Your output will vary, depending on your system's hardware and kernel settings. The test system we used for this chapter presented this output: nodev rootfs nodev bdev nodev proc nodev sockfs nodev tmpfs nodev shm nodev pipefs ext2 nodev ramfs iso9660 nodev devpts ext3 nodev usbdevfs nodev usbfs ReiserFS vfat nodev nfs nodev autofs nodev binfmt_misc The entries not preceded by nodev are not of interest to us because they do not tell us any information about the file system. On this machine, the ext2, ext3, vfat, reiserfs, and iso9660 file systems are supported. Modules for other file systems could be loaded if needed. |