Detailed explanation of the linux mount command
The mount command is used to mount the file system to the specified mount point. This command is also commonly used to mount cdrom so that we can access the data in the cdrom. Because when you insert the CD into the cdrom, Linux will not automatically mount it. You must use the Linux mount command to complete the mounting manually.
Recommended: "Linux Tutorial"
Different directories under the Linux system can mount different partitions and disk devices, and its directories and disk partitions are separated. , can be freely combined (through mounting)
Different directory data can span different disk partitions or different disk devices
The disk device has no entry by default, and the entry that cannot access the disk is mounting point.
The essence of mounting is to add an entry to the disk
mount common command parameters
The standard form of the mount command, is mount -t type device dir -l:显示已加载的文件系统列表; -h:显示帮助信息并退出; -v:冗长模式,输出指令执行的详细信息; -n:加载没有写入文件“/etc/mtab”中的文件系统; -r:将文件系统加载为只读模式; -a:加载文件“/etc/fstab”中描述的所有文件系统。
-t: 加载文件系统类型
supported include: adfs, affs, autofs, cifs, coda, coherent, cramfs, debugfs, devpts, efs, ext, ext2, ext3, ext4, hfs, hfsplus, hpfs, iso9660, jfs, minix, msdos, ncpfs, nfs, nfs4, ntfs, proc, qnx4, ramfs, reiserfs, romfs, squashfs, smbfs, sysv, tmpfs, ubifs, udf, ufs, umsdos, usbfs, vfat, xenix, xfs, xiafs.
Commonly used command display:
Mount Load the first partition of the first disk to the /etc directory
mount -t ext4 -o loop,default /dev/sda1 /etc /dev/sda1 -->挂载在第一块磁盘的第一分区 /dev/sdb2 -->挂载在第二块磁盘的第二分区 df -h 查看挂载磁盘
==>等价于查看 cat /proc/mounts
Unmount the mounted disk
umount -lf /dev/sda1
The above is the detailed content of Detailed explanation of linux mount command. For more information, please follow other related articles on the PHP Chinese website!