对应linux系统磁盘挂载,小于2T的磁盘可以fdisk工具挂载,但由于fdisk本身的局限性,导致其最大只能支持2T的磁盘格式分区。
所有对于2T以上的磁盘,需要使用parted工具挂载,具体操作步骤如下:
1.查看磁盘挂载情况
lsblk
2.分区磁盘
parted /dev/vdb
GNU Parted 3.1
Using /dev/vdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p #p:打印
Model: Virtio Block Device (virtblk)
Disk /dev/vdb: 6442GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
(parted) mklabel gpt #创建gpt格式
Warning: The existing disk label on /dev/vdb will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? y
(parted) mkpart #创建分区
Partition name? []? vdb1 #分区名字
File system type? [ext2]? xfs #类型
Start? 0 #磁盘起始位置
End? 100% #磁盘结束位置
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? Ignore #忽略错误
(parted) p #打印信息
Model: Virtio Block Device (virtblk)
Disk /dev/vdb: 6442GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 17.4kB 6442GB 6442GB vdb1
(parted) quit #退出
Information: You may need to update /etc/fstab.
3.格式化磁盘
mkfs.xfs /dev/vdb1
4.将磁盘挂载到/data目录下
mount /dev/vdb1 /data