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是指繁体中文。
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
更新日志
- 【小提琴】陈立新《思乡曲》2004[FLAC+CUE]
- 《战地》新作明年初大规模测试!EA已内部测试一年
- 《GTAOL》PC版时隔多年更新反作弊!小助手宣布跑路
- EA称AI是其业务核心!能提高开发效率、节约成本
- 卫华.1990-太阳升【BMG】【WAV+CUE】
- 呼吸乐队.1992-THEBREATHING【深飞】【WAV+CUE】
- 李玟.2008-1994-2008豪华典藏精选2CD【SONY】【WAV+CUE】
- 《张学友 再现歌神的光辉岁月 梦想成真 2CD》[WAV/分轨][1.2GB]
- 《海来阿木 高音测试王》[WAV+CUE][500MB]
- 《许巍 歌声给你生命的力量 珍藏许巍 3CD》[WAV/分轨][2GB]
- 《直到黎明重制版》配置要求推荐
- 《赛博朋克2077》2.13版本更新内容一览
- 《神话时代:重述版》评测:粉丝们的朝花夕拾
- 战锤40K星际战士2先锋职业介绍|先锋职业技能效果一览
- 战锤40K星际战士2重装职业介绍|重装职业技能效果一览