我们除了会使用fdisk分区,还需要掌握使用parted分区。
fdisk 只支持MBR分区,parted支持GPT分区,可以使用大容量硬盘。
[root@localhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
vda 252:0 0 90G 0 disk
├─vda1 252:1 0 500M 0 part /boot
└─vda2 252:2 0 89.5G 0 part
├─rhel-root 253:0 0 50G 0 lvm /
├─rhel-swap 253:1 0 2G 0 lvm [SWAP]
└─rhel-home 253:2 0 37.5G 0 lvm /home
vdb 252:16 0 10G 0 disk
[root@localhost ~]# parted /dev/vdb
GNU Parted 3.1
使用 /dev/vdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
(parted) mkpart primary 1M 10%
(parted) mkpart primary 10% 20%
(parted) print
Model: Virtio Block Device (virtblk)
Disk /dev/vdb: 10.7GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name 标志
1 1049kB 1074MB 1073MB primary
2 1074MB 2147MB 1074MB primary
(parted) quit
信息: You may need to update /etc/fstab.
[root@localhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
vda 252:0 0 90G 0 disk
├─vda1 252:1 0 500M 0 part /boot
└─vda2 252:2 0 89.5G 0 part
├─rhel-root 253:0 0 50G 0 lvm /
├─rhel-swap 253:1 0 2G 0 lvm [SWAP]
└─rhel-home 253:2 0 37.5G 0 lvm /home
vdb 252:16 0 10G 0 disk
├─vdb1 252:17 0 1023M 0 part
└─vdb2 252:18 0 1G 0 part