[root@ ~]# parted /dev/vdc
GNU Parted 3.1
Using /dev/vdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
Warning: The existing disk label on /dev/vdc will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? y
(parted) mkpart prinmary 1 -1
(parted) print
Model: Virtio Block Device (virtblk)
Disk /dev/vdc: 4295GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 4295GB 4295GB ext4 prinmary
(parted) quit
Information: You may need to update /etc/fstab.
mkfs -t ext4 /dev/vdc1
mkdir /data
mount /dev/vdc1 /data
命令解释:
parted /dev/vdc //选择硬盘
GNU Parted 3.1
Using /dev/vdc
Welcome to GNU Parted! Type 'help' to view a lis ofcommands。
(parted) mklabel gpt //创建类型GPT分区表
Warning: The existing disk label on /dev/vdc will be destroyedand all data on this disk will be lost. Do you want to continue?
Yes/No? y //确定
(parted) mkpart prinmary 1 -1 //将硬盘分成一个分区
(parted) print //查看
(parted) quit //退出
Information: You may need to update /etc/fstab.
|