mount umount Linux 命令参考
otto
|
1#
otto 发表于 2008-07-27 23:22
mount umount Linux 命令参考
mount 安装文件系统redhat 9 语法:
mount [-lhV] mount -a [-fFnrsvw] [-t vfstype] [-O optlist] mount [-fnrsvw] [-o options [,...]] device | dir mount [-fnrsvw] [-t vfstype] [-o options] device dir 描述: 标准格式: mount -t type device dir 使用该命令一般要求使用root用户,如果设备有在/etc/fstab列出并有对应的用户设置,普通用户也可以使用。比如:/dev/cdrom /cd iso9660 ro,user,noauto,unhide。 一般只有mount的用户可以unmount,要使所有的用户可以unmount,使用在/etc/fstab 添加users。 如果您没有加上 -t 的参数,那么系统会预设尝试以 /etc/filesystems 内的档案系统格式来测试一下是否可以将装置挂载上来,如果仍然不行,则从内核中查找,/proc/filesystems。 mount 之后的 partition 就已经被设定在使用了,不可以使用 fsck 检查该,否则可能会造成 filesystem 的损毁,必须要将该 partition 给卸载才行! 帮助如下: # mount -h Usage: mount -V : print version mount -h : print this help mount : list mounted filesystems mount -l : idem, including volume labels So far the informational part. Next the mounting. The command is `mount [-t fstype] something somewhere'. Details found in /etc/fstab may be omitted. mount -a [-t|-O] ... : mount all stuff from /etc/fstab mount device : mount device at the known place mount directory : mount known device here mount -t type dev dir : ordinary mount command Note that one does not really mount a device, one mounts a filesystem (of the given type) found on the device. One can also mount an already visible directory tree elsewhere: mount --bind olddir newdir or move a subtree: mount --move olddir newdir A device can be given by name, say /dev/hda1 or /dev/cdrom, or by label, using -L label or by uuid, using -U uuid . Other options: [-nfFrsvw] [-o options]. For many more details, say man 8 mount . 常用参数: mount -V : 查看版本 mount -h : 查看帮助 mount : 查看安装的文件系统 mount -l : idem, including volume labels
-a
-n
-L
-t
-o
remount: 重新挂载,这在系统出错,或重新更新参数时,很有用! 实例: *挂载ext3类型
mount /dev/md0 这里省略了-t ext3,系统能自动识别这个类型 *查看结果:# mount -l /dev/hda1 on / type ext3 (rw) [/] none on /proc type proc (rw) usbdevfs on /proc/bus/usb type usbdevfs (rw) none on /dev/pts type devpts (rw,gid=5,mode=620) none on /dev/shm type tmpfs (rw) /dev/sda1 on /mnt/sda1 type ext3 (rw) [] /dev/hda3 on /opt type ext3 (rw) [] /dev/md0 on /home/meil/software type ext3 (rw) []
<!--[if !supportLists]-->* # mount -l -t ext3 /dev/hda1 on / type ext3 (rw) [/] /dev/sda1 on /mnt/sda1 type ext3 (rw) [] /dev/hda3 on /opt type ext3 (rw) [] /dev/md0 on /home/meil/software type ext3 (rw) []
<!--[if !supportLists]-->*
<!--[if !supportLists]-->*
<!--[if !supportLists]-->* # mount /dev/cdrom 只读方式:mount -t iso9660 -r /dev/cdrom /mnt
<!--[if !supportLists]-->*
<!--[if !supportLists]-->*
<!--[if !supportLists]-->* 相关命令:umount(2), mount(8), losetup(8). AIX 参考:http://www.kuqin.com/aixcmds/aixcmds3/mount.htm umount 卸载文件系统redhat 9 语法: umount [-hV] umount -a [-dflnrv] [-t vfstype] [-O options] umount [-dflnrv] dir | device [...] 帮助: # umount -h Usage: umount [-hV] umount -a [-f] [-r] [-n] [-v] [-t vfstypes] [-O opts] umount [-f] [-r] [-n] [-v] special | node... 重要参数: -a 删除fstab中所有的文件系统 -f 强制umount,主要针对不可达的NFS。 -l 懒惰模式,先删除文件系统层次。等文件系统不忙的时候清空所有连接。 实例 umount /dev/fd0umount /mnt umount的时候可以使用目录名,或者设备名,但是要注意一个设备用可能mount到了多个目录。 相关命令:umount(2), mount(8), losetup(8). |