Centos 挂载U盘

开始

  我拿到的是一个新盘,遇到的第一个问题是插上去后centos不能识别他,使用fdsik -l也没有这个U盘的任何信息,再windows上面查看他的格式也是fat32,没有问题,于是折腾了很久后我重新把他格式化,也同样格式化为fat32,这次就能识别了。

命令:fdisk -l (查看磁盘分区信息)

[root@phoenix Desktop]# fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000f2962

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          26      204800   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              26         281     2048000   82  Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sda3             281        3917    29203456   83  Linux

Disk /dev/sdb: 31.1 GB, 31104958464 bytes
255 heads, 63 sectors/track, 3781 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        3782    30371840    c  W95 FAT32 (LBA)

 

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

命令:mount -t vfat /dev/sdb1 /mnt/usb(挂载U盘,注意如果是ntfs格式的话可能需要安装ntfs-3g这个插件才能执行)

成功后就可以进入 /mnt/usb查看到U盘相应的内容了

命令:umount /mnt/usb(卸载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(成功卸载)

 

转载于:https://www.cnblogs.com/zzy-frisrtblog/p/5973464.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值