Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to understand file system mount

Shulou Source: shulou.com Published: 2022-06-01 04:09:55 10月03日 Update

How to understand the file system mount, I believe that many inexperienced people are helpless about this, this article summarizes the causes and solutions of the problem, through this article I hope you can solve this problem.

Name: Mount

Use permissions: System administrator or allowed users in/etc/fstab

How to use:

mount [-hV]

mount -a [-fFnrsvw] [-t vfstype]

mount [-fnrsvw] [-o options [,...]] device | dir

mount [-fnrsvw] [-t vfstype] [-o options] device dir

Description:

Interpret the contents of a file into a file system and hang it somewhere in the directory. When this command succeeds, all files under this command will not be available until we remove the file system using umnount.

This command can be used to mount any file system. You can even mount a regular file as a drive partition using the-o loop option. This feature is useful for interpreting ramdisk,romdisk or ISO 9660 image files.

parameters

-V

Show program version

-h

Display auxiliary messages

-v

Display more information, usually and-f used for debugging.

-a

Mount all file systems defined in/etc/fstab.

-F

This command is usually used with-a, which generates a trip for each mount action to execute. You can speed up the mounting action when the system needs to mount a large number of NFS file systems.

-f

Usually used for debugging purposes. It causes mount not to perform the actual action of mounting, but to simulate the entire process of mounting. It is usually used with-v.

-n

In general, mount writes data to/etc/mtab after mounting. This option can be used to cancel this action if no writable file system exists in the system.

-s-r

equals-o ro.

-w

equals-o rw

-L

Split and hang hard disks with specific labels.

-U

Hang the file system into which the file is divided. - L and-U are meaningful only if the file/proc/partition exists.

-t

Specifies the type of file system, usually without specifying it. Mount automatically selects the correct type.

-o async

Turn on asynchronous mode, all file read and write operations will be performed in asynchronous mode.

-o sync

Executed in synchronous mode.

-o atime

-o noatime

When atime is open, the system updates the last call time of the file each time the file is read. When we use flash file systems we may choose to turn this option off to reduce the number of writes.

-o auto

-o noauto

Turn on/off automatic hang mode.

-o defaults

Use the default options rw, suid, dev, exec, auto, nouser, and async.

-o dev

-o nodev-o exec

-o noexec

Allow execution files to be executed.

-o suid

-o nosuid

Allow executables to execute with root privileges.

-o user

-o nouser

Users can perform mount/mount actions.

-o remount

Re-suspend a file system that has been suspended in a different way. For example, a system that was read-only is now reattached in read-write mode.

-o ro

Hang in read-only mode.

-o rw

Hang in read-write mode.

-o loop=

Loop mode is used to attach a file to the system as a hard drive partition.

example

Hang/dev/hda1 under/mnt.

#mount /dev/hda1 /mnt

Hang/dev/hda1 under/mnt in read-only mode.

#mount -o ro /dev/hda1 /mnt

Hang the image file of/tmp/image.iso under/mnt/cdrom using loop mode. This method allows you to view Linux CD ISO files that are generally available on the network without burning them to CD.

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

After reading the above, do you know how to understand the file system mount? If you still want to learn more skills or want to know more related content, welcome to pay attention to the industry information channel, thank you for reading!

Tags: System file mode action content command read-only method hard disk synchronization file user CD type situation mode more permissions messages questions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux MariaDB OPPO Reno Redmi Apple