Fdisk
Resizing a partition
To turn /dev/sda1 (mounted at /path/to/mountpoint) into a 900G partition...
Unmount:
umount /path/to/mountpoint
Check filesystem:
e2fsck -f /dev/sda1
Resize filesystem with a size smaller than the desired size:
resize2fs /dev/sda1 850G
Delete the partition and create it again with the desired size (a little bigger than the filesystem!!):
Command (m for help): p
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
81 heads, 63 sectors/track, 382818 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa8d4e6ca
Device Boot Start End Blocks Id System
/dev/sda1 2048 1953525167 976761560 83 Linux
Command (m for help): d
Selected partition 1
Command (m for help):
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-1953525167, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-1953525167, default 1953525167): +900G
Command (m for help): p
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
81 heads, 63 sectors/track, 382818 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa8d4e6ca
Device Boot Start End Blocks Id System
/dev/sda1 2048 1887438847 943718400 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Then launch resize2fs again:
e2fsck -f /dev/sda1
resize2fs /dev/sda1