Use USB flash drives in Linux

Source: Internet
Author: User

With the popularity of computers, USB flash drives have become a hand-held copy. Do you know how to use USB flash drives in Linux? This article describes in detail how to use a USB flash drive in a Linux operating system, and plays a role in learning how to use a USB flash drive in a Linux operating system.

Solution 1:

Linux, unlike Windows, can be automatically identified after new hardware is connected. in Linux, new hardware cannot be automatically identified and must be manually identified. USB mobile storage devices are generally identified as sda1, which can be queried by the fdisk-l command.

Before using a USB flash drive, we need to create a new sub-directory for the external mount point. Generally, the subdirectories of the external mount point are created in/mnt, and we also created there, of course, you can also create a directory in the/directory and set the name by yourself. We will name it usb. The command under the terminal is as follows:
Mkdir/mnt/usb

Then we can connect to my USB flash drive, and then Enter the command at the terminal and press Enter:
Mount/dev/sda1/mnt/usb

In Windows, when the USB flash drive is used up, we need to delete it before removing the USB flash drive. in Linux, we also need to delete the mount point by using the following methods:
Umount/dev/sda1/mnt/usb or umount/dev/sda1

If you do not detach a USB flash drive to umount, data may be lost.

Solution 2:

The key to USB support lies in the driver. When there is no driver device, the mount execution is definitely not successful. The general method for using USB flash drives in Red Hat is as follows.

1. Do not insert a usb flash drive. Check whether usb-storage exists in/sbin/lsmod. If not:
Cd/lib/modules/2.4.20-8/kernel/drivers/usb
For v in *. o storage/*. o; do/sbin/insmod $ v; done

2. Here/sbin/lsmod should include usb core, usb-ohci or usb-uhci, which varies with the Motherboard chipset), usb-storage, and scsi_mod. The usb-storage status should be unused ).

3. Insert a usb flash drive without stopping/sbin/lsmod. During this period, the usb-storage status should be Initializing, which lasts for about half a minute. In fact, it is equivalent to a Windows auto ball without stopping in the lower right corner :)

4. After initialization,/sbin/fdisk-l should be able to see the/dev/sda1 device. Then, execute
Mount/dev/sda1/mnt/udisk. If you want to see Chinese characters again in MSDOS format, you can
Mount-t vfat/dev/sda1/mnt/udisk-o iocharset = gb2312.

(For convenience, add a line to/etc/fstab, And then mount/mnt/udisk ).

5. It is strange that sometimes fdisk cannot see sda1, but it can also be mounted.

After you use the above steps to mount a USB flash drive, it is basically. Desktops, laptops, and VMware are all the same.
Mkdir/mnt/usb
Mount/dev/sda1/mnt/usb

Linux installation on a laptop is the same as that on a desktop

Ps:
First, check lsmod | grep usb-storage. This is a module that supports USB. If not, you cannot operate the USB interface. If not, you can use modprobe usb-storage. Generally, you can use fdisk-l to view the device name of the hardware, which is much more accurate than the hardware name.

Through this article, you will learn how to use USB flash drives in Linux.

  1. Learning Manual: Linux hardware query commands
  2. Measure the test taker's understanding about how to adjust the hard drive size of a virtual machine in Linux.
  3. Detailed description of VM access by Linux Host
  4. Summary of Linux Mint system discussions
  5. Easy understanding of Linux VMware Internet access settings

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.