Detailed introduction to the use of the Linuxmount command

Source: Internet
Author: User
The Linuxmount command is often used to mount files outside the Linux system. This command is most commonly used to mount cdrom, so that we can access the data in the cdrom, because you insert the CD into the cdrom, Linux will not automatically mount ,...
The Linux mount command is often used to mount files outside the Linux system. This command is most commonly used to mount cdrom, so that we can access the data in the cdrom, because you insert the CD into the cdrom, Linux does not automatically mount, you must use the Linux mount command to manually mount. Www.2cto.com Linux shows that all directories are under one directory tree, regardless of which drive/hardware they are located. The disk content in Linux appears as a subdirectory. Use the Linux mount command to mount cdrom. command: mount-t auto/dev/cdrom/mnt/cdrom this command is to mount the cdrom to the/mnt/cdrom directory, where I can access the content. Learning operation process: [OK _008 @ CentOS4 ~] $ Mount-t auto/dev/cdrom/mnt/cdrommount: only root can do that -- generally, users cannot mount cdrom, and only root users can perform this operation. [OK _008 @ CentOS4 ~] $ -- Switch user operation: [root @ CentOS4/] # mount-t auto/dev/cdrom/mnt/cdrommount: mount point/mnt/cdrom does not exist --/mnt/cdrom directory does not exist and needs to be created first. [Root @ CentOS4/] # cd/mnt-bash: cd:/mnt: no such file or directory [root @ CentOS4/] # [root @ CentOS4/] # mkdir-p/mnt/cdrom -- Create/mnt/cdrom directory [root @ CentOS4/] # lsbin dev home lib media mnt proc sbin srv tmp varboot etc initrd lost + found misc opt root selinux sys usr [root @ CentOS4/] # mount-t auto/dev/cdrom/mnt/ cdrom -- Mount cdrommount: block device/dev/cdrom is write-protected, mounting read-only -- Mount [Root @ CentOS4/] # ls-l/mnt/cdrom -- view the content in cdrom total 859dr-xr-xr-x 4 root 2048 Sep 4 2005 CentOS-r -- 2 root 8859 Mar 19 2005 centosdocs-man.css-r -- r -- 9 root 18009 Mar 1 2005 GPLdr-xr-x 2 root 241664 May 7 headersdr-xr-x 4 root root 2048 May 7 imagesdr-xr-x 2 root 4096 May 7 isolinuxdr-xr-x 2 root 18432 May 2 NOTES-r -- R -- 2 root 5443 May 7 RELEASE-NOTES-en.htmldr-xr-xr-x 2 root 2048 May 7 repodata-r -- 9 root 1795 Mar 1 2005 RPM-GPG-KEY-r -- r -- 2 root 1795 Mar 1 2005 RPM-GPG-KEY-centos4-r -- r -- 1 root 571730 May 7 yumgroups. xml [root @ CentOS4/] # [root @ CentOS4/] # umount/mnt/cdrom -- unmount cdrom. it is easy to directly use umount/mnt/cdrom. Other parameters of another mount command on www.2cto.com can be described as follows: Name: mount permission: System Administrator or users allowed in/etc/fstab: mount [-hV] mount-a [-fFnrsvw] [-t vfstype] mount [-fnrsvw] [-o options [,...] device | dir mount [-fnrsvw] [-t vfstype] [-o options] device dir Description: This file is interpreted as a file system, then, it is mounted to a location in the directory. After this command is successfully executed, all files under this command cannot be called until we use umnount to remove the file system. This command can be used to mount any file system. you can even use the-o loop option to split a general file into a hard disk and then mount it to the system. This function is very useful for interpreting image files of ramdisk, romdisk, or ISO 9660. Parameter-V display program version-h display auxiliary message-v shows more information, usually used with-f for debugging. -A hangs all the file systems defined in/etc/fstab. -F is usually used with-a, which generates a route for each mount action. You can speed up mounting when the system needs to mount a large number of NFS file systems. -F is usually used for debugging. It will make the mount not execute the actual action, but simulate the entire process of mounting. It is usually used with-v. -N in general, after mount is mounted, a piece of information will be written into the/etc/mtab. However, you can use this option to cancel this operation if the file system does not exist. -S-r is equal to-o ro-w is equal to-o rw-L. -U mounts the file system with the division serial number. -L and-U must exist in the/proc/partition file to make sense. -T specifies the type of the file system, which is usually not required. Mount automatically selects the correct type. -O async enables non-synchronous mode, and all file read and write operations are performed in non-synchronous mode. -O sync is executed in synchronization mode. -O atime-o noatime when atime is enabled, the system updates the "last call time" of the file each time the file is read 』. When we use the flash file system, we may choose to disable this option to reduce the number of writes. -O auto-o noauto enable/disable the automatic mounting mode. -O defaults uses the default options rw, suid, dev, exec, auto, nouser, and async.-o dev-o nodev-o exec-o noexec to allow execution of the execution file. -O suid-o nosuid allows the execution file to be executed under the root permission. -O user-o nouser can perform the mount/umount action. -O remount re-hangs an existing file system in different ways. For example, a previously read-only system can be re-mounted in the read-write mode. -O ro is mounted in read-only mode. -O rw is mounted in read/write mode. -O loop = the loop mode is used to separate an archive as a hard disk and mount it to the system. The example hangs/dev/hda1 under/mnt. # Mount/dev/hda1/mnt mount/dev/hda1 in read-only mode under/mnt. # Mount-o ro/dev/hda1/mnt mount the image file of the/tmp/image. iso disc in loop mode under/mnt/cdrom. In this way, you can view the Linux optical disc ISO files that can be found on the network without burning them into CDs. # Mount-o loop/tmp/image. iso/mnt/cdrom another command related to the Linux mount command is the Linux umount command.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.