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

How to mount the FAT32 USB disk under the Linux system

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

In this article, the editor introduces in detail "how to mount the FAT32 U disk under the Linux system". The content is detailed, the steps are clear, and the details are handled properly. I hope that this article "how to mount the FAT32 U disk under the Linux system" can help you solve your doubts.

The steps for linux to mount a U disk are as follows

1: insert the USB disk into the usb port and check if it is plugged in.

2: use the fdisk command to check partition and usb device information

[root@wgods ~] # fdisk-l

Disk / dev/sda: 1000.2 gb, 1000204886016 bytes

255 heads, 63 sectors/track, 121601 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device boot start end blocks id system

/ dev/sda1 * 1 13 104391 83 linux

/ dev/sda2 14 121601 976655610 8e linux lvm

Disk / dev/sdb: 4012 mb, 4012900352 bytes

223 heads, 55 sectors/track, 639 cylinders

Units = cylinders of 12265 * 512 = 6279680 bytes

Device boot start end blocks id system

/ dev/sdb1 * 56 640 3580928 c w95 fat32 (lba)

Partition 1 has different physical/logical beginnings (non-linux):

Phys= (42,17,40) logical= (55,23,1)

Partition 1 has different physical/logical endings:

Phys= (487,222,55) logical= (639,6,31)

From the above information, we can see that the usb device is in fat32 format and is identified as / dev/sdb1

[root@wgods ~] # fdisk-l | grep fat32

/ dev/sdb1 * 56 640 3580928 c w95 fat32 (lba)

3: create a usb directory under the mnt directory

[root@wgods ~] # cd / mnt/

[root@wgods mnt] # mkdir usb

4: Mount the 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 the u disk

When executing the umount command to uninstall the u disk, the error "device is busy" is reported as follows, and the parameter l can be used to solve the problem. Of course, you can also solve the problem with the fuser command. 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 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.. Man

Root 21180.. c.. Sh

Root 21182.. c.. Less

Root 21223.. c.. Bash

[etl@wgods ~] $umount / mnt/usb

Umount: / mnt/usb is not in the fstab (and you are not root)

[etl@wgods ~] $su-root

Password:

[root@wgods ~] # umount / mnt/usb

6: delete the usb directory

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

[root@wgods ~] # rm-rf / mnt/usb

Note: sometimes when mounting, the Chinese file name and directory name will appear garbled, to avoid this situation, you can specify the character set, the command is as follows

[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 and cp950 refers to traditional Chinese.

After reading this, the article "how to mount a FAT32 USB disk under the Linux system" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it yourself. If you want to know more about related articles, welcome to follow the industry information channel.

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

Development

Wechat

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

12
Report