{"id":3806,"date":"2016-05-24T15:24:12","date_gmt":"2016-05-24T13:24:12","guid":{"rendered":"https:\/\/contabo.com\/blog\/?p=3806"},"modified":"2023-02-21T17:41:33","modified_gmt":"2023-02-21T16:41:33","slug":"changing-partition-layout-vps-installation","status":"publish","type":"post","link":"https:\/\/contabo.com\/blog\/changing-partition-layout-vps-installation\/","title":{"rendered":"Changing the partition layout of your VPS and VDS after installation"},"content":{"rendered":"<p>Sometimes, it is necessary to change your partition layout in order to create new partitions or extend an existing partition, for example after a VPS \/ VDS upgrade.<\/p>\n<p>This tutorial shows how to easily change your partition layout on your VPS or VDS.<\/p>\n<p><span style=\"color: #ff0000;\"><strong>Please be advised to perform a <a href=\"https:\/\/contabo.com\/blog\/tutorials\/linux-debianubuntu-backup\/\">backup<\/a> of all important data before proceeding ! Changes to the partition table always bear the risk of complete data loss.<br \/>\n<\/strong><\/span><\/p>\n<p><strong>Linux<\/strong><\/p>\n<hr \/>\n<p><strong>Step 1:<\/strong><\/p>\n<p>Boot your VPS \/ VDS into the rescue-system, this can be done within your <a href=\"https:\/\/my.contabo.com\" target=\"_blank\" rel=\"noopener noreferrer\">customer control panel<\/a>.<\/p>\n<p>You will need to connect through <a href=\"https:\/\/contabo.com\/blog\/tutorials\/vnc-connect-vps\/\" target=\"_blank\" rel=\"noopener noreferrer\">VNC.<\/a><\/p>\n<p>After you have established a connection login as &#8220;root&#8221;.<\/p>\n<p><strong>Step 2:<\/strong><\/p>\n<p>To perform changes on the partition easily we are going to use gparted.<br \/>\nTo start the GUI type &#8220;startxfce4&#8221; within your VNC console and wait a few seconds until the graphical interface appears.<\/p>\n<p>On the upper left side you will see &#8220;Applications&#8221;, open it and select &#8220;Run Program&#8221;.<br \/>\nNow type &#8220;gparted&#8221; within the application finder and the app should start immediately.<\/p>\n<p><a href=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part1.jpg\" rel=\"attachment wp-att-4729\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4729 alignleft\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part1-300x221.jpg\" alt=\"part1\" width=\"500\" height=\"369\" srcset=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part1-300x221.jpg 300w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part1-1024x756.jpg 1024w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part1-768x567.jpg 768w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part1.jpg 1026w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n<p><strong>Step 3:<\/strong><\/p>\n<p>You should find an overview of all existing partitions on your hard disk drive.<br \/>\nIn case there is no unused space left,\u00a0 we need to shrink one existing partition first, otherwise we will not be able to create a new one.<\/p>\n<p>After a right click on the corresponding partition and choosing &#8220;Resize\/Move&#8221;, the partition can be either shrunk or extended.<\/p>\n<p><strong>Please note that LVM partitions (which are used with CentOS by default) cannot be shrunk!<\/strong><\/p>\n<p><a href=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part3.jpg\" rel=\"attachment wp-att-4731\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4731\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part3-300x227.jpg\" alt=\"part3\" width=\"501\" height=\"379\" srcset=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part3-300x227.jpg 300w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part3-1024x775.jpg 1024w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part3-768x582.jpg 768w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part3.jpg 1026w\" sizes=\"auto, (max-width: 501px) 100vw, 501px\" \/><\/a><\/p>\n<p>In case you only wanted to extend your existing partition, please proceed with <strong>step 5<\/strong>.<\/p>\n<p><strong>Step 4:<\/strong><\/p>\n<p>Creating new partitions on the recently freed up\/already free storage.<\/p>\n<p><a href=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part4.jpg\" rel=\"attachment wp-att-4732\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4732\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part4-300x219.jpg\" alt=\"part4\" width=\"496\" height=\"362\" srcset=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part4-300x219.jpg 300w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part4-768x561.jpg 768w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part4.jpg 1023w\" sizes=\"auto, (max-width: 496px) 100vw, 496px\" \/><\/a><br \/>\nPerform a right click on the unallocated space and select &#8220;new&#8221; to create a new partition.<\/p>\n<p>In this case I did it twice to create two additional partitions.<\/p>\n<p><a href=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part5.jpg\" rel=\"attachment wp-att-4733\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4733\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part5-300x205.jpg\" alt=\"part5\" width=\"424\" height=\"290\" srcset=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part5-300x205.jpg 300w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part5-768x525.jpg 768w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part5.jpg 773w\" sizes=\"auto, (max-width: 424px) 100vw, 424px\" \/><\/a><\/p>\n<p><strong>Step 5:<\/strong><\/p>\n<p><em>So far, no actual changes have been made on your hard drive. If you want to restart the partitioning just rerun the gparted tool.<\/em><\/p>\n<p>To write the changes to the HDD hit the green tick symbol.<br \/>\nAfter hitting the tick, a warning will appear saying that you can lose all data &#8211; you should have a <strong>backup<\/strong>, so no worries.<\/p>\n<p><a href=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part6.jpg\" rel=\"attachment wp-att-4734\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4734\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part6-300x204.jpg\" alt=\"part6\" width=\"488\" height=\"332\" srcset=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part6-300x204.jpg 300w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part6-768x521.jpg 768w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part6.jpg 778w\" sizes=\"auto, (max-width: 488px) 100vw, 488px\" \/><\/a><\/p>\n<p>The application should start performing several tasks, just wait until it has finished.<\/p>\n<p><em>Depending on the size of the partition and the data stored on it, this will take its time.<\/em><\/p>\n<p><a href=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part7.jpg\" rel=\"attachment wp-att-4735\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4735\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part7-300x223.jpg\" alt=\"part7\" width=\"496\" height=\"369\" srcset=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part7-300x223.jpg 300w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/04\/part7.jpg 729w\" sizes=\"auto, (max-width: 496px) 100vw, 496px\" \/><\/a><\/p>\n<p><strong>Additonal Step for LVM :<\/strong><\/p>\n<p>For LVM it is necessary to not only extend the size of the LVM partition, but also to extend the size of the Volume &#8211; in this scenario we are going to extend the &#8220;root&#8221; Volume.<\/p>\n<p>If you\u2019re not sure about your admin rights, always enter the command sudo -i at the beginning of every session:<\/p>\n<blockquote><p>sudo -i<\/p><\/blockquote>\n<p>This command will grant you the rights of a power user, so you don\u2019t have to write the command sudo at the beginning of every command line. Now-<\/p>\n<p>Connect via SSH and perform the following additional steps :<\/p>\n<p>1. Bring online the LV<\/p>\n<blockquote><p>root@contabo-test:~# lvchange -a y cos<\/p><\/blockquote>\n<p>2. Print the available (free) storage capacity within the LVM, in this case it is 300 GB<\/p>\n<blockquote><p>root@contabo-test:~# vgs<\/p>\n<p><em>VG #PV #LV #SN Attr VSize VFree<\/em><br \/>\n<em> cos 1 1 0 wz&#8211;n- 599.02g 300.00g<\/em><\/p><\/blockquote>\n<p>3. Extend the volume to use 100% of the available storage capacity<\/p>\n<blockquote><p>root@contabo-test:~# lvextend \/dev\/cos\/root -l +100%FREE<br \/>\nSize of logical volume cos\/root changed from 300.00 GiB (76800 extents) to 599.02 GiB (153349 extents).<br \/>\nLogical volume root successfully resized.<\/p><\/blockquote>\n<p><strong>Step 6:<\/strong><\/p>\n<p>You are done, just boot up your VPS \/VDS into the regular OS\u00a0 and check if everything is as expected:<\/p>\n<blockquote><p>root@contabo-test:~# fdisk -l<\/p><\/blockquote>\n<div id=\"windows\"><strong>Windows<\/strong><\/div>\n<hr \/>\n<p><strong>Step 1:<\/strong><\/p>\n<p>Connect to your server using RDP.<\/p>\n<p><strong>Step 2:<\/strong><\/p>\n<p>Open the &#8220;Disk Management&#8221;, this can be done with a right click on the Windows Icon on the lower left side.<br \/>\nYou could also start it by opening the &#8220;run&#8221; prompt, which can be done\u00a0 via &#8220;Start&#8221; -&gt; &#8220;Execute&#8221; -&gt; &#8220;diskmgmt.msc&#8221;, alternately the &#8220;Execute&#8221; dialogue can be opened by hitting &#8220;Windows-Logo-Key +R&#8221;<\/p>\n<p><a href=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/05\/winp1_en.jpg\" rel=\"attachment wp-att-3867\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3867\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/05\/winp1_en-300x166.jpg\" alt=\"winp1_en\" width=\"383\" height=\"212\" srcset=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/05\/winp1_en-300x166.jpg 300w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/05\/winp1_en.jpg 768w\" sizes=\"auto, (max-width: 383px) 100vw, 383px\" \/><\/a><br \/>\n<strong> Step 3:<\/strong><\/p>\n<p>After the Windows &#8220;Disk Management&#8221; utility was started you will see an overview of all installed harddrives.<br \/>\nOn a VPS \/ VDS you will usually have one drive, on a dedicated Server you will probably have more than one sparse disk.<br \/>\nSearch for the disk you want to repartition and perform a right click on the partition you want to resize.<\/p>\n<blockquote><p><em>You can shrink and also extend a Volume, sometimes when upgrading your VPS \/ VDS to a bigger plan you can either create a second partition or just extend the existing partition.<\/em><\/p><\/blockquote>\n<p>For now we want to shrink the existing partition, so we hit &#8220;Shrink Volume&#8221;.<\/p>\n<p><a href=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/05\/winp2_en.jpg\" rel=\"attachment wp-att-3868\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3868\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/05\/winp2_en-300x252.jpg\" alt=\"winp2_en\" width=\"385\" height=\"323\" srcset=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/05\/winp2_en-300x252.jpg 300w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/05\/winp2_en.jpg 719w\" sizes=\"auto, (max-width: 385px) 100vw, 385px\" \/><\/a><br \/>\n<strong> Step 4:<\/strong><\/p>\n<p>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 &#8220;shrink&#8221;.<\/p>\n<p><a href=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/05\/winp3_en.jpg\" rel=\"attachment wp-att-3865\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3865\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/05\/winp3_en-300x196.jpg\" alt=\"winp3_en\" width=\"384\" height=\"251\" srcset=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/05\/winp3_en-300x196.jpg 300w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/05\/winp3_en.jpg 464w\" sizes=\"auto, (max-width: 384px) 100vw, 384px\" \/><\/a><\/p>\n<p>After shrinking you will have unallocated space, now you are ready to create a new partition, e.g. a FAT32 filesystem etc.<\/p>\n<p><a href=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/05\/winp4_en.jpg\" rel=\"attachment wp-att-3866\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3866\" src=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/05\/winp4_en-300x52.jpg\" alt=\"winp4_en\" width=\"381\" height=\"66\" srcset=\"https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/05\/winp4_en-300x52.jpg 300w, https:\/\/contabo.com\/blog\/wp-content\/uploads\/2016\/05\/winp4_en.jpg 605w\" sizes=\"auto, (max-width: 381px) 100vw, 381px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes, it is necessary to change your partition layout in order to create new partitions or extend an existing partition, for example after a VPS \/ VDS upgrade. This tutorial shows how to easily change your partition layout on your VPS or VDS. Please be advised to perform a backup of all important data before [&hellip;]<\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[18],"tags":[81,181,404,510,735,845,881,894,905,941],"ppma_author":[1493],"class_list":["post-3806","post","type-post","status-publish","format-standard","hentry","category-tutorials","tag-assistance","tag-contabo","tag-hard-disk","tag-linux","tag-server","tag-tutorial","tag-virtual-server","tag-vps","tag-vserver","tag-windows"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Gianni-Donato","author_link":"https:\/\/contabo.com\/blog\/author\/gianni-donato\/"},"uagb_comment_info":0,"uagb_excerpt":"Sometimes, it is necessary to change your partition layout in order to create new partitions or extend an existing partition, for example after a VPS \/ VDS upgrade. This tutorial shows how to easily change your partition layout on your VPS or VDS. Please be advised to perform a backup of all important data before&hellip;","authors":[{"term_id":1493,"user_id":17,"is_guest":0,"slug":"gianni-donato","display_name":"Gianni-Donato","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/4457fc8553ead9a4e1e3d5b4a940590df9bad9d9132e58e40df3894b99bbe5d0?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/posts\/3806","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/comments?post=3806"}],"version-history":[{"count":0,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/posts\/3806\/revisions"}],"wp:attachment":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/media?parent=3806"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/categories?post=3806"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/tags?post=3806"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=3806"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}