View Issue Details

IDProjectCategoryView StatusLast Update
0017372CentOS-8cloud-utils-growpartpublic2020-05-18 13:28
Reporteradrian27 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
PlatformAWS EC2OSOS Version
Product Version8.1.1911 
Target VersionFixed in Version 
Summary0017372: growpart cannot extend partitions bigger than 2TiB even if partition type is GPT
DescriptionI installed a centos 8 VM with an attached volume of 3 TiB and GPT partition type.

There is a single root partition that should be extended by growpart to maximum available space in the attached volume. Instead the growpat extends the partition to 2 TiB during instance boot (due to growpart directive in cloud-init config file), and 1 TiB is left unused.

Even after the VM is up and running, the root partition cannot be extended above 2 TiB. See below:

[root@ip-172-31-11-134 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 3T 0 disk
├─xvda1 202:1 0 1M 0 part
└─xvda2 202:2 0 2T 0 part /

[root@ip-172-31-11-134 ~]# growpart /dev/xvda 2
NOCHANGE: partition 2 is size 4294963200. it cannot be grown

[root@ip-172-31-11-134 ~]# rpm -q cloud-utils-growpart
cloud-utils-growpart-0.29-3.el8.noarch

[root@ip-172-31-11-134 ~]# parted /dev/xvda --script -- "unit TB print"
Model: Xen Virtual Block Device (xvd)
Disk /dev/xvda: 3.22TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
 1 0.00TB 0.00TB 0.00TB primary bios_grub
 2 0.00TB 2.20TB 2.20TB xfs primary
Steps To ReproduceLaunch an CentOS 8 image with 3 TiB volume attached. Partition type should be GPT.

cloud-init should be installed, and growpart and resizefs configuration directives should be in /etc/cloud/cloud.cfg cloud-init configuration file (this is not really necessary, but its good to have the root partition automatically extended during boot).

After the VM is up and running, run the lsblk command. The root partition (in my case /dev/xvda2) is only 2 TiB, while it should be 3 TiB.



Additional InformationWith some other commands, the root partition and filesystem can be extended to the 3 TiB, see below:

[root@ip-172-31-11-134 ~]# sfdisk --list-free /dev/xvda | grep Unpartitioned
Unpartitioned space /dev/xvda: 952 GiB, 1022202199552 bytes, 1996488671 sectors

[root@ip-172-31-11-134 ~]# echo ', +' | sfdisk --no-reread --no-tell-kernel --force -N 2 /dev/xvda
Disk /dev/xvda: 3 TiB, 3221225472000 bytes, 6291456000 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: 85DD055B-5749-4F15-B11C-7CE84E637B99

Old situation:

Device Start End Sectors Size Type
/dev/xvda1 2048 4095 2048 1M BIOS boot
/dev/xvda2 4096 4294967295 4294963200 2T Linux filesystem

/dev/xvda2:
New situation:
Disklabel type: gpt
Disk identifier: 85DD055B-5749-4F15-B11C-7CE84E637B99

Device Start End Sectors Size Type
/dev/xvda1 2048 4095 2048 1M BIOS boot
/dev/xvda2 4096 6291455966 6291451871 3T Linux filesystem

The partition table has been altered.

[root@ip-172-31-11-134 ~]# sfdisk --list-free /dev/xvda | grep Unpartitioned
Unpartitioned space /dev/xvda: 0 B, 0 bytes, 0 sectors
[root@ip-172-31-11-134 ~]#

[root@ip-172-31-11-134 ~]# partprobe

[root@ip-172-31-11-134 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 3T 0 disk
├─xvda1 202:1 0 1M 0 part
└─xvda2 202:2 0 3T 0 part /
[root@ip-172-31-11-134 ~]#

[root@ip-172-31-11-134 ~]# xfs_growfs /
meta-data=/dev/xvda2 isize=512 agcount=1025, agsize=524096 blks
         = sectsz=512 attr=2, projid32bit=1
         = crc=1 finobt=1, sparse=1, rmapbt=0
         = reflink=1
data = bsize=4096 blocks=536870400, imaxpct=25
         = sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=2560, version=2
         = sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 536870400 to 786431483
[root@ip-172-31-11-134 ~]#

[root@ip-172-31-11-134 ~]# df --output=size --block-size $((1024*1024*1024)) /
1G-blocks
     3000
[root@ip-172-31-11-134 ~]#
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2020-05-18 13:28 adrian27 New Issue