- Careful to stop Autoscaling procedures if necessary otherwise you may loose the machine and the disk;
- Stop the server;
- Umount the disk;
- Create a snapshot;
- Create a new volume with the wanted size using the snapshot;
- Mount the volume in a running machine;
a. Execute: fdisk /dev/xvd?
according to the name you gave in (5);
b. Type p
to print the partition table;
c. Save the starting block and the Id of the partition you want to enlarge;
d. Type d
to delete the partition;
e. Type p
to ensure the partition was deleted;
f. Type n
to create a new partition;
g. Type p
to choose the new partition as primary;
h. Type <ENTER>
to confirm it as the first partition;
i. Type the starting block number you saved in step (c);
j. Type <ENTER>
to accept the default end partition. This will make it use all the disk;
k. Type p
to see the new partition configuration and review everything;
l. Type w
to permanently write the information to the disk;
a. Execute: parted /dev/xvd?
according to the name you gave in (5);
b. Type print
;
c. Type fix
to fix the problems encontered in the GPT partition;
d. Save the number of the partition you want to enlarge;
e. Type resizepart ?
according with the number of the partition you wanted saved in (d);
f. Type yes
to confirm;
g. Type the size you want the partition to have;
h. Type print
;
i. Type quit
;
- Mount the partition only to confirm the original partition is still working;
- Umount the partition;
- Execute
partprobe
to sync the new disk configuration to linux (You may also reboot Linux if you want); - Execute
e2fsck -f /dev/xvd?1
to check the disk for errors; - Execute
resize2fs /dev/xvd?1
to the disk so it will enlarge the partition to fit all disk as you configured; - Mount the partition only to confirm the new partition is still working;
- Umount the partition;
- Detach the disk from the running server;
- Attach the disk to the old server as /dev/sda1;
- Start the server;
- Wait until the server is online;
- SSh to the server to confirm its all working;
- Restart the autoscaling procedures to allow the server to came back;
- Change the autoscaling configuration so you will use a new disk of the size you want;