parted-模拟数十T的企业应用需求进行分区及格式化分区

1.新添加两个磁盘

 

Disk/dev/sdb: 21.5 GB, 21474836480 bytes

255heads, 63 sectors/track, 2610 cylinders

Units= cylinders of 16065 * 512 = 8225280 bytes

Sectorsize (logical/physical): 512 bytes / 512 bytes

I/Osize (minimum/optimal): 512 bytes / 512 bytes

Diskidentifier: 0x00000000

 

 

Disk/dev/sdb: 21.5 GB, 21474836480 bytes

255heads, 63 sectors/track, 2610 cylinders

Units= cylinders of 16065 * 512 = 8225280 bytes

Sectorsize (logical/physical): 512 bytes / 512 bytes

I/Osize (minimum/optimal): 512 bytes / 512 bytes

Diskidentifier: 0x00000000

 

 

通过parted 对大于2TB的磁盘进行分区

 模拟兼容2T以上磁盘分区方式
parted /dev/sdb  mklabel gpt yes
parted
 /dev/sdb  mkpart primary ext4 0 1000  ignore
parted
 /dev/sdb  mkpart primary ext4 1001 2000  Yes ignore
parted
 /dev/sdb  p

主节点

[root@node110 ha.d]#parted /dev/sdb mklabel gpt              #调整分区表为GPT模式

Warning: The existingdisk label on /dev/sdb will be destroyed and all data on this disk will

be lost. Do you wantto continue?

Yes/No? Yes                                                              

Information: You mayneed to update /etc/fstab.

 

[root@node110 ha.d]#parted /dev/sdb mkpart primary ext4 0 10000 ignore   #分第一个主分区 10G

Warning: The resultingpartition is not properly aligned for best performance.

Information: You mayneed to update /etc/fstab. 

 

[root@node110 ha.d]#ll /dev/sdb*

brw-rw---- 1 root disk8, 16 Nov 27 11:06 /dev/sdb

brw-rw---- 1 root disk8, 17 Nov 27 11:06 /dev/sdb1

 

[root@node110 ha.d]#parted /dev/sdb mkpart primary ext4 10001 20000 ignore                    #分第二个分区 10G

Warning: The resultingpartition is not properly aligned for best performance.

Information: You mayneed to update /etc/fstab.                          

 

[root@node110 ha.d]#ll /dev/sdb*

brw-rw---- 1root disk 8, 16 Nov 27 11:07 /dev/sdb

brw-rw---- 1root disk 8, 17 Nov 27 11:07 /dev/sdb1

brw-rw---- 1root disk 8, 18 Nov 27 11:07 /dev/sdb2

 

 

[root@node110ha.d]# parted /dev/sdb p         #查看硬盘的分区表

Model: VMware,VMware Virtual S (scsi)

Disk /dev/sdb:21.5GB

Sector size(logical/physical): 512B/512B

Partition Table:gpt

 

Number  Start  End     Size     File system  Name    Flags

 1     17.4kB  10.0GB  10000MB               primary

 2     10.0GB  20.0GB  9999MB                primary

 

备节点:

[root@node120~]# parted /dev/sdb mklabel gpt           #调整分区表为GPT模式

Information: Youmay need to update /etc/fstab.  

 

[root@node120~]# parted /dev/sdb mkpart primary ext4 0 10000 ignore           #分第一个主分区 10G

Warning: Theresulting partition is not properly aligned for best performance.

Information: Youmay need to update /etc/fstab.  

s

[root@node120~]# parted /dev/sdb mkpart primary ext4 10001 30000 ignore    #分第一个主分区 20G

查看分区后的分区表:

[root@node120 ~]#parted /dev/sdb p

Model: VMware, VMwareVirtual S (scsi)

Disk /dev/sdb: 32.2GB

Sector size(logical/physical): 512B/512B

Partition Table: gpt

Number  Start  End     Size     File system  Name    Flags

 1     17.4kB  10.0GB  10000MB               primary

 2     10.0GB  30.0GB  20.0GB                primary

 

分割线
感谢打赏
江西数库信息技术有限公司
YWSOS.COM 平台代运维解决方案
 评论
 发表评论
姓   名:

Powered by AKCMS