【我的/dev/sdb有20T 该如何分区】
yum install parted
总结:
1)fdisk 不能对其进行分区,因为只支持2T
但是fdisk delete分区的操作还是可以的
fdisk -l 可能看不了 操作2T磁盘的分区情况,需要改用parted -l
2)parded命令可以对其进行GPT格式的分区
分区命令:
交互式进入去分区
parted /dev/sdb
将MBR磁盘格式化为GPT
mklabel gpt
分一个10T的
mkpart primary 0 10T
和一个将最后所有分区分到这个分区
mkpart primary 10T -1
格式化
mkfs.ext4 /dev/sdb1
10T的磁盘大概需要格式化三分钟
[root@hblf-bak002 ~]# parted /dev/sdb GNU Parted 2.1Using /dev/sdbWelcome to GNU Parted! Type 'help' to view a list of commands.(parted) mklabel gpt Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue?Yes/No? yes (parted) mkpart primary 0 10T Warning: The resulting partition is not properly aligned for best performance.Ignore/Cancel? Ignore (parted) print Model: DELL PERC H730P Mini (scsi)Disk /dev/sdb: 19.8TBSector size (logical/physical): 512B/4096BPartition Table: gptNumber Start End Size File system Name Flags 1 17.4kB 10.0TB 10000GB primary(parted) mkpart primary 10T -1 (parted) print Model: DELL PERC H730P Mini (scsi)Disk /dev/sdb: 19.8TBSector size (logical/physical): 512B/4096BPartition Table: gptNumber Start End Size File system Name Flags 1 17.4kB 10.0TB 10000GB primary 2 10.0TB 19.8TB 9797GB primary
非交互式命令:
parted -s /dev/sdb mklabel gptparted -s /dev/sdb mkpart primary 0 100%
分一个16T+的
parted -s /dev/sdb mklabel gpt
parted -s /dev/sdb mkpart primary 0 10T
parted -s /dev/sdb mkpart primary 10T 100%
parted -l 结果:
Model: DELL PERC H730P Mini (scsi)
Disk /dev/sdb: 16.2TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Number Start End Size File system Name Flags
1 17.4kB 10.0TB 10000GB primary
2 10.0TB 16.2TB 6198GB primary
然后在进行格式化
mkfs.ext4 /dev/sdb1
mkfs.ext4 /dev/sdb2
在mount 一下
###########
一个分区大于16T ext4是不支持的。挂载会报错。
parted -s /dev/sdb mklabel gpt
parted -s /dev/sdb mkpart primary 0 25T
parted -s /dev/sdb mkpart primary 25T 100%
parted -s /dev/sdb mklabel gpt
parted -s /dev/sdb mkpart primary 0 25T
parted -s /dev/sdb mkpart primary 25T 100%
mkfs.xfs /dev/sdb1 -f
mkfs.xfs /dev/sdb2 -f
mount -t xfs /dev/sdb1 /data2/
mount -t xfs /dev/sdb2 /data3/