USB flash disk identification in linux

Source: Internet
Author: User
USB flash disk identification in linux-general Linux technology-Linux technology and application information. For details, refer to the following section. Platform: redhat9, FC5, and S3c2410Embedded Linux
Hardware: KingSton 2.0 1g usb Disk (not changed by default)

Problem description:
1. Insert a USB flash drive under RH9 and run the fdisk-l command to view the partition information ~ Each sda4 has a USB flash disk and the size is different. Only the last partition sda4 can be mounted. After mounting, check that the disk space is 1 GB. Can read and write normally. When RH9 has been attached to sdb with a USB flash drive. In the past, the USB flash drive with the 1.1 interface was loaded to sda1.

2. In FC5, because the kernel uses more than 2.6 of the USB flash drive's automatic identification function (you can also add this function on your own under RH9, so you are always too lazy to add it to make RH9 more like WINDOWS ), the USB flash drives with a capacity of 1.1 or 2.0 can be automatically recognized, automatically loaded, and read/write is normal.

3. The interaction between USB flash drives in Embedded Linux is very troublesome, because different USB flash drives have different mount points and the program is not well controlled. In the original root file system, only the sda1 connection was performed, and the application was also written to the sda1 mount point. When the above 2.0U disk was inserted, there was a problem that it could not be mounted.

Solution:
A. Change the root file system to create sda1 ~ The mount point of sda4, which changes the application from the back to the front. This is only a matter of expediency that can solve the problem temporarily.

B. During the test, some files can be normally read under Embedded, while other files can only be stored and cannot be read. The reason is not found in depth, it is estimated that only the last partition is loaded for different partitions, which makes it very difficult for windows and linux to operate the USB flash disk in hybrid mode, you do not know whether the file you want to read is stored in a readable partition. I encountered a partition in the upgrade package file that cannot be read, and the upgrade failed several times. Check the program repeatedly to find that there are no errors before you think of the above errors.

C. Insert a USB flash disk in linux without loading it. If the system automatically loads it, run the umount command to uninstall the USB flash disk.

D. Run the fdisk-l command to view the mount point of the USB flash disk, for example, sda1 ~ Sda4

E, fdisk/dev/sda command to format and repartition the sda partition, d command to delete the partition, delete 1 ~ 4 partitions; w write to a new partition table; n command to create a partition; p command to create a primary partition, create a partition by default;

F. Use fdisk-l to view the disk. You can see that the disk has been created with a partition of sda1.

G, mkfs. vfat/dev/sda1 pairs of U disks to establish a vfat file system, of course, other file systems can be established, but vfat is very convenient to use as a U disk system, either in windows or linux;

H. After that, the USB flash drive inserted into the linux system (RH9 or Embedded linux) will be mounted to/dev/sda1 by default.
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.