Linux 创建大于2T的分区(parted创建GPT分区)

现在有一块12T的磁盘,需要分成三个区作为OpenStack的存储目录,分别为:

  • /dev/sda1(6T):作为Nova实例存放目录/var/lib/nova/instances
  • /dev/sda2(4T):存放Cinder数据卷存放分区
  • /dev/sda3(2T):作为Swift对象存储使用分区

操作方法:

[root@openstack-controller ~]# parted /dev/sda
......
(parted) mklabel gpt    # 更改为pgt分区
Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? yes                                                               
(parted) print    # 打印分区信息                                                        
Model: AVAGO MR9361-8i (scsi)
Disk /dev/sda: 12.0TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt    # 确认为gpt
Disk Flags: 

Number  Start  End  Size  File system  Name  Flags

(parted) mkpart primary 0 6TB    # 创建6TB分区                                    
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? i                                                          
(parted) mkpart primary 6TB 10TB    # 创建4TB分区
(parted) mkpart primary 10TB 12TB    # 创建2TB分区
(parted) print                                                            
Model: AVAGO MR9361-8i (scsi)
Disk /dev/sda: 12.0TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start    End      Size    File system  Name     Flags
 1      17.4kB   6000GB   6000GB               primary
 2      6000GB   10000GB  4000GB               primary
 3      10000GB  12.0TB   2001GB               primary
(parted) quit

[root@openstack-controller ~]# lsblk   # 验证
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 10.9T 0 disk
├─sda1 8:1 0 5.5T 0 part
├─sda2 8:2 0 3.7T 0 part
└─sda3 8:3 0 1.8T 0 part
...

 

 

Linux 创建大于2T的分区(parted创建GPT分区)

上一篇:JavaWeb| JSTL标签库看这篇文章就够了!(含案例)


下一篇:【linux】系统编程-7-网络编程