Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mounting the USB disk under the virtual machine linux

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

First of all, you need to know why the flash drive is mounted. What is the mount?

In the windows operating system, mounting usually refers to assigning a drive letter to a disk partition (including a virtual disk partition). In the linux operating system, mounting refers to attaching a device (usually a storage device) to an existing directory. To access a file in a storage device, we must mount the partition where the file resides to an existing directory, and then access the storage device by accessing that directory.

To put it simply, when the flash drive is plugged into the computer, the virtual machine recognizes that there is a device connected, and a drive letter is assigned to the device. To access the files in this device, we must mount the partition where the files are located to an existing directory, so that we can access the storage device by accessing this directory.

How do you do it exactly?

1 ensure that the virtual machine can automatically recognize the flash drive

When the flash drive is plugged into the computer, the USB device icon in the lower right corner of the virtual machine lights up. The following figure shows the part in the red circle:

At this point, enter the command: fdisk-l to view the device name

The device names are all listed below from sda / sdb\ sdc. Basically, our flash drive is displayed at the end, and it can also be judged according to its size. As shown in the figure above, I am identified as sdc1 here. (to be clear here, the format of USB disk is FAT32. If it is NTFS, it doesn't seem to work. It seems that you have to download something.)

So far, it is possible to ensure that the flash drive has been identified. If not, check the following points:

1. Whether the virtual machine USB service has been enabled. Under windows (local), right-click my computer-> manage-> Services and applications-> Services-> check if VMware USB Arbitration Service is turned on.

2. After opening the virtual machine, but before starting the system, check the properties of the USB controller. "Virtual Machine"-> "Settings"-> "USB Controller", all three options are checked (I am grayed out here because the linux system has been started), and restart the virtual machine after confirming.

3. Change the USB interface and see the USB2.0 above. Maybe you are plugging in the 3.0interface. Just change the computer interface and plug it in.

2 start mounting

Before mounting, be sure to make sure that the mount point exists. We create the directory usb under / mnt, and then operate in the parent directory of the mount directory.

Command: mount / dev/sdc1 / mnt/usb

You can see that the mount is successful!

3 unmount the file system

Don't forget to uninstall the flash drive before unplugging it. Command: umount

Here, umount / dev/sdc1 or umount / mnt/usb is fine. (note: you cannot do this in the mount point directory, because the device is in busy state and cannot be uninstalled.)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report