I have a CentOS 7 machine with two disks mounted [ /dev/sda and /dev/sdb ] using ext4.
I need to extend /dev/sdb1 to over 2 TB.
I extended the disk from 2 TB to 2.5 TB (google cloud)
After using fdisk to delete and recreate the partition, after the reboot the resize2fs /dev/sdb1 does not resize the partition to 2.5 TB, since it looks like fdisk has reached the magical 2 TB limit.
Is there a way to extend /dev/sdb1 to lets say 3 TB without losing the data?
as suggested by the fellow serverfault user @mzhaase I tried the gdisk with the following steps. The disk was formated with fdisk in total size of 2T
- stop all services using the /dev/sdb1 partition
- umount the device
- Create a backup/snapshot
- Extend the disk to 3T
- install gdisk if not already installed on the instance
p #print and save the GUID
o #delete all partitions
n #create new partition
c #label press ENTER or name if it had it
x #enter expert mode
g #paste the GUID
w #write changes
umount /dev/sdb1 #if it gets remounted by gdisk
- e2fsck -f /dev/sdb1 #check disk
- resize2fs /dev/sdb1 #resize the partition
- mount -a #check if the partitions mount as per fstab
- reboot #just to be sure