Use the mount command to mount CentOS.

Source: Internet
Author: User
CentOS rom mounting is still quite common, so I studied CentOS rom mounting. here I will share it with you.

CentOS CDROM mounting is still quite common, so I have studied CentOS CDROM mounting. here I will share it with you. I hope CentOS CDROM mounting will be useful to you. Use the mount command CentOS CDROM to access data mounted to CentOS CDROM.

Linux displays 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. The content of removable media does not automatically appear in these self-directories. we must mount the drive.

Mount CentOS CDROM with the mount command.

Command: mount-t auto/dev/cdrom/mnt/cdrom

This command is to mount CentOS 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. only the root user 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, you must first create a file.

[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 CentOS CDROM mount: block device/dev/cdrom is write-protected, mounting read-only -- mounting successful.

[Root @ CentOS4/] # ls-l/mnt/cdrom -- view the content in the CentOS CDROM mounting: total 859
Dr-xr-x 4 root 2048 Sep 4 2005 CentOS
-R -- 2 root 8859 Mar 19 2005 centosdocs-man.css
-R -- 9 root 18009 Mar 1 2005 GPL
Dr-xr-x 2 root 241664 May 7 headers
Dr-xr-x 4 root 2048 May 7 images
Dr-xr-x 2 root 4096 May 7 isolinux
Dr-xr-x 2 root 18432 May 2 NOTES
-R -- 2 root 5443 May 7 0:49 RELEASE-NOTES-en.html
Dr-xr-x 2 root 2048 May 7 repodata
-R -- 9 root 1795 Mar 1 2005 RPM-GPG-KEY
-R -- 2 root 1795 Mar 1 2005 RPM-GPG-KEY-centos4
-R -- 1 root 571730 May 7 yumgroups. xml
[Root @ CentOS4/] #

[Root @ CentOS4/] # umount/mnt/cdrom

-- Unmount the CentOS CDROM mount. it is easy to directly use umount/mnt/cdrom.

Other parameters of the mount command can be described as follows:

Name: mount

Permission: System Administrator or user allowed in/etc/fstab

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

Note: interpret the content of an archive into an archive system, and then place it on 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.

Parameters
-V: Display the program version
-H: displays the secondary message
-V displays more information, which is 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: use the default options rw, suid, dev, exec, auto, nouser, and async.
-O dev-o nodev-o exec-o noexec allows the execution file to be executed.
-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.

Example:
Mount/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 related command umount.

For usage of mount, see: http://blog.haohtml.com/archives/9583

Related Article

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.