0

I need to expand the /home partition in my AWS EC2 instance. I have already added the required storage and trying to follow the article : https://docs.aws.amazon.com/ebs/latest/userguide/recognize-expanded-volume-linux.html

# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda5       48G  2.4G   44G   6% /
devtmpfs        7.3G     0  7.3G   0% /dev
tmpfs           7.3G     0  7.3G   0% /dev/shm
tmpfs           7.3G  769M  6.6G  11% /run
tmpfs           7.3G     0  7.3G   0% /sys/fs/cgroup
/dev/xvda3       69G  624M   68G   1% /var
/dev/xvda1      239M  112M  115M  50% /boot
/dev/xvda7      222G   95G  127G  43% /home
tmpfs           1.5G     0  1.5G   0% /run/user/1000

# lsblk
NAME                    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
xvda                    202:0    0     2T  0 disk
├─xvda1                 202:1    0   250M  0 part /boot
├─xvda2                 202:2    0 112.3G  0 part
│ ├─vgseceon-data_tmeta 253:0    0   1.1G  0 lvm
│ │ └─vgseceon-data     253:2    0 106.7G  0 lvm
│ └─vgseceon-data_tdata 253:1    0 106.7G  0 lvm
│   └─vgseceon-data     253:2    0 106.7G  0 lvm
├─xvda3                 202:3    0  68.4G  0 part /var
├─xvda4                 202:4    0     1K  0 part
├─xvda5                 202:5    0  48.8G  0 part /
├─xvda6                 202:6    0  48.8G  0 part [SWAP]
└─xvda7                 202:7    0 221.4G  0 part /home

# cat /etc/fstab
UUID=12312              /           ext3    defaults        1 1
UUID=12323131232       /boot        ext3    defaults        1 2
UUID=132321321312      /home        xfs     defaults        0 0
UUID=6654654564654     /var         xfs     defaults        0 0
UUID=469u904u040u540   docker-data  xfs     defaults        0 0
UUID=469u904u040u540a  swap         swap    defaults        0 0

I need to extend the /home partition to its maximum. When I run the command

# growpart /dev/xvda 7

I get the error

attempt to resize /dev/xvda failed. sfdisk output below:
| sfdisk: Warning: extended partition does not start at a cylinder boundary.
| DOS and Linux will interpret the contents differently.
|
|
| Disk /dev/xvda: 267349 cylinders, 255 heads, 63 sectors/track
| Old situation:
| Units: cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
|
|    Device Boot Start     End   #cyls    #blocks   Id  System
| /dev/xvda1   *      0+     31-     32-    256000   83  Linux
| /dev/xvda2         31+  14692-  14661- 117760000   83  Linux
| /dev/xvda3      14692+  23616-   8924-  71680000   83  Linux
| /dev/xvda4      23616+  65270-  41655- 334590976    5  Extended
| /dev/xvda5      23616+  29990-   6375-  51200000   83  Linux
| /dev/xvda6      29990+  36364-   6375-  51200000   82  Linux swap / Solaris
| /dev/xvda7      36364+  65270-  28907- 232187904   83  Linux
| Warning: given size (3710767071) exceeds max allowable size (464375808)
| cannot build surrounding extended partition
| sfdisk: bad input
FAILED: failed to resize
***** WARNING: Resize failed, attempting to revert ******
/tmp/growpart.7xbA6J/orig.save: No such file or directory

sfdisk: cannot stat partition restore file (/tmp/growpart.7xbA6J/orig.save)
***** Appears to have gone OK ****

I am using "CentOS Linux release 7.1.1503 (Core)"

I have also gone through : AWS EC2: error expanding EBS volume partition but this also did not work for me

How to extend the /home partition ?

0

Browse other questions tagged or ask your own question.