Summary of mounting media in linux

Source: Internet
Author: User
Summary of mounting media in linux-general Linux technology-Linux technology and application information. The following is a detailed description. Mounting media in linux is simple and simple. Sometimes it can take you some time to mount the media. Now I will summarize the problems I encountered when mounting the media and the information I have seen on the Internet, I hope it will be useful to you.
First, let's take a look at the mount command for mounting the media.
Mount [-t vfstype] [-o options] device dir
Parameter description:

1.-t vfstype specifies the type of the file system to which the media will be mounted, or you do not need to specify it. If it is not specified, linux will automatically select the correct type for mounting. Common types include:
Msdos DOS or fat16 File System (old-fashioned, few people now have it)
Vfat windows fat32 File System
Ntfs windows NT ntfs file system
Smbfs windows File network sharing (I have never used it now)
Ext2, ext3 File System for Linux
Iso9600 CD or CD image
Nothing else is even more common, skipped.

2.-o options is used to describe the mounting method of the device file. Common parameters include:
Loop is used to mount a file as a hard disk partition.
Ro read-only mounting
Rw read/write mounting
Iocharset specifies the character set used to access the file system
3. device to be mounted
4. mount point of the dir device on the system.

Other parameters of mount are not very common. We will not introduce them here.
Next, let's take a look at the specific commands for mounting various media:
1. mount a USB flash drive
Mkdir/mnt/usb mount point (this step can be omitted if the system comes with it, the same below)
Mount-t vfat/dev/sda1/mnt/usb
Currently, most USB flash drives are in vfat format, so the fat format command will not be used.
2. Attach a cd
Create a mount point for mkdir/mnt/cdrom
Insert the disc and mount/mnt/cdrom (the shortest method is o (Bytes _ bytes) o ...)
3. mount windows partitions (for example, to mount hda5)
If the format is fat32
Mkdir/mnt/hda5
Mount-t vfat/dev/hda5/mnt/hda5
Ntfs format
Mkdir/mnt/hda5
Mount-t ntfs/dev/hda5/mnt/hda5
4. Mount the mobile hard disk (assume that the mobile hard disk is in NTFS format and the device number is hdb1, hdb2, hdb3, hdb4)
Mkdir/mnt/hdb1
Mount-t ntfs/dev/hdb1/mnt/hdb1
This method can be used to mount each partition of a mobile hard disk in sequence.
5. Attach a CD image
Mkdir/mnt/iso
Mount-o loop-t iso9660/hda5/redhat. iso/mnt/iso (here I am attaching redhat. iso from hda5 in windows)
For the moment, I did not think about writing so many.
6. Uninstall the command
Use the command umount
The umount command can be followed by the device name or mount point, both of which can achieve the effect of detaching. However, we recommend that you use a mount point to unmount the device. If you have time to detach the device, the device cannot be detached, but the device can be detached using a mount point.
For example, umount/dev/sda1 umount/mnt/usb works the same way.

Next, let's talk about the issues that should be paid attention to during the Mount time:
1. Make sure that you are not in the mount point at the time of mounting and detaching; otherwise, the system will prompt you that the device is busy: device busy.
2. when you attach a usb flash disk frequently, sometimes using the mount-t/dev/sda1/mnt/usb command will be difficult, and you will be prompted that you do not have the device, at this time, we recommend that you first use fdisk-l to check the current system partition, then you will find sdb, sdc or sdd, which is caused by frequent mounting of USB flash drives. (The fdisk command must be well remembered. It is very important)
3. When you mount the file, the Chinese characters are garbled: The charsets = gb2312 and codepage = 936 parameters are used to display simplified Chinese characters. (This problem does not exist in my system. It has never been used, but it has been embedded several times .)
4. when you mount the ntfs system, you may be prompted that you do not have this device or directory. In this case, you should check whether your system supports the ntfs format. If not, you should go to the installation CD or find the ntfs-supported compressed package on the Internet. The installation and restart should be good. I remember when I installed redhat Enterprise Edition, this problem occurs because it was a custom installation.
Well, that's all.

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.