503 505




Using Linux:Managing the Filesystem






-->















Previous
Table of Contents
Next




The first four entries are the ext2 filesystems comprising my Linux system. When Linux is booted, the root filesystem is mounted first; all the other local (that is, non-network) filesystems are mounted next.
The following three filesystems are all removable filesystems: two CD-ROM drives and a floppy disk drive. These have the noauto option set so that they are not automatically mounted at boot time. These removable devices have the user option set so that I can mount and unmount them without having to use su all the time. The CD-ROMs have the filesystem type iso9660, which is the standard filesystem for CD-ROMs, and the floppy drive has the filesystem type vfat, because I often use it for interchanging data with MS-DOS and Windows systems.
/proc is a special filesystem provided by the kernel as a way of providing information about the system to user programs. The information in the /proc filesystem is used in order to make utilities such as ps, top, xload, free, netstat, and so on, work. Some of the “files” in /proc are really enormous (for example, /proc/kcore) but don’t worry—all the information in the /proc filesystem is generated on-the-fly by the Linux kernel as you read it; no disk space is wasted. You can tell that they are not real files because, for example, root can’t give them away with chown.
The final “filesystem” isn’t, in fact, a filesystem at all; it is an entry that indicates a disk partition used as swap space. Swap partitions are used to implement virtual memory. Files can also be used for swap space. The names of the swap files go in the first column where the device name usually goes.
The two numeric columns on the right relate to the operation of the dump and fsck commands, respectively. The dump command compares the number in column five (the dump interval) with the number of days since that filesystem was last backed up so that it can inform the system administrator that the filesystem needs to be backed up. Other backup software—for example, Amanda—can also use this field for the same purpose. (Amanda can be found at the URL http://www.cs.umd.edu/projects/amanda/amanda.html.) Filesystems without a dump interval field are assumed to have a dump interval of zero, denoting “never dump.” For more information, see the manual page for dump.
The sixth column is the fsck pass, which indicates the filesystems that can be checked in parallel at boot time. The root filesystem is always checked first, but after that, separate drives can be checked simultaneously, Linux being a multitasking operating system. There is no point, however, in checking two filesystems on the same hard drive at the same time, because this results in lots of extra disk head movement and wasted time. All the filesystems that have the same pass number are checked in parallel, from 1 upward. Filesystems with a 0 or missing pass number (such as the floppy and CD-ROM drives) are not checked at all.
Creating New Filesystems Manually
When you install Red Hat Linux, the installation process makes some new filesystems and sets the system up to use them. You can format new filesystems by using cabaret, as described in the earlier section “Creating New Filesystems with cabaret,” but you can also do this manually.
Many operating systems don’t distinguish between the preparation of the device’s surface to receive data (formatting) and the building of new filesystems. Linux does distinguish between the two, principally because only floppy disks need formatting in any case, and also because Linux offers as many as half a dozen different filesystems that can be created (on any block device).

SEE ALSO• For a list of a number of different filesystems for Linux, see Table 7.1 on page 94.

Linux provides a generic command, mkfs, that enables you to make a filesystem on a block device. In fact, because UNIX manages almost all resources with the same set of operations, mkfs can be used to generate a filesystem inside an ordinary file! Because this is unusual, mkfs asks for confirmation before proceeding. When this is done, you can even mount the resulting filesystem using the loop device.
Because of the tremendous variety of filesystems available, almost all the work of building the new filesystem is delegated to a separate program for each; however, the generic mkfs program provides a single interface for invoking them all. It’s not uncommon to pass options to the top-level mkfs (for example, -V to make it show what commands it executes or -c to make it check the device for bad blocks). The generic mkfs program also enables you to pass options to the filesystem-specific mkfs. There are many of these filesystem-dependent options, but most of them have sensible defaults, and you normally would not want to change them.
The only options you might want to pass to mke2fs, which builds ext2 filesystems, are -m and -i. The -m option specifies how much of the filesystem is reserved for root’s use (for example, for working space when the system disk would otherwise have filled completely). The -i option is more rarely exercised and is used for setting the balance between inodes and disk blocks; it is related to the expected average file size. As stated previously, the defaults are reasonable for most purposes, so these options are used only in special circumstances.



Previous
Table of Contents
Next














Wyszukiwarka

Podobne podstrony:
503 505
505 (3)
503 Wpusty żeliwne
505 praktycznych skryptow dla webmastera
instrukcja obslugi dla zestawu s uchawkowego Nokia BH 505 PL
fringe 503 hdtv lol
503 Jak sporządzić dokumentację zasad rachunkowości cz II
505 (2)
House MD 503 Adverse Events
505 508
503 (2)
503 (2)
demo cgi 505
ReadMe (503)
04 (505)

więcej podobnych podstron