cat /etc/fstab
# filesystem | mount point | type | mount option | dump | fsck
/dev/loop15 /snap/gnome-logs/37 squashfs ro,nodev,relatime 0 0
/dev/nvme0n1p1 /boot/efi vfat rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
/dev/nvme0n1p2 / ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
/etc/fstab
是启动时的挂在配置文件,实际的的挂载情况记录在/etc/mtab
proc/mounts
,二者均指向了/proc/self/mounts
isaac@hp:~$ ls -il /etc/mtab /proc/mounts
14549181 lrwxrwxrwx 1 root root 19 Aug 8 19:06 /etc/mtab -> ../proc/self/mounts
4026531843 lrwxrwxrwx 1 root root 11 Aug 26 11:52 /proc/mounts -> self/mounts
说明
file system
: 文件系统
mount point
: 挂载点
type
: 文件系统类型 ext4...
mount option
: mount -o option
挂载选项如sync
auto
realtime
remount
rw
suid
exex
等等
dump
: 是否备份 0
不备份,1
备份
fsck
: 挂载时候是否做fsck
,0
不做检查,1
最早检查,2
检查,优先级比较低
镜像挂载
已有的iso挂载
mount -o loop file.iso /mnt/mydir
创建文件并已光盘的方式挂载
dd if=/dev/zero of=~/bigfile bs=1M count=512
mke2fs -t ext4 ~/bigfile
mount -o loop ~/bigfile /dir/to/mount