Linux shows that all directories are under a single directory tree, regardless of which drive or hardware they are located in.
Disk content under Linux appears as a subdirectory, and the contents of removable media do not automatically appear in these subdirectories, so we need to mount the drive to implement it.
For example: Mount CDROM mount command
Command:
Mount-t Auto/dev/cdrom/mnt/cdrom
The order is to mount the CDROM in the/mnt/cdrom directory, where I can access the contents.
Mount Command:
Homer@ubuntu: ~$ mount-t Auto/dev/cdrom/mnt/cdrom
Tip: mount:only root can do so//general user cannot mount CDRom, only the root user will be able to operate.
To switch users:
Root@ubuntu: ~# mount-t Auto/dev/cdrom/mnt/cdrom
Mount:mount Point/mnt/cdrom does not exist///mnt/cdrom directory does not exist and needs to be created first.
Root@ubuntu: ~# mkdir-p/mnt/cdrom//recursively create/mnt/cdrom subdirectory
Re-mount:
Root@ubuntu: ~# mount-t auto/dev/cdrom/mnt/cdrom//Mount CDROM
Mount:block Device/dev/cdrom is write-protected, mounting read-only//Mount succeeded
Root@ubuntu: ~# ls-l/mnt/cdrom//view CDROM contents
Uninstall command:
Root@ubuntu: ~# umount/mnt/cdrom//uninstall CDROM easy, direct use Umount/mnt/cdrom
Mount command Other parameter name: Mount
Permissions: Users allowed in system managers or/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 as a file system, and then hang it over a location in the directory. After this command has been successfully executed, all files under this command will not be invoked until we use Umnount to remove the file system.
This command can be used to hang up any file system, and you can even use the-o loop option to put a generic file on a hard drive partition system. This feature is useful for interpreting ramdisk,romdisk or ISO 9660 image files.
Parameters:
-V Display program version
-H Display Auxiliary messages
-V displays more messages, usually with-F for debugging.
-A hangs all the file systems defined in the/etc/fstab.
-F This command is usually used with-a, which produces a stroke for each mount action. You can speed up the action when the system needs to hang a large number of NFS file systems.
-F is usually used in a debugging purpose. It causes the mount to not perform the actual hanging action, but rather simulates the entire hanging process. is typically used with-V.
-n Generally, the mount will write a piece of data in the/etc/mtab after hanging. However, this option can be used to cancel this action if there is no writable file system in the system.
-s-r equals-o ro
-W equals-o RW
-L hangs the hard disk partition that contains a specific label.
-U hangs the archive system with the file split serial number. -L and-u must be meaningful when/proc/partition such a file exists.
-t specifies the profile of the file system, which is not normally required. Mount will automatically select the correct form.
-o async mode is turned on, and all file read and write actions are performed in asynchronous mode.
-O sync executes in synchronous mode.
-O Atime
-O noatime when Atime is open, the system updates the file's "Last Call time" every time the file is read. When we use the Flash archive system, we may be able to turn this option off to reduce the number of writes.
-O Auto
-O noauto turn on/off auto suspend mode.
-O defaults use preset options rw, suid, dev, exec, auto, Nouser, and async.
-O Dev
-O nodev-o exec
The-O noexec allows execution of the file to be executed.
-O suid
The-o nosuid allows the execution of files to execute under root permissions.
-O User
The-o nouser user can perform mount/umount actions.
-o remount a file system that has already been hung up in a different way. For example, a system that was previously read-only is now hung up in a read-write mode.
-O ro hangs with read-only mode.
-O RW hangs in read-write mode.
The-o loop= uses the loop mode to suspend a file as a hard disk partition on the system.
Example:
Hang the/dev/hda1 under the/mnt.
# mount/dev/hda1/mnt
To hang/dev/hda1 with read-only mode under/MNT
# Mount-o Ro/dev/hda1/mnt
Use loop mode to hang the image file of/tmp/image.iso this disc under/mnt/cdrom
In this way, you can view the contents of the Linux CD ISO file that can be found on a general network without being burned into a CD.
# Mount-o Loop/tmp/image.iso/mnt/cdrom