📄 mount.txt
字号:
1999-01-31 Emil Brink About auto mounting1. INTRODUCTIONIn gentoo version 0.9.23, support for auto mounting was added. Thisis (like much other in gentoo) most useful on personal systems,and has *ONLY* been tested under Linux. If you're having troublewith mounting on other platforms, don't be surprised. This file gives a brief description of the mount support,and how to configure it.2. MOUNT MODESA "mode" variable determines when gentoo will attempt to mountdirectories. There are three modes available: By default, the mode is "never", which causes auto mountingto be disabled. In this mode, gentoo will never mount anything nomatter what you do. In the next mode, gentoo will only attempt to mount whenyou access a directory either by double-clicking it in a pane, orby activating a shortcut pointing at the directory in question. In the last mode, gentoo will attempt to do a mount eachtime you access a directory. This is perhaps the most comfortableway of doing it, but also the slowest.3. MOUNT/UNMOUNT COMMANDSSince there is no portable way of mounting file systems, and themount(2) system call available on Linux is privileged, gentoo usesthe normal user-level mount(8) command to do the mounting. For theexact same reasons, unmounting is done by calling the umount(8)shell command. gentoo assumes that it can mount a file system on a mount-point X by issuing the command "mount X", and that it can unmountin the same way. If this isn't true on your system, you must writeglue scripts that have this interface. You don't need to call yourscripts "mount" and "umount", however, since the actual commandnames (but not the simple "calling convention") is configurable.4. AVAILABLE FILE SYSTEM DATABASEgentoo obtains information about which directories are mount pointsby reading in a (set of) system database(s). On Linux systems, thisdatabase is stored in the "/etc/fstab" file. This file containsinformation about file systems, including which system mounts underdirectory. gentoo buffers this information and uses it to determineif a directory being accessed is a mount point. As hinted above, gentoo is not actually limited to readingjust one of these files. You can specify any number of files, sep-arated by colons, in the "fstab" path (on the Paths config tab).5. MOUNTED FILE SYSTEMS DATABASEBefore issuing a mount command to mount a new file system, gentooneeds to check if the file system is already mounted. This is toavoid errors from the "mount" command. This check is done through another (set of) system data-base(s). On Linux, "/etc/mtab" holds the relevant information. Thedefault is to use "/proc/mounts", however, since the latter isboth faster to access, and more up to date. The time required to scan this database (which is notbuffered, since you can mount/unmount outside of gentoo) is thereason why the middle mounting mode exists: it reduces the numberof accesses that are considered for mounting, thereby saving time. Again, you are not limited to just one of these databaseseither. You can specify a list of files, separated by colons, inthe "mtab" path (on the Paths tab in the config window).6. CONFIGURING THE MOUNTINGThere's a tab labeled "Mounting" in the configuration window. Thistab holds most of the controls needed to configure the mounting.The tab is split into two frames: one for setting the mode, andthe other for setting various flags. You set the mode by clicking on one of the radio buttonsin the mode frame. If you set the mounting mode to "Never", theoptions frame is disabled to indicate that they are not used. Below the mode frame is another frame, labeled "MountOptions". It contains some additional controls that let you fine-tune the behavior of the mounting. The text entry fields labeled "Mount Command" and "UnmountCommand" let you specify the names of the shell commands used tomount and unmount file systems. These commands should take, as asingle argument, the name of the *mount point*, not the filesystem! Also, you must specify the path (e.g. "/bin/mount") too. The check button labeled "Only Mount on Toplevel Dirs?"enables a little optimization: if checked, gentoo will not mounton a directory that has more than 2 hard links to it. This meansany directory that contains another directory will never be con-sidered as a possible mount point. The "Use Command Error Dialog?" option makes gentoo grabany error output by the mount/unmount commands and show it in adialog. If not checked, errors will appear in the shell window. The "Unmount at Exit?" option makes gentoo call the un-mount command on all file systems it mounted. This is recommended.NOTE: in addition to the stuff on the "Mounting" tab, you must also set the "fstab" and "mtab" paths (on the "Paths" tab, shockingly enough) to sensible values. For a Linux system, fstab="/etc/fstab" and mtab="/proc/mounts" works well.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -