Expanding parititions
Backup partition table
fdixk -x /dev/<dev>
sfdisk -d /dev/<dev> > partition.dump
Shrinking EXT(2,3,4) file system to minimum size
e2fsck -f /dev/<dev partition>
resize2fs -M /dev/<dev parition>
Editing partition table and restore
After shining the last partition you need to:
- Image it (see the other pages) and any other portions that need to be moved.
- Use
fdiskto delete the resized last partition. - Move other partitions (keeping exact size).
- Expand the target partition (keep starting sector unchanged).
- Copy data from images into moved and last partition.
- Resize the target partition and the last partition to max size with
resize2fs /dev/<dev parition>.
Use fdisk's expert mode (x) to print full partition information and to restore partitions UUID, name and attributes.