Ext3 - Ext4 Disk Resize from shell
IMPORTANT:
When recreating the partition, make sure you create it with the same starting disk cylinder as before!
Case A - Reduce Partition
-------------------------
1. Reduce filesystem:
resize2fs -p '/dev/dsc1' <size-in-bytes>
2. Check filesystem:
e2fsck -f -y -v -c 0 '/dev/sdc1'
3. Reduce partition with fdisk
This can be done using fdisk(8) by deleting the partition and recreating it with a smaller size:
Be sure not make it smaller than the new filesystem size!
Case B - Expand Partition
-------------------------
1. Expand partition with fdisk
This can be done using fdisk(8) by deleting the partition and recreating it with a larger size:
Be sure not make it smaller than the new filesystem size!
1. Expand filesystem:
resize2fs -p '/dev/dsc1' <size-in-bytes>
2. Check filesystem:
e2fsck -f -y -v -c 0 '/dev/sdc1'
NOTES:
size-in-bytes: can be expressed also with Units (e.g. 100M - 12G)
sdc1: just for example