Lemur zaprasza
Red Hat® Linux 6 Unleashed
Chapter 15: Filesystems, Disks, and Other Devices Previous
Sections in this Chapter: Character Devices Mounting with the User Mount Tool Repairing Filesystems Block Devices Setting Up Filesystems Various Kinds of Hardware Creating New Filesystems Character Devices The mount Command Creating and Editing Filesystems Graphically with fsconf Previous SectionNext Section Setting Up Filesystems Editing /etc/fstab Manually There are at least two ways of changing the entries in the /etc/fstab file. The first is to edit the file manually using your favorite editor. This assumes that you are a flawless typist and know all of the different options. Of course, knowing how to edit the file by hand means you do not have to have X Windows running. The second way I discuss changing the /etc/fstab file is through the fsconf utility (/bin/fsconf). Editing /etc/fstab Manually The filesystem table /etc/fstab is just a text file; it is designed to have a specific format that is readable by humans and not just computers. It is separated into columns by tabs or spaces. (It doesn't matter which you use.) You can edit it with your favorite text editor; it doesn't matter which. You must take care, however, if you modify it by hand because removing or corrupting an entry will make the system unable to mount that filesystem the next time it boots. For this reason, I make a point of saving previous versions of this file using the Revision Control System (a very useful program; see the manual page for rcs).A sample /etc/fstab looks like this: # # /etc/fstab # # You should be using fstool (control-panel) to edit this! # #<device> <mountpoint> <filesystemtype> <options> <dump> <fsckorder> /dev/hda1 / ext2 defaults 1 1 /dev/hdb5 /home ext2 defaults,rw 1 2 /dev/hda3 /usr ext2 defaults 1 2 /dev/hdb1 /usr/src ext2 defaults 1 3 /dev/hdc /mnt/cdrom iso9660 user,noauto,ro 0 0 /dev/sbpcd0 /mnt/pcd iso9660 user,noauto,ro 0 0 /dev/fd1 /mnt/floppy vfat user,noauto 0 0 /proc /proc proc defaults /dev/hda2 none swap sw The first four entries are the ext2 filesystems composing the sample Linux system. When Linux is booted, the root filesystem is mounted first; all the other local (that is, non-network) filesystems are mounted next. Filesystems appear in /etc/fstab in the order they are mounted; /usr must appear before /usr/src, for example, because the mount point for one filesystem exists on the other. The following three filesystems are all removable filesystems (two CD-ROMs and a floppy drive). These have the noauto option set so that they are not automatically mounted at boot time. The 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.The last two filesystems are special; the first (/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 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). Don't worry; no disk space is wasted. All the information in the /proc filesystem is generated on-the-fly by the Linux kernel as you read it. 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 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. The dump command compares the number in column 5 (the dump interval) with the number of days since that filesystem was last backed up. This way 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. (You can find Amanda at .) Filesystems without a dump interval field are assumed to have a dump interval of 0, denoting "never dump." For more information, see the manual page for dump. The sixth column is the fsck pass and indicates which filesystems can be checked in parallel at boot time. The root filesystem is always checked first, but after that, separate drives can be checked simultaneously because Linux is 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 a lot 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. Red Hat® Linux 6 Unleashed
Chapter 15: Filesystems, Disks, and Other Devices Previous
Sections in this Chapter: Character Devices Mounting with the User Mount Tool Repairing Filesystems Block Devices Setting Up Filesystems Various Kinds of Hardware Creating New Filesystems Character Devices The mount Command Creating and Editing Filesystems Graphically with fsconf Previous SectionNext Section © Copyright Macmillan USA. All rights reserved. |