[РЕШЕНО] GPT partition structure during auto kickstart Rocky Linux / Centos 8

GPT is a newer and more advanced partition structure.

When using MS-DOS partition table (MBR), 3 primary and one extended partitions can be created on the hard disk. You can boot only in BIOS emulation mode. Limit on disk capacity 2 Tb.

When using the GUID partition table (GPT), 128 partitions can be created on the hard disk, you can boot in EFI mode. The maximum partition size limit is 9.4 ZB (zettabytes).

Customization

In order for the partition table to be in GPT format, for this, when creating the configuration kickstart file, add / edit the following lines:

...
# Partition clearing information
zerombr
clearpart --all --initlabel --disklabel=gpt --drives=sda
...
# Disk partitioning information
part /boot --fstype="xfs" --size=200 --label="boot" --ondisk=sda
part biosboot --fstype="biosboot" --size=1 --ondisk=sda
#part /boot/efi --fstype="xfs" --size=200 --label="efi" --ondisk=sda
...

Those. the most basic: add a parameter –Disklabel = gpt to section clearpart, and add the line:

part biosboot --fstype="biosboot" --size=1 --ondisk=sda

without it, during the OS preinstallation, an error will appear in the disk partitioning section

Examination

Checking a specific disk

$ sudo parted /dev/sda print
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sda: 9123MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Checking all disks in the system using the parted utility

$ sudo parted -l
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sda: 9123MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
...

Checking all disks in the system using the fdisk utility

$ sudo fdisk -l
Disk /dev/sda: 8.5 GiB, 9122611200 bytes, 17817600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 811BC132-5E8A-4EF1-9713-5E7549D301B7
...

Checking all disks in the system using the blkid utility

$ sudo blkid /dev/sda
/dev/sda: PTUUID="811bc132-5e8a-4ef1-9713-5e7549d301b7" PTTYPE="gpt"

Testing

I tested adding sections via VirtualBox, in the following way:

  • The virtual machine is shutting down
  • VDI disk grows via command line:
"C:Program FilesOracleVirtualBoxVBoxManage.exe" showhdinfo "C:UsersuserVirtualBox VMstestkstestks.vdi"
...
Capacity:       8192 MBytes
Size on disk:   2401 MBytes
...

"C:Program FilesOracleVirtualBoxVBoxManage.exe" modifyhd "C:UsersuserVirtualBox VMstestkstestks.vdi" --resize 8500
  • The virtual machine is started and the root LVM partition is expanded:
$ lsblk
$ sudo cfdisk /dev/sda
	New
	Type: Linux LVM (8e)
	Write
	Quit

$ lsblk
$ sudo pvcreate /dev/sda4 
$ sudo vgextend centos /dev/sda4
$ sudo lvextend  /dev/centos/root -l 100%VG
$ sudo xfs_growfs -d /dev/mapper/centos-root