This is on an AWS EC2 M5a with EBS (Ubuntu 16.04)
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nvme0n1 259:1 0 50G 0 disk
├─nvme0n1p1 259:2 0 20G 0 part /
├─nvme0n1p2 259:3 0 2G 0 part [SWAP]
└─nvme0n1p3 259:4 0 28G 0 part
├─vg_abcdef-logs 251:1 0 8G 0 lvm /var/log
└─vg_abcdef-app 251:2 0 19G 0 lvm /home/abcdef
nvme1n1 259:0 0 50G 0 disk
└─vg_backups-backups 251:0 0 49G 0 lvm /home/abcdef/Backups-Disk
I added 50GB to the disk (nvme0n1)/EBS volume for a total of 100GB and need to expand the first partition (root /). I have the following:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nvme0n1 259:1 0 100G 0 disk
├─nvme0n1p1 259:2 0 20G 0 part /
├─nvme0n1p2 259:3 0 2G 0 part [SWAP]
└─nvme0n1p3 259:4 0 28G 0 part
├─vg_abcdef-logs 251:1 0 8G 0 lvm /var/log
└─vg_abcdef-app 251:2 0 19G 0 lvm /home/abcdef
nvme1n1 259:0 0 50G 0 disk
└─vg_backups-backups 251:0 0 49G 0 lvm /home/abcdef/Backups-Disk
The resize2fs command wont work on the first partition because there is a second and third partition right after it. As you will see below - resize2fs will work on the third (nvme0n1p3)
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nvme0n1 259:1 0 100G 0 disk
├─nvme0n1p1 259:2 0 20G 0 part /
├─nvme0n1p2 259:3 0 2G 0 part [SWAP]
└─nvme0n1p3 259:4 0 78G 0 part
├─vg_abcdef-logs 251:1 0 8G 0 lvm /var/log
└─vg_abcdef-app 251:2 0 19G 0 lvm /home/abcdef
nvme1n1 259:0 0 50G 0 disk
└─vg_backups-backups 251:0 0 49G 0 lvm /home/abcdef/Backups-Disk
How do I move the second and third partitions (via terminal/CLI only) whereas there is enough space to expand (extend file system) on the first partition? Preferably a solution wherein I do not have to stop and restart the EC2 instance, however, all good if it is necessary.