English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux mount command

Linux Command大全

The Linux mount command is a frequently used command, used to mount files outside the Linux system.

Syntax

mount [-hV]
mount -a [-fFnrsvw] [-t vfstype]
mount [-fnrsvw] [-o options [,...]] device | dir
mount [-fnrsvw] [-t vfstype] [-o options] device dir

Parameter description:

  • -V: Display program version
  • -h: Display auxiliary information
  • -v: Display more information, usually with -f for debugging.
  • -a: Use /etc/Mount all file systems defined in fstab.
  • -F: This command is usually used with -a Together, it will generate a process for each mount action. It can speed up the mount action when the system needs to mount a large number of NFS file systems.
  • -f: Usually used for debugging purposes. It makes mount not perform the actual mount action, but simulate the entire mount process. It is usually used with -v Together with.
  • -n: Generally, mount will write to the specified directory after mounting. /etc/Write a record to mtab. But in the case where there is no writable file system in the system, this option can be used to cancel this action.
  • -s-r: Equal to -o ro
  • -w: Equal to -o rw
  • -L: Mount the hard disk partition containing the specific label.
  • -U: Mount the file system with the sequence number specified.-L and -U Must be in/proc/partition This option is meaningful only when this type of file exists.
  • -t: Specify the type of the file system, usually not necessary. Mount will automatically select the correct type.
  • -o async: Enable asynchronous mode, all file read and write operations will be executed asynchronously.
  • -o sync: Execute in synchronous mode.
  • -o atime,-o noatime: When atime is enabled, the system updates the file's 'last access time' every time the file is read. When using a flash file system, it may be an option to disable this to reduce the number of writes.
  • -o auto、-o noauto:Open/Turn off the auto-mount mode.
  • -o defaults: Use the default options rw, suid, dev, exec, auto, nouser, and async.
  • -o dev、-o nodev-o exec、-o noexec allows executables to be executed.
  • -o suid、-o nosuid:
  • Executables are allowed to be executed under root privileges.
  • -o user、-o nouser:Users can execute mount/The action of umount.
  • -o remount:Re-mount a mounted file system in a different way. For example, if it was a read-only system before, it can be remounted in read-write mode now.
  • -o ro:Mounted in read-only mode.
  • -o rw:Mounted in read-write mode.
  • -o loop=:Use loop mode to mount a file as a hard disk partition.

Online Examples

The following /dev/hda1 Mounted /under mnt.

#mount /dev/hda1 /mnt

The following /dev/hda1 Mounted in read-only mode /under mnt.

#mount -o ro /dev/hda1 /mnt

The following /tmp/The image file of this disc uses loop mode to mount /mnt/This method can be used to view the contents of a Linux disc ISO file that can be found on the general network without burning it into a disc.

#mount -o loop /tmp/image.iso /mnt/cdrom

Linux Command大全