493 495




Using Linux:Managing the Filesystem






-->















Previous
Table of Contents
Next




Table 29.1 contains options useful for mount, given in alphabetical order. Unless otherwise indicated, these options are valid for all filesystem types, although asking for asynchronous writes to a CD-ROM is no use! Options applicable only to nfs filesystems are not listed here; refer to the nfs manual page for those.
Table 29.1 mount options



Option
Description



async
Write requests for the filesystem normally should wait until the data has reached the hardware; with this option, the program continues immediately instead. This does mean that the system is slightly more prone to data loss in the event of a system crash, but, on the other hand, crashes are very rare with Linux. This option speeds up nfs filesystems by a startling extent. The opposite of this option is sync.

auto
Indicates to mount that it should mount the device when given the -a flag. This flag is used by the startup scripts to make sure that all the required filesystems are mounted at boot time. The opposite of this option is noauto.

defaults
Turns on the options rw, suid, dev, exec, auto, nouser, and async.

dev
Allows device nodes on the system to be used. Access to devices is completely determined by access rights to the on-disk device node. Hence, if you mount an ext2 filesystem on a floppy and you have previously placed a writable /dev/kmem device file on the disk, then you’ve just gained read/write access to kernel memory. System administrators generally prevent this from happening by mounting removable filesystems with the nodev mount option.

exec
Indicates to the kernel that it should allow the execution of programs on the filesystem. This option is more frequently seen as noexec, which indicates to the kernel that execution of programs on this filesystem shouldn’t be allowed. This is generally used as a security precaution or for nfs filesystems mounted from another machine that contain executable files of a format unsuitable for this machine (for example, intended for a different CPU).

noauto
Opposite of auto; see auto table entry.

nodev
Opposite of dev; see dev table entry.

noexec
Opposite of exec; see exec table entry.

nosuid
Opposite of suid; see suid table entry.

nouser
Opposite of user; see user table entry.

remount
Allows the mount command to change the flags for an already-mounted filesystem without interrupting its use. You can’t unmount a filesystem that is currently in use, and this option is basically a workaround. The system startup scripts, for example, use the command mount -n -o remount,ro / to change the root filesystem from read-only (it starts off this way) to read/write (its normal state). The -n option indicates to mount that it shouldn’t update /etc/fstab because it can’t do this while the root filesystem is still read-only.

ro
Mounts the filesystem read-only. This is the opposite of the option rw.

rw
Mounts the filesystem read/write. This is the opposite of the option ro.

suid
Allows the set user ID and set group ID file mode bits to take effect. The opposite of this option is nosuid. The nosuid option is more usual; it is used for the same sorts of reasons that nodev is used.

sync
All write operations cause the calling program to wait until the data has been committed to the hardware. This mode of operation is slower but a little more reliable than its opposite, asynchronous I/O, which is indicated by the option async (see preceding).

user
Allows ordinary users to mount the filesystem. When there is a user option in /etc/fstab, ordinary users indicate which filesystem they want to mount or unmount by giving the device name or mount point; all the other relevant information is taken from the /etc/fstab file. For security reasons, user implies the noexec, nosuid, and nodev options.



Options are processed by the mount command in the order in which they appear on the command line (or in /etc/fstab). Thus, it is possible to allow users to mount a filesystem and then run set user ID executables by using the options user, suid, in that order. Using them in reverse order (suid, user) doesn’t work because the user option turns the suid option off again.

SEE ALSO• For more information about using the mount command, see page 115.

There are many other options available, but these are all specific to particular filesystems. All the valid options for mount are detailed in its manual page. An example is the umask flag for the vfat and fat filesystems, which allows you to make all the files on your MS-DOS or Windows partitions readable (or even writable if you prefer) for all the users on your Linux system.
Setting Up New Filesystems
When the kernel boots, it attempts to mount a root filesystem from the device specified by the kernel loader, LILO. The root filesystem is initially mounted read-only. During the boot process, the filesystems listed in the filesystem table /etc/fstab are mounted. This file specifies which devices are to be mounted, what kinds of filesystems they contain, at what point in the filesystem the mount takes place, and any options governing how they are to be mounted. The format of this file is described in fstab.



Importance of the /etc/fstab tableAlways make a backup copy of the filesystem table, /etc/fstab, before making changes to your system, such as adding additional hard drives, or editing the table. If you make a mistake in the file, your system may not boot properly or at all. With a backup copy you can easily restore your system’s settings.





Previous
Table of Contents
Next














Wyszukiwarka

Podobne podstrony:
495 CHEMIA LEKÓW I STOPIEN
05 (495)
WBI FR 493 87Beschreibung 20061219 3
495 Ewidencja kosztów w firmie usługowej
493 494
495 (2)
index (495)
489 493
493 a
493 497

więcej podobnych podstron