挂载U盘
Centos默认是可以识别fast32格式的U盘。NTFS需要下载软件。
参考:
https://www.cnblogs.com/Firlsy/p/17379714.html
https://blog.youkuaiyun.com/bingdund/article/details/123378677
下载:
ntfs软件包下载:https://download.tuxera.com/opensource/ntfs-3g_ntfsprogs-2017.3.23.tgz
环境:
服务器:CentOS6.6
操作步骤
- 检查硬盘是否一接入,(最简单的方法,接入移除进行对比,看下哪个增减就知道硬盘是否已接入)
[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.
- 确认是否是ntfs还是fast32或者是ext。
看第1步执行的语句(fdisk -l)System显示。
- 硬盘格式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
- 硬盘格式若是fast32,可直接执行挂载
mount /dev/sdc1 /mnt/usb
- 若是未知,可执行mkfs,ext3进行格式化
#格式化
mkfs.ext3 /dev/sdb
#挂载
mount /dev/sdb /mnt/usb
- 卸载U盘
6.1 普通命令
umount /mnt/usb
6.2 umount命令卸载U盘“device is busy”
umount -l /mnt/usb