Disk mounting and hard drive in Linux

Source: Internet
Author: User
One Linux Mount USB Flash Drive: 1. Insert a USB flash drive to a computer. if only one USB flash drive is inserted and your hard disk is not a scsi hard disk interface, the hardware name is sda1. 2. in the mnt Directory

I. Mount a USB flash drive in Linux:

1. 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.

2. create a usb directory under the mnt Directory (for example, [root @ localhost root] # mkdir/mnt/usb)

3. mount a usb flash drive: mount-t vfat/dev/sda1/mnt/usb

4. unmount the usb flash disk: umount/mnt/usb

5. delete the usb Directory: rm-rf/mnt/usb

II. Linux hard disk mounting:

1. mount the FAT32 file system, the simplest use

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 (frequently used by the author)

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

2. mount the NTFS file system

In most Linux versions, you need to re-compile the Linux core to mount the NTFS partition (see other articles for the compilation method ). 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!

III. automatic hard disk mounting in Linux

Open/etc and find the fstab file to edit it. if you log in as an administrator, right-click and choose open mode> gedit. you can directly append the following lines:

/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

4. Linux mounting optical drive:

Command: mount-t iso9660/dev/hdc/mnt/cdrom

The same is true for uninstallation and deletion!

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.