Quantcast
Channel: Tutorials – Official Blog – Contabo.com
Viewing all articles
Browse latest Browse all 66

Changing the partition layout of your VPS after installation

$
0
0

In case you want to add additional partitions to your system you will have to reorganize your existing partition layout.

This tutorial shows how to easily change your partition layout on your VPS.

Please be advised to perform a backup of all important data before proceeding ! Changes to the partition table always bear the risk of complete data loss.

 

Linux


 

Step 1:

Boot your VPS into the rescue-system, this can be done within your customer control panel.

You will need to connect through VNC

After you have established a connection login as "root".

Step 2:

To perform changes on the partition easily we are going to use gparted.

If you want to boot your system straight up into your regular OS after repartitioning, you should execute "exitrescue" now on the commandline before proceeding.

To start the GUI type "startx" within your VNC console and wait a few seconds until the graphical interface appears.

On the upper left side you will see "Applications", open it and select "Run Program".
Now type "gparted" within the application finder and the app should start immediately.

part1

 

 

 

 

 

 

 

 

 

Step 3:

You should see an overview of all existing partitions on your hard disk drive.
First we need to shrink one existing partition, otherwise we will not be able to create a new one.

part2
Perform a right click on the partition you want to shrink (usually this should be vda2) and hit "Resize/Move".

 

part3

 

A window pops up on which you will be able to shrink that partition.

 

Step 4:

Creating new partitions on the recently freed up storage.

part4
Perform a rightclick on the unallocated space and select "new" to create a new partition.

In this case I did it twice to create two additional partitions.

 

part5

 

Nothing was written to your HDD so far, if you want to restart the partitioning just rerun the gparted tool.

Step 5:

To write the changes to HDD hit the green tick symbol.
After hitting the tick, a warning will appear saying that you can lose all data - you should have a backup, so no worries.

 

part6

 

The application should start performing several tasks, just wait until it has finished.

Depending on the size of the partition and the data stored on it, this will take its time.

 

part7

 

Step 6:

You are done, just boot up your VPS into the regular OS  and check if everything is as expected:

root@contabo-test:~# fdisk -l

Disk /dev/vda: 500 GiB, 536870912000 bytes, 1048576000 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
Disklabel type: dos
Disk identifier: 0x71f88616

Device Boot Start End Sectors Size Id Type
/dev/vda1 * 2048 487423 485376 237M 83 Linux
/dev/vda2 487424 41447423 40960000 19.5G 83 Linux
/dev/vda3 41447424 246247423 204800000 97.7G 83 Linux
/dev/vda4 246247424 1048575999 802328576 382.6G 83 Linux

 

 

Windows


 

Step 1:

Connect to your server using RDP.

Step 2:

Open the "Disk Management", this can be done with a right click on the Windows Icon on the lower left side.
You could also start it by opening the "run" prompt, which can be done  via "Start" -> "Execute" -> "diskmgmt.msc", alternately the "Execute" dialogue can be opened by hitting "Windows-Logo-Key +R"

winp1_en
Step 3:

After the Windows "Disk Management" utility was started you will see an overview of all installed harddrives.
On a VPS you will usually have one drive, on a dedicated Server you will probably have more than one sparse disk.
Search for the disk you want to repartition and perform a right click on the partition you want to resize.

You can shrink and also extend a Volume, sometimes when upgrading your VPS to a bigger plan you can either create a second partition or just extend the existing partition.

For now we want to shrink the existing partition, so we hit "Shrink Volume".

winp2_en
Step 4:

After some time passed you will see a popup, just fill out the field with the amount of space you want to free up and hit "shrink".

winp3_en

 

Step 5:

After shrinking you will have unallocated space, now you are ready to create a new partition, e.g. a FAT32 filesystem etc.

winp4_en


Viewing all articles
Browse latest Browse all 66

Trending Articles