Introduction
The following is an example of resizing the disk after upgrading a CX10 to a CX30.
Step 1 - Preparations
Boot the server into the rescue system.
Check the current partition table (it should look similar to this depending on the model):
# fdisk -l /dev/sda
Disk /dev/sda: 102.4 GB, 102399737856 bytes
255 heads, 63 sectors/track, 12449 cylinders, total 199999488 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: 0x00051eb3
Device Boot Start End Blocks Id System
/dev/sda1 2048 52426752 26212352+ 83 Linux
Make a note of the start and end sectors just in case something goes wrong.
Step 2 - Formatting
Delete the partition and create a new one in its place:
root@rescue ~ # fdisk /dev/sda
Command (m for help): d
Selected partition 1
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1):
Using default value 1
First sector (2048-199999487, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-199999487, default 199999487):
Using default value 199999487
Partition #1 contains a ext4 signature.
Do you want to remove the signature? [Y]es/[N]o: N
Command (m for help): p
Disk /dev/sda: 102.4 GB, 102399737856 bytes
255 heads, 63 sectors/track, 12449 cylinders, total 199999488 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: 0x00051eb3
Device Boot Start End Blocks Id System
/dev/sda1 2048 199999487 99998720 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Step 3 - Checking the File System
Do a file system check with:
root@rescue ~ # e2fsck -f -C0 /dev/sda1
e2fsck 1.42.5 (29-Jul-2012)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda1: 26283/1638400 files (5.6% non-contiguous), 283813/6553088 blocks
Step 4 - Resizing the File System
Resize the file system with:
# resize2fs /dev/sda1
resize2fs 1.42.5 (29-Jul-2012)
Resizing the filesystem on /dev/sda1 to 24999680 (4k) blocks.
The filesystem on /dev/sda1 is now 24999680 blocks long.
Reboot and check if the disk is larger.
Conclusion
By now you should have resized the partition to your liking.