Mount USB flash drives, hard disks, optical drives, and automatic Mount Management in Linux

Source: Internet
Author: User
1. Linux Mount USB flash drive:
Insert a USB flash disk to a computer. If only one USB flash disk is inserted and your hard disk is not a SCSI hard disk interface, the hardware name is sda1. Create a USB directory under the MNT directory:
(For example, [root @ localhost root] # mkdir/mnt/USB)

Mount a USB flash drive: Mount-T vfat/dev/sda1/mnt/USB
Unmount the USB flash disk: umount/mnt/USB
Delete the USB Directory: Rm-RF/mnt/USB

2. Linux hard disk mounting:

The simplest use of mounting a FAT32 File System
Mount/dev/hda6/mnt/wine

/Dev/hda6 is an e disk of windows, And/mnt/wine is a directory mount point. Linux recognizes the type of the file system in the/dev/hda6 partition, and then adds it. Of course, you can also specify the file system type of the partition. The command is as follows:
Mount-T vfat/dev/hda6/mnt/wine
In practice, a Windows partition is directly attached, and the Chinese file name and directory name are garbled. To avoid this problem, you can specify a character set by running the following command:
Mount/dev/hda6/mnt/d-o codePage = 936, iocharset = cp936
Mount-T vfat/dev/hda6/mnt/d-o codePage = 936, iocharset = cp936
Mount-T vfat-O iocharset = cp936, codePage = 936/dev/hda6/mnt/wine

Note: cp936 refers to simplified Chinese and cp950 refers to traditional Chinese.

Unmount the mounted hard disk umount/mnt/wine
Delete the mounted hard disk Rm-RF/mnt/wine

Mount the NTFS file system
In most Linux versions, you need to re-compile the Linux core to mount the NTFS partition.Article). After the core supports NTFS, run the following command:
Mount-t ntfs/dev/hda2/mnt/C

You can also specify the character set for garbled characters in Chinese file names and directory names. However, unlike the vfat partition, the following command is practical:
Mount-t ntfs-O iocharset = cp936/dev/hda2/mnt/c-r
Mount-t ntfs-O iocharset = cp936, RW/dev/hda2/mnt/C

Note: cp936 refers to simplified Chinese and cp950 refers to traditional Chinese.
The same is true for uninstallation and deletion.

3. Linux automatic hard disk mounting

Open/etc and find the fstab file to edit it. If you log in as an administrator, right-click it and choose open mode> gedit. You can directly append a line to it:
/Dev/hda6/mnt/wine vfat codePage = 936, iocharset = cp936, defaults, umask = 0 0 0
/Dev/hda5/mnt/wind vfat codePage = 936, iocharset = cp936 0 0
<Umask = 0 indicates that normal users can also read and write data>

4. Linux mounting optical drive:
Command: Mount-T iso9660/dev/HDC/mnt/CDROM
The same is true for uninstallation and deletion.

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.