How to use a USB flash drive in linux? -- Linux general technology-Linux technology and application information. For details, refer to the following section. It took a whole day yesterday to get linux ready. Today, we are eager to copy the files on the USB flash drive. I heard from my colleagues that I could double-click a USB flash drive like in windows, so I did it. I tried to wait for half a day without responding. Finally, I was prompted with an error. It seems that the intelligence is wrong, no way. Continue with the discussion.
I checked through the Internet. A lot of them are simple by using two commands. However, it may take some time for beginners to enter these two commands correctly (I do not know if other beginners are not, in short, I didn't understand it at the time, and I tried it multiple times before I understood it. Maybe I am stupid ). The command is as follows:
Mount/dev/sda1/mnt/usb
If you really want to directly enter the above command, I am afraid it will never succeed. The purpose of the command is to mount the USB flash disk to the linux File System for file operations such as reading and writing the USB flash disk in linux. [/Dev/sda1] indicates the usb flash drive device, and [/mnt/usb] indicates the linux system directory where you want to mount the usb flash drive. This directory must be created in advance, I don't know if it is necessary to create it in the mnt directory, but the introduction on the Internet seems to be all. If you do not have this directory in your system, run the following command first:
Mkdir/mnt/usb
After this directory is created, run the preceding command.
In the first command above, note that the parameters of the USB flash drive device are not always [/dev/sda1]. Different systems are different. If you cannot enter the device identifier of the USB flash drive in your system correctly, the above command cannot be executed successfully. So how can we get the correct parameter indicating the USB flash drive? Very simple. Use the fdisk command.
The fdisk command in linux is different from the fdisk command in dos. I believe everyone knows the function in dos, in linux, The fdisk command is used to obtain and display all the disk information of the entire computer. Enter the following command on the terminal:
Fdisk-l
You will immediately obtain your disk information, which is generally expressed in the form of hdx (the value of x may be 0, 1, 2, 3 ,......), USB flash drives are generally expressed in the form of sdxx (the first x value may be a, B ......, The value of the second x may be 1, 2 ......) [I did multiple experiments and only got the values a, B, and 1.] other values may be my own, maybe not, please confirm the specific situation based on the results of fdisk. Remember not to stick to it!
The following are my specific steps.
(1) Insert a USB flash drive.
(2) enter the command
Fdisk-l
View the hard drive system. My USB flash drive descriptor is sda1.
(3) enter the following command:
Mkdir/mnt/usb
Mount/dev/sda1/mnt/usb
OK! Open the/mnt/usb directory of your system and you will be able to see everything in your usb disk.
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