parted分区

划分裸盘

 

[[email protected] ~]# parted /dev/sda

(parted) 

(parted) mklabel gpt

Warning: The existing disk label on /dev/mapper/mpathd will be destroyed and all

data on this disk will be lost. Do you want to continue?

Yes/No? yes 

(parted) print 

(parted) q 

Information: You may need to update /etc/fstab.

 

 

对裸盘进行分区

 

[[email protected] ~]# parted /dev/sda

GNU Parted 3.1

Using /dev/sda

Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) mklabel

New disk label type? gpt

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) mkpart

Partition name? []? 1 ---指定分区名称

File system type? [ext2]? ext2 ----指定分区类型

Start? 1 ---指定开始位置

End? 1000G ---指定结束位置

(parted) P ----显示分区信息

Model: ATA ST91000640NS (scsi)

Disk /dev/sda: 1000GB

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

Partition Table: gpt

Disk Flags:

 

Number Start End Size File system Name Flags

1 1049kB 1000GB 1000GB xfs 1

 

(parted) q ----退出

Information: You may need to update /etc/fstab.

 

parted分区