Amazon EBS – Increasing Partition Size

amazon-ebslinuxpartition

I have a ec2 system with Suse12sp3 and have following file system

ip-10-XX-XX-1XX:/ # lsblk
NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
xvda    202:0    0   100G  0 disk
└─xvda1 202:1    0   100G  0 part /
xvdf    202:80   0   500G  0 disk
├─xvdf1 202:81   0  93.1G  0 part /hana/shared
├─xvdf2 202:82   0  93.1G  0 part /hana/log
└─xvdf3 202:83   0 186.3G  0 part /hana/data
xvdg    202:96   0    20G  0 disk
└─xvdg1 202:97   0    20G  0 part /test

I have been trying to increase the size of xvdf3 using the following commands, but it is not working as expected:

ip-10-xx-xx-xxx:/ # growpart /dev/xvdf 3
NOCHANGE: partition 3 is size 390625280. it cannot be grown

It is giving me an error, that It can't be grown, can you suggest what am doing wrong here.

Initially, these partitions were created as shown below:

parted /dev/xvdf 
mklabel gpt 
unit GB
mkpart primary 0.00GB  100.00GB
mkpart primary 100.00GB  200.00 Gb
mkpart primary 200.00GB  400.00 Gb
print
quit

Please suggest how partition expansion can be done

Best Answer

It looks like /dev/xvdf3 maybe mounted to /hana/data

Try umount /hana/data then try your growpart again.

Linux doesn't allow most modifications to partitions while they are mounted or in use in some way.