mount命令
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mount命令相关的知识,希望对你有一定的参考价值。
磁盘进行挂载一定是一个目录,这个目录就是进入该磁盘分区的一个入口。挂载命令mount,首先man mount查看技术文档。
mount - mount a filesystem 挂载文件系统
The standard form of the mount command, is mount -t type -o options device dir(标准语法)
-t type表示:指定要挂载的文件系统类型,ext2/ext3/ext4/vfat/iso9660...
-o options表示:额外的参数,如ro/rw,async/sync,auto/noauto...
device表示:是一个文件的名称或一个特殊的块设备,比如/dev/sda1,也可能是一个特殊的NFS设备名称可能是knuth.cwi.nl:/dir,这样就需要使用它的LABEL或UUID进行自动0挂载。
dir表示:挂载的目录
mount 的选项
[[email protected] ~]# mount -V 查看版本信息
mount from util-linux-ng 2.17.2 (with libblkid and selinux support)
[[email protected] ~]# 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
One can change the type of mount containing the directory dir:
mount --make-shared dir
mount --make-slave dir
mount --make-private dir
mount --make-unbindable dir
One can change the type of all the mounts in a mount subtree
containing the directory dir:
mount --make-rshared dir
mount --make-rslave dir
mount --make-rprivate dir
mount --make-runbindable dir
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] [-p passwdfd].
For many more details, say man 8 mount .
[[email protected] ~]# mount -v 冗长格式,查看所有挂载的详细信息
/dev/sda5 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda1 on /boot type ext4 (rw)
/dev/sda2 on /usr type ext4 (rw)
/dev/sdc4 on /home type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
L LABEL=指定label进行挂载
U UUID 指定UUID进行挂载
常用命令:
[[email protected] ~]# mount -a 依据/etc/fstab文件信息进行挂载所有
以上是关于mount命令的主要内容,如果未能解决你的问题,请参考以下文章