1. Meaning of parameters of the mount command
Parameters of the mount command
2. Description of the Flag parameter in the Mount System Call
# Define ms_rdonly 1/* Mount read-only */
# Define ms_nosuid 2/* ignore SUID and SGID bits */
# Define ms_nodev 4/* prohibit access to device files on the installed file system */
# Define ms_noexec 8/* programs cannot run on an installed file system */
# Define ms_synchronous 16/* writes are synced at once */
# Define ms_remount 32/* alter flags of a mounted FS */
/* Allow forcible shackles */
# Define ms_mandlock 64/* force lock not allowed */
# Define ms_dirsync 128/* The write operation on the directory is real-time */
# Define ms_noatime 1024/* Do not update the file access time .*/
# Define ms_nodiratime 2048/* Do not update directory access times */
/* Create a "bind mounting" so that a file or directory can be seen on another node in the system directory tree */
# Define ms_bind 4096
/* Moving a mounted file system to another mount point is equivalent to detaching the system first, and then attaching the file system to another directory */
# Define MS _ move 8192
# Define ms_rec 16384/* recursively creates and mounts the directory subtree */
# Define MS _ silent 32768
# Define ms_posixacl (1 <16)/* VFS does not apply the umask */
# Define ms_unbindable (1 <17)/* change to unbindable */
# Define ms_private (1 <18)/* change to private */
# Define ms_slave (1 <19)/* change to slave */
# Define ms_shared (1 <20)/* change to shared */
# Define ms_relatime (1 <21)/* update atime relative to mtime/ctime .*/
# Define ms_kernmount (1 <22)/* This is a kern_mount call */
# Define ms_ I _version (1 <23)/* update inode I _version field */
# Define ms_strictatime (1 <24)/* always perform atime updates */
# Define ms_active (1 <30)
# Define ms_nouser (1 <31)
Ms_bind makes a file or directory visible at another point in the system directory tree. operations on the original directory are actually applied to the bound directory without changing the original directory. For example,
Mount -- bind/VZ/apt // var/Cache/APT/archives/
The above command means to bind/VZ/APT/directory to/var/Cache/APT/archives /, any data written to the/var/Cache/APT/archives/directory will be automatically written to the bound directory/VZ/APT,
Real/var/Cache/APT/archives/does not contain data.
Loopback mount: the loopback file system depends on a file stored in another file system and acts as a peripheral device. This virtual device can be formatted or mounted to the directory tree like a real device. The device files in the file system are usually/dev/loop0 or/dev/loop1. These devices are then directed to the dependent files, this file can be mounted as a virtual device. For example, Mount initrd. IMG/root/initrd-T ext2-o loop recursively mounts the ring. recursively mounts the ring to mount the original directory tree, and completely moves it to the new directory.
[File System] File System Study Notes (5) --- Mount System Call (1)