Problem description
After you extend a GUID Partition Table (GPT) disk and use the growpart utility to extend a partition or file system on the disk, such as the /dev/vdb1 partition, error messages appear, as shown in the following figure. As a result, the disk is extended but the available space of the partition or file system does not increase. In this topic, the /dev/vdb1 partition is used to describe how to resolve the preceding issue.
Cause
When you initialized the disk, you did not run the mkpart primary 1 100% command as recommended to create a primary partition on the disk and specify the start and end positions of the partition. In the following example, the /dev/vdb disk is used.
To check whether a partition is aligned, run the following commands:
fdisk -l: checks whether theStartvalue for the partition is2048. If the Start value for the partition is not 2048, the partition is not aligned.parted -l: checks whether theStartvalue for the partition is1049 kB. If the Start value for the partition is not 1049 kB, the partition is not aligned, as shown in the following figure.
Solution
To resolve the preceding issue, repartition the disk and then extend the partition.
Connect to the Elastic Compute Service (ECS) instance to which the disk is attached.
For more information, see Connection method overview.
Run the following command to query information about the /dev/vdb1 partition in the etc/fstab file:
cat /etc/fstabThe following figure shows sample information about the /dev/vdb1 partition.
Run the following command to modify the etc/fstab file and delete the information of the /dev/vdb1 partition:
vim /etc/fstabRun the following command to unmount the /dev/vdb1 partition:
umount /dev/vdb1
Repartition the disk and mount the file system in the new partition.
ImportantAfter you repartition the disk, the data stored on the original partition is lost. We recommend that you create a snapshot to back up all data on the disk in advance. After you repartition the disk and mount the file system of the new partition to the disk, you can use the snapshot to restore data on the disk. For information about how to create a snapshot, see Create a snapshot for a disk.
For more information, see Initialize a data disk (Linux).