Operation flow of USB disk in Linux virtual machine

Source: Internet
Author: User
Tags character set locale

First, preparatory work

1, the operating environment: the virtual machine version is VMware Workstation 5.5.1, the virtual system is Redhat 9.0, the kernel version is 2.4.20-8. If you are not clear, you can use the following command to check: # Rpm-qa|grep kernel:

2, in order to make the U disk in the Chinese file can be normal display. The first thing to verify is the locale of the Linux system used (this locale includes information such as the language and character encoding used by the system). The commonly used locale in Chinese Linux are zh_cn.gb2312,zh_cn.gbk,zh_cn.gb18030 and ZH_CN. UTF-8. You can query the locale of the system by using the following command: #echo $LANG

  Second, the next, you can use the #fdisk-l command to query whether the virtual machine to identify U disk, as follows:

Here, you can see that the virtual machine system does not recognize the U disk. There are two ways of dealing with it, as follows:

1 eject the USB drive in the main system (my Windows XP) Click on the virtual system interface, the active cursor placed in the virtual system, then insert U disk again, you can see the main system pop-up virtual machine in the lower right corner of the message prompts, otherwise, again, until the virtual machine to identify U disk. This method is more stupid, we can take the second method, as follows:

2 The VM menu option in the virtual machine interface can be set up as follows:

At this point, you can see the XP system in the lower right corner pop-up security exit USB device message prompts, that U disk has been the virtual system recognition.

  Third, again through the #fdisk-l command to confirm whether the virtual system to identify the U disk, as follows:

1: The virtual system finally realized that the 2G u disk exists, and named for SDB1.

2: In the/MNT directory to establish a mount USB memory directory, with the following command to create:

#mkdir/mnt/usb

Of course, you can also take other names, such as Udisk and so on, here I set it as USB. Confirm it again:

3: All preparations have been done, you can put the USB device (/DEV/SDB1) into the/mnt/usb directory, with the following command on it:

Mount command format: Mount [-parameters] [device name] [mount Point] [other parameters]

Mount-t vfat/dev/sdb1//mnt/usb-o iocharset=gb2312

-t specifies the file system type of the device, where the-t VFAT is used because the file system type of the USB disk is FAT32, and if it is NTFS, use-t NTFS, and so on, you can modify it according to your own file system type.

-o Specifies the option to mount the file system, where-o iocharset=gb2312 sets the Chinese character set. Let's say your locale is ZH_CN. UTF-8, the corresponding command should be-o Iocharset=utf8, otherwise (here, the Linux system used locale is zh_cn.gb18030, the query method refer to the previous introduction), use GB2312.

#mount-T Vfat/dev/sdb1/mnt/usb-o iocharset=gb2312

Mount successfully, you can use the file in the U disk.

4: Run the following command to view the file information in the USB memory.

Ls-l/mnt/udisk

Linux Uninstall the U disk command as follows:

Uninstall U disk must be in a different directory to uninstall, that is, not in the/mnt/udisk directory to uninstall. Uninstall commands are as follows

#cd/root

#umount/mnt/udisk

Uninstall succeeded. We can see that the/MNT/USB directory is already empty.

If the device is busy appears, you can uninstall it with the following command:

#cd/root

# Fuser-km/mnt/udisk

#umount/mnt/udisk

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.