1and1 Help Centre Categories

print article

Assign Additional Disk Space on a 1&1 Dynamic Cloud Server Linux

For 1&1 Dynamic Cloud Server Linux

Learn how to increase a partition's size after increasing the available disk space for your 1&1 Dynamic Cloud Server Linux.

If you have not already done so, increase the available disk space of your 1&1 Dynamic Cloud Server before you begin. Follow the step-by-step instructions below to find out how to increase the extended partition using Command Prompt.

Step 1
Log into your server via SSH.
Step 2
Use the disk free command with the human-readable option by typing df -h and pressing ENTER. The output will show you the different partitions of the disk, their size, used space, available space and which folder they are mounted. Details of Partitions
Details of Partitions
Step 3
Use the format disk command with the list option by typing fdisk -l and pressing ENTER.

The output displays the total disk size and all of the primary and extended partitions, the disk cylinders and file system IDs.
Please note:
If any of the partitions have Linux LVM as the System type, increase the size of the logical volume.
Disk Size Details
Disk Size Details
Step 4
Use the parted utility to alter the Extended partition size. /dev/hda4 and /dev/hda5 have the same Start Cylinder. Also, /dev/hda4 and /dev/hda6 both have the same End Cylinder. Both /dev/hda5 and /dev/hda6 are logical partitions held "within" the /dev/hda4 Extended Partition. Increase the extended partition before increasing the size of any logical partitions held "within".

Type parted /dev/hda and press ENTER to use the parted utility with the hda disk. Use Parted Utility
Use Parted Utility
Step 5
At the parted command prompt, type unit gb and press ENTER so that output of parted will be displayed in gigabytes. Type print and press ENTER to print the partition information.
The information displayed will be similar to the last two outputs. Print Partition Information
Print Partition Information
Step 6
Type unit s and press ENTER to display output in disk sectors instead of gigabytes.
Type print again and press ENTER to print the partition information again using sectors instead of gigabytes.

The last partition will have an end sector close to the end sector of the extended partition shown in red below. Increase the extended partition size to increase one of the logical partitions. Extended Partition
Extended Partition
Step 7
To increase the extended partition, the partition Number and the Start sector are needed.
Using the image below as an example, type resize 4 23470965s -1 and press ENTER.
Please note:
The partition number and start sector may change depending on your settings.
resize command for the parted utility partition number Start sector of the extended partition End sector of extended partition
resize 4 23470965s -1
Choose Partition for Resizing
Choose Partition for Resizing
Step 8
Type print and press ENTER to list the partitions again. The extended partition has been enlarged and the Size and End sector are now much larger than before the resize. The last partition's End sector will remain the same as before. View Modified Partitions
View Modified Partitions
Step 9
Type unit gb and press ENTER.
Type print and press ENTER to list the partitions again, this time displayed in gigabytes.

The extended partition has been increased but the following logical partition sizes have remained the same. Type quit and press ENTER to quit the parted utility. Partitions Displayed in GB
Partitions Displayed in GB
Step 10
Type fdisk /dev/hda and press ENTER to use the the format disk utility with the /dev/hda disk. Type p and press ENTER to print the partition table. The End sector for the Extended partition is much higher than the End sector of the last partition. Use Format Disk Utility to View Extended Partition
Use Format Disk Utility to View Extended Partition
Step 11
Increase the last partition to use all of the available space from the disk increase by deleting the partition and re-creating it. Deleting the partition and creating a new, larger partition in its place will not delete the data on the disk. Instead, delete and recreate the partition since it is not possible to resize.

Type d at the command prompt to delete a partition.
Type 6 to delete the last partition (The 6th partition is /dev/hda6 which is mounted to the /var folder as can be seen using the command df -h as in step one). Delete Last Partition
Delete Last Partition
Step 12
Type n and press ENTER to create a new partition in its place.
Type l and press ENTER to create a new logical partition.
Type the default value for the First cylinder and press ENTER.
Type the default value for the Last cylinder and press ENTER to use the full amount of available space for this partition. Create New Logical Partition
Create New Logical Partition
Step 13
Type p and press ENTER to print the partition table once again.
This time you will notice that the End cylinder of the last partition is now the same as the End cylinder for the Extended partition using the full amount of space.
Type w and press ENTER to write and save the changes you have made. Save Changes
Save Changes
Step 14
Take the time to reboot your machine now by typing the command shutdown -r now and pressing ENTER.
Reboot Machine
Reboot Machine
Step 15
Log back into the server via SSH after a moment and use the df -h command again. The /dev/hda6 partition has still not increased. This is because the the file system on this partition must be increased.
Log Back into Server
Log Back into Server
Step 16
To increase the space of the /var folder (or /dev/hda6 partition), use the command xfs_growfs /var/ command and press ENTER to to grow the xfs file system. Grow the xfs File System
Grow the xfs File System
Step 17
Type df -h and press ENTER to check the free disk space. The partition size has now been increased successfully and the process is complete. Check Free Diskspace
Check Free Diskspace