!
也想出现在这里? 联系我们
广告位
当前位置:首页>教程分享>服务器教程>独立服务器FAT32格式的U盘在Linux系统下如何挂载

独立服务器FAT32格式的U盘在Linux系统下如何挂载

Linux挂载U盘步骤如下

1:将U盘插入USB接口,检查是否插好

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

[root@wgods ~]# fdisk -l Disk /dev/sda: 1000.2 GB, 1000204886016 bytes255 heads, 63 sectors/track, 121601 cylindersUnits = 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 bytes223 heads, 55 sectors/track, 639 cylindersUnits = 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

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”,

[root@wgods ~]# umount /mnt/usbumount: /mnt/usb: device is busyumount: /mnt/usb: device is busy [root@wgods ~]# umount -f /mnt/usbumount2: Device or resource busyumount: /mnt/usb: device is busyumount2: Device or resource busyumount: /mnt/usb: device is busy

可以用参数l(小写L)解决问题。

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

问题解决

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

当然你也可以用fuser命令解决问题。如下所示

[root@wgods usb]# umount /mnt/usbumount: /mnt/usb: device is busyumount: /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 21123Warning: bad syntax, perhaps a bogus \'-\'? See /usr/share/doc/procps-3.2.7/FAQroot 21123 0.0 0.0 3784 672 pts/2 T 15:10 0:00 more 12.sqlroot 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.. moreroot 21158 ..c.. manroot 21180 ..c.. shroot 21182 ..c.. lessroot 21223 ..c.. bash [etl@wgods ~]$ umount /mnt/usbumount: /mnt/usb is not in the fstab (and you are not root)[etl@wgods ~]$ su - rootPassword: [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是指繁体中文。

给TA打赏
共{{data.count}}人
人已打赏
服务器教程

云服务器MySQL远程连接不上的排查解决方法

2021-4-17 19:19:34

服务器教程

云服务器Squid Linux版配置反向代理,加速网站访问

2021-4-17 19:19:36

声明 本站上的部份代码及教程来源于互联网,仅供网友学习交流,若您喜欢本文可附上原文链接随意转载。无意侵害您的权益,请发送邮件至 [email protected] 或点击右侧 私信:吉吉国王 反馈,我们将尽快处理。
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索
OneEase