CentOS6挂载U盘(运维小计)

挂载U盘

Centos默认是可以识别fast32格式的U盘。NTFS需要下载软件。

参考:

https://www.cnblogs.com/Firlsy/p/17379714.html
https://blog.csdn.net/bingdund/article/details/123378677

下载:

ntfs软件包下载:https://download.tuxera.com/opensource/ntfs-3g_ntfsprogs-2017.3.23.tgz

环境:

服务器:CentOS6.6

操作步骤

  1. 检查硬盘是否一接入,(最简单的方法,接入移除进行对比,看下哪个增减就知道硬盘是否已接入)
[root@localhost ~]# fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 898.3 GB, 898319253504 bytes
255 heads, 63 sectors/track, 109214 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/sda1               1      109215   877264895+  ee  GPT

Disk /dev/sdb: 61.5 GB, 61530439680 bytes
64 heads, 32 sectors/track, 58680 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x500a0dff

This doesn't look like a partition table
Probably you selected the wrong device.

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   ?      951312     1782356   850989111+  6e  Unknown
Partition 1 does not end on cylinder boundary.
/dev/sdb2   ?           1           1           0   74  Unknown
Partition 2 does not end on cylinder boundary.
/dev/sdb4           13697       13697         220+   0  Empty
Partition 4 does not end on cylinder boundary.

Partition table entries are not in disk order

WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdc: 5000.9 GB, 5000947302400 bytes
256 heads, 63 sectors/track, 605622 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x16f2a91f

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1      266306  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.
  1. 确认是否是ntfs还是fast32或者是ext。

看第1步执行的语句(fdisk -l)System显示。

  1. 硬盘格式ntfs情况,不是就跳过看第4步
    3.1 下载软件
    ntfs-3g_ntfsprogs-2017.3.23.tgz
    3.2 安装
./configure 
make && make install
#查看是否安装和安装版本,会输出版本,若是什么都没有或者执行命令异常,检查安装步骤。
ntfs-3g -V
#挂载
##创建挂载目录
mkdir -p /mnt/usb
##挂载命令
mount -t ntfs-3g /dev/sdc1 /mnt/usb
##查看是否挂载成功,有目录/mnt/usb就可以了。
df -h
  1. 硬盘格式若是fast32,可直接执行挂载
mount /dev/sdc1 /mnt/usb
  1. 若是未知,可执行mkfs,ext3进行格式化
#格式化
mkfs.ext3 /dev/sdb
#挂载
mount /dev/sdb /mnt/usb
  1. 卸载U盘
    6.1 普通命令
umount /mnt/usb

6.2 umount命令卸载U盘“device is busy”

umount -l /mnt/usb

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值