How to mount the FAT32 USB disk _linux under Linux system

Source: Internet
Author: User

Linux mount U disk steps are as follows

1: The USB disk plug into the interface, check whether inserted good

2: Check partition and USB device information with fdisk command

[Root@wgods ~]# Fdisk-l

disk/dev/sda:1000.2 GB, 1000204886016 bytes
255 heads, Sectors/track, 121601 cylinders
Units = Cylinders of 16065 * 8225280 bytes

Device Boot Start End Blocks Id System
/DEV/SDA1 * 1 104391 Linux
/dev/sda2 121601 976655610 8e Linux LVM

disk/dev/sdb:4012 MB, 4012900352 bytes
223 heads, Sectors/track, 639 cylinders
Units = Cylinders of 12265 * 6279680 bytes

Device Boot Start End Blocks Id System
/DEV/SDB1 * 640 3580928 C W95 FAT32 (LBA)
Partition 1 has different physical/logical beginnings (Non-linux?):
Phys= (55, 23, 1) logical=
Partition 1 has different physical/logical endings:
phys= (487, 222, logical=) (639, 6, 31)

We can see from the above information that the USB device is FAT32 format, identified as/DEV/SDB1

[Root@wgods ~]# fdisk-l | grep FAT32
/DEV/SDB1 * 640 3580928 C W95 FAT32 (LBA)

3: In the MNT directory to build a USB directory first

[Root@wgods ~]# cd/mnt/
[Root@wgods mnt]# mkdir USB

4: Mount U disk
[Root@wgods mnt]# mount-t Vfat/dev/sdb1/mnt/usb

After the mount is successful, we can see the relevant content under/MOUNT/USB.

5: Uninstall U disk

Execute umount Command Uninstall u disk, the following error "Device is busy", you can use parameter l to solve the problem. Of course, you can also use the fuser command to solve the problem. As shown below


[Root@wgods ~]# Umount/mnt/usb
Umount:/mnt/usb:device is busy
Umount:/mnt/usb:device is busy

[Root@wgods ~]# umount-f/mnt/usb
Umount2:device or resource busy
Umount:/mnt/usb:device is busy
Umount2:device or resource busy
Umount:/mnt/usb:device is busy


[Root@wgods ~]# umount-l/mnt/usb

Problem solving

---------------------------------------------------------------------------------

[Root@wgods usb]# Umount/mnt/usb
Umount:/mnt/usb:device is busy
Umount:/mnt/usb:device is busy
[Root@wgods usb]# fuser-m/mnt/usb
/mnt/usb:21123c 21158c 21180c 21182c 21223c
[Root@wgods usb]# Ps-auxw | grep 21123
Warning:bad syntax, perhaps a bogus '-'? See/usr/share/doc/procps-3.2.7/faq
Root 21123 0.0 0.0 3784 672 PTS/2 T 15:10 0:00 more 12.sql
Root 21346 0.0 0.0 3920 696 pts/2 s+ 15:52 0:00 grep 21123

[Root@wgods usb]# Fuser-kvm/mnt/usb

USER PID ACCESS COMMAND
/mnt/usb:root 21123 F.C. More
Root 21158. C.. Mans
Root 21180. C.. sh
Root 21182. C.. less
Root 21223. C.. bash

[Etl@wgods ~]$ Umount/mnt/usb
Umount:/mnt/usb is isn't in the fstab (and, are not root)
[Etl@wgods ~]$ Su-root
Password:
[Root@wgods ~]# Umount/mnt/usb


6: Remove the USB directory
[Root@wgods ~]# umount-l/mnt/usb
[Root@wgods ~]# Rm-rf/mnt/usb

Note: Sometimes when mounted, the Chinese file name and directory name will appear garbled, in order to avoid this situation can specify the character set, the following command

[Root@wgods ~]# mount-t vfat-o Iocharset=utf8,codepage=uft8/dev/sdb1/mnt/usb

[Root@wgods ~]# mount-t vfat-o Iocharset=cp936,codepage=936/dev/sdb1/mnt/usb

Note: cp936 refers to Simplified Chinese, cp950 refers to traditional Chinese.

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.