umount 中文man頁面
NAME 名字
umount - 卸載文件系統(tǒng)
總覽
umount [-hV]
umount -a [-nrv] [-t vfstype]
umount [-nrv] device | dir [...]
描述
umount 可以卸除當前掛載在文件層次目錄中的文件系統(tǒng)。文件系統(tǒng)形式可以是以它所在的目錄的形式指定,也可以是以它所在的特殊設備的形式來指定。
請注意當文件系統(tǒng)正處于使用狀態(tài)時,不能進行卸載操作,必須等工作完成后才能進行卸除。例如,如果在當前文件系統(tǒng)中有打開的文件或某些進程正工作在該文件系統(tǒng)的某個目錄下時,或者是它上面的一個交換文件正在使用。干涉的進程甚至可以是 umount 本身 - 它打開 libc,而隨后 libc 可能會打開本地文件.
umount 命令的選項:
- -V
- 打印版本信息并退出。
- -h
- 顯示幫助信息并退出。
- -v
- 以冗長模式運行。
- -n
- 在卸載后不將相應信息寫入 /etc/mtab 文件。
- -r
- 如果卸載失敗,試圖以只讀方式進行重新掛載。
- -a
- 卸載所有在 /etc/mtab 文件中描述的文件系統(tǒng)。(在 umount 版本或以后的版本中,不會卸載 proc 文件系統(tǒng))
- -t vfstype
- 只卸載指定類型的文件系統(tǒng)。如果要一次指定多個文件系統(tǒng),可以用逗號分隔。如在指定文件系統(tǒng)前加 no ,則可卸載除些文件系統(tǒng)以外的其它文件系統(tǒng)。
- -f
- 強制卸載(比如不可達的 NFS )。(此選項須在高于 2.1.116 的版本上使用)
環(huán)路設備
如果在 /etc/mtab 文件中存在有 `loop=...' 這樣的參數(shù), umount 命令將釋放與掛載相關(guān)聯(lián)的環(huán)路設備.任何掛起的環(huán)路設備可以用 `losetup -d' 命令來釋放。參閱 losetup(8).
相關(guān)文件
/etc/mtab 已掛載文件系統(tǒng)的清單。
另見
umount(2), mount(8), losetup(8).
#p#
NAME
umount - unmount file systems
SYNOPSIS
umount [-hV]
umount -a [-dflnrv] [-t vfstype] [-O options]
umount [-dflnrv] dir | device [...]
DESCRIPTION
The umount command detaches the file system(s) mentioned from the file hierarchy. A file system is specified by giving the directory where it has been mounted. Giving the special device on which the file system lives may also work, but is obsolete, mainly because it will fail in case this device was mounted on more than one directory.
Note that a file system cannot be unmounted when it is `busy' - for example, when there are open files on it, or when some process has its working directory there, or when a swap file on it is in use. The offending process could even be umount itself - it opens libc, and libc in its turn may open for example locale files. A lazy unmount avoids this problem.
Options for the umount command:
- -V
- Print version and exit.
- -h
- Print help message and exit.
- -v
- Verbose mode.
- -n
- Unmount without writing in /etc/mtab.
- -r
- In case unmounting fails, try to remount read-only.
- -d
- In case the unmounted device was a loop device, also free this loop device.
- -a
- All of the file systems described in /etc/mtab are unmounted. (With umount version 2.7 and later: the proc filesystem is not unmounted.)
- -t vfstype
- Indicate that the actions should only be taken on file systems of the specified type. More than one type may be specified in a comma separated list. The list of file system types can be prefixed with no to specify the file system types on which no action should be taken.
- -O options
- Indicate that the actions should only be taken on file systems with the specified options in /etc/fstab. More than one option type may be specified in a comma separated list. Each option can be prefixed with no to specify options for which no action should be taken.
- -f
- Force unmount (in case of an unreachable NFS system). (Requires kernel 2.1.116 or later.)
- -l
- Lazy unmount. Detach the filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it is not busy anymore. (Requires kernel 2.4.11 or later.)
THE LOOP DEVICE
The umount command will free the loop device (if any) associated with the mount, in case it finds the option `loop=...' in /etc/mtab, or when the -d option was given. Any pending loop devices can be freed using `losetup -d', see losetup(8).
FILES
/etc/mtab table of mounted file systems
SEE ALSO
umount(2), mount(8), losetup(8).