Linux系统下怎么挂载FAT32的U盘
创始人
2024-12-17 16:41:29
0次

linux挂载u盘步骤如下

1:将u盘插入usb接口,检查是否插好

2:用fdisk命令检查分区和usb设备信息

[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)

通过上面信息我们可以看出usb设备是fat32格式的,标识为/dev/sdb1

[root@wgods ~]# fdisk -l | grep fat32
/dev/sdb1 * 56 640 3580928 c w95 fat32 (lba)

3:在mnt目录下先建立一个usb的目录

[root@wgods ~]# cd /mnt/
[root@wgods mnt]# mkdir usb

4:挂载u盘
[root@wgods mnt]# mount -t vfat /dev/sdb1 /mnt/usb

挂载成功后,我们可以在/mount/usb下看到相关的内容。

5:卸载u盘

执行umount命令卸载u盘时,报如下错误“device is busy”,可以用参数l解决问题。当然你也可以用fuser命令解决问题。如下所示

[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

问题解决

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

[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.. 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: 删除usb目录
[root@wgods ~]# umount -l /mnt/usb
[root@wgods ~]# rm -rf /mnt/usb

注意:有时候挂载时,中文的文件名和目录名会出现乱码,为了避免这种情况可以指定字符集,命令如下

[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

注意:cp936是指简体中文,cp950是指繁体中文。

相关内容

热门资讯

空调连续工作多久需要停机休息 空调连续工作的时间取决于多个因素,包括空调的型号、功率、使用环境和维护情况等。一般来说,空调可以连续...
空调哪个符号是除湿的 空调除湿功能通常用一个水滴形状的符号表示。不同品牌和型号的空调遥控器可能会有所差异,但一般来说,除湿...
格力空调多长时间加一次氟利昂 1、一般情况下,空调对氟利昂的使用量是非常小的,所以在空调使用了四年左右的时候再考虑加也没问题。2、...
空调用多长时间需要加氟一次 一般情况下是五年。当出现以下这几种情况时,空调才需要加氟。1、空调的室内机和室外机各有两个接口,当接...
格调生活·C标思享荟:卡萨帝在... 9月12日的郑州龙湖金融岛,夜风轻拂,灯光璀璨。“C标时刻共传奇——卡萨帝思享荟暨20周年品牌盛典郑...
品牌价值破千亿、高端份额持续领... 9月12日,“C标时刻共传奇——卡萨帝思享荟暨20周年品牌盛典郑州站”在郑州龙湖金融岛举办。2026...
空调主板坏了修800还是换新的 空调主板坏了是修还是换新,需要考虑多个因素,以下是一些建议:1. 维修成本:如果维修费用较低,比如 ...
空调开多久需要休息多长时间 问题:空调开多久需要休息多长时间回答:1、在使用空调的过程中,一般空调开7~8个小时左右需要休息2~...
中央空调多长时间清洗一次 1、一般空调开机前清洗一次即可,空调开机中间时段再清洗一次,空调关机时清洗一次,这样比较合理。2、空...
中央空调氟利昂多久加一次 看空调制热和制冷程度,很多人的观点认为氟利昂必须一年放一次,其实这个观点是错误的,理解上面有点偏差,...