2TiB Data Disk Partition Expansion_Linux
This operation example is for situations where the disk capacity is larger than 2TiB and cannot be partitioned with the fdisk command. Instead, it is partitioned using the parted command. If the host disk capacity is larger than 2TiB, you can partition and expand it using the following methods.
Note:
It is recommended not to partition the cloud disk on the cloud host to avoid affecting the expansion of the cloud disk. Before the disk expansion operation, please confirm that if there is data in the data disk, it is recommended to backup the data first. The cloud disk can only be expanded when it is available. Since it needs a cloud disk, it will interrupt your business, so please operate carefully. After using the parted command, it will take effect in time, please confirm after the operation and then execute the command. After partitioning, you need to format it separately, otherwise you cannot use it directly.
Operational Notes:
- This example environment version:
- This example uses the parted command as a case, the parted command cannot be used crossly with the fdisk command.
- In this example, the mounting point of the cloud disk is /dev/vdb, please operate according to the actual situation. If you do not see the corresponding device, please check the cloud disk mounting information and status.
Specific Operation:
Partition of Newly Purchased Data Disk
- Mount the cloud disk on the console, for specific steps, see Mounting Cloud Disk section.
- After the mounting is complete, check the disk size within the operating system.
- Use the parted command to partition /dev/vdb.
- Check whether the disk partition is successful.
- Format the corresponding disk partition.
Note: This operation takes the xfs file system as an example, if you want to format as an ext4 file system, please execute the command mkfs.ext4 /dev/vdb1
- Use the mount command to mount the disk.
Expansion of Disk Larger Than 2TiB
- Check the current mounting situation, file system type and partition situation.
Note: If it is a bare disk data disk (no partition), please refer to Bare Disk Data Disk_Linux for expansion.
- Unmount the cloud disk in the operating system and the console, for specific steps, see the Unmounting Cloud Disk section. Expand the cloud disk through the cloud disk console.
- Mount the cloud disk in the console, for specific steps, see Mounting Cloud Disk section. After the mounting is complete, check the disk size in the operating system.
- Use the parted command to delete the original partition and create a new partition.
- parted /dev/vdb
Note: Deleting a partition will not result in the loss of data on the data disk.
- Check the file system, and expand.
Note: Under different file systems, the commands for checking and expanding are different, please confirm your file system type and operate according to the corresponding operation steps.
xfs File System
Execute xfs_repair /dev/vdb1 to check the file system.
Use mount command to remount the disk.
Execute xfs_growfs command to expand.
ext File System
Execute e2fsck -f /dev/vdb1 command to check the file system.
Execute resize2fs /dev/vdb1 for expansion operation.
Use mount command to remount the disk again.