Using Linux:Managing the Filesystem
-->
Previous
Table of Contents
Next
Filesystem Options
When you create a new entry for a filesystem using cabaret, as described in the preceding sections, you are given the opportunity to change the options pertaining to it. Many options are possible, but only some of them are commonly used.
The options fall fairly neatly into those suitable for removable devices and those suitable for nonremovable ones.
Options Useful for Removable Devices
Removable devices like floppy disks must be mounted and unmounted in order to be used (unless you use the mtools package for floppy disks). The Users Can Mount Filesystem option (which appears as user in /etc/fstab) is required for this to happen. Conversely, for nonremovable devices like hard disk partitions, allowing just anybody to unmount the /usr filesystem would pretty much be a disaster. The various Ignore options are listed in Table 29.2.
Table 29.2 Removable device mounting options
Long Name
Short Name
Ignore setuid executables
nosuid
Ignore device files
nodev
Ignore executables
noexec
The first two options, nosuid and nodev, are security features, which prevent any old person from bringing along a specially prepared UNIX filesystem and using it to compromise your machine. If you have entries in your filesystem table for removable ext2 filesystems, set these two options for them.
Setting removable device options
1. Log on as the root operator. Using your favorite text editor, such as pico, open the /etc/fstab file:
# pico w /etc/fstab
2. If you have a removable device, such as a Zip drive, you can make your system a bit more secure by inserting the nosuid and nodev mount options. Look for your devices entry in the fstab file:
/dev/sda4 /mnt/zip vfat
user,noauto,dev,exec,suid 0 0
3. Make sure the devices are not mounted. Then change the dev and suid options to nodev and nosuid, like this:
/dev/sda4 /mnt/zip vfat
user,noauto,nodev,exec,nosuid 0 0
4. Save the fstab and quit your word processor.
The third ignore option is also sometimes used on network servers. Some filesystems are designed to be mounted only by client machines and arent of much use to the server itself. They might, for example, contain executables for a bunch of client machines running some incompatible version of UNIX. If this is the case, you should set the noexec option so that nobody can try to run the incompatible kinds of programs.
Options Useful for Fixed Devices
Most fixed devices need to be mounted at boot time, so that option should normally be set for nonremovable devices. On the other hand, this option should not normally be set for removable devices since there often is no disk in the drive at boot time.
Access timestamps and Linux
Although the access timestamp is an integral part of all UNIX filesystems, including Linuxs ext filesystem, disabling usually doesnt break anything. The most significant thing that this breaks is the reporting of new mail; if the modification time for your mailbox is newer than its access time, you must have received new mail since you last read mail. Conversely, if the access time is newer, you have no unread mail. This fact is used by the finger program. Some specialized systems benefit from the noatime option, particularly Usenet News servers with a lot of clients. For most other machines, this option is usually left alone.
The writable (rw) flag is usually set, but one might unset it for CD-ROM drives that arent writable anyway, or for filesystems containing important archive data.
The updateatime option is relatively new to Linux and isnt used by most people. Normally one of the three timestamps on a file is a record of the time that it was last accessed. If a filesystem is heavily read from and rarely written to, then the endless updating of access-time timestamps can lead to an unproductive waste of performance.
The user option is occasionally used for filesystems belonging to other operating systems; it allows ordinary users to mount Microsoft Windows filesystems (for example) and access the files on them without falling afoul of the fact that Windows (except Windows NT in some cases) does not keep track of who owns files.
Mount Options for NFS Filesystems
When you set up an NFS filesystem, the normal Options dialog box also includes an NFS Options button that allows you to customize the way the filesystem is mounted and used.
Most of the nfs options are concerned with what should happen if the server machine is unreachable (because, for example, either it or the network has failed). This perhaps seems unlikely but, believe me, youll care on the day it happens.
The default options just make the system keep trying indefinitely until the filesystem can be mounted. Many filesystems are essential but some are not. For nonessential filesystems, the default options are probably too conservative. For these, you should check the Retry in Background If Mount Fails checkbox. This allows your Linux system to continue to boot if the remote filesystem is not available. If a program has to use a file on the failing server, it waits until the filesystem has been mounted (the upper limit on how long this takes until it gives up is also configurable).
The read and write sizes are configurable. Again, the defaults are conservative and should be satisfactory. The default read and write size is 1,024 bytes (this conveniently fits inside a 1,500-byte Ethernet packet), but often the system performs much better if this size is increased to 4,096 or even 8,912 bytes (that is, 4KB or 8KB). Sometimes doing this actually makes things worse rather than better, however; it depends on the server and the quality of the network cards, as well as the amount of network traffic.
Previous
Table of Contents
Next
Wyszukiwarka
Podobne podstrony:
Kultowa 500 EskaRock 2012US NSA Pays Israel $500,000 in 2004Ethofol 500 SCOSCAR 500 SCDakota 500 SCGOLDEN FENIKAN 500 SCTerex RCI 500 Troubleshooting ManualZALACZNIK 4 RODZINA 500słowniczek 500remote master 500 bw5080eTopsin M 500 SCwięcej podobnych podstron