{"id":34507,"date":"2024-12-03T05:46:14","date_gmt":"2024-12-03T05:46:14","guid":{"rendered":"https:\/\/green.cloud\/docs\/?post_type=docs&#038;p=34507"},"modified":"2026-02-25T08:19:33","modified_gmt":"2026-02-25T08:19:33","slug":"how-to-create-and-expand-a-volume-group-in-linux","status":"publish","type":"docs","link":"https:\/\/green.cloud\/docs\/greencloud-documents\/linux-operating-systems\/how-to-create-and-expand-a-volume-group-in-linux\/","title":{"rendered":"How to Create and Expand a Volume Group in Linux"},"content":{"rendered":"<p data-pm-slice=\"1 1 []\">Managing storage in Linux is crucial for system administrators. In this guide, we&#8217;ll walk through the process of creating a volume group from a partition and then expanding it by adding a new partition. This is particularly useful for managing dynamic storage needs and efficiently using available disk space.<\/p>\n<p>For this guide, we will use a sample VPS with the following disk configuration:<\/p>\n<pre><code>[root@luminous-draft ~]# fdisk -l\r\nDisk \/dev\/vda: 20 GiB, 21474836480 bytes, 41943040 sectors\r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisklabel type: gpt\r\nDisk identifier: C8F3EA69-6D03-4D04-B932-B0EC3C79743C\r\n\r\nDevice      Start      End  Sectors  Size Type\r\n\/dev\/vda1    2048     4095     2048    1M BIOS boot\r\n\/dev\/vda2    4096   266239   262144  128M EFI System\r\n\/dev\/vda3  266240 41943006 41676767 19.9G Linux filesystem\r\n\r\n\r\nDisk \/dev\/vdb: 500 GiB, 536870912000 bytes, 1048576000 sectors\r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\n\r\n\r\nDisk \/dev\/vdc: 500 GiB, 536870912000 bytes, 1048576000 sectors\r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes<\/code><\/pre>\n<p>In this setup, we have:<\/p>\n<ul data-spread=\"false\">\n<li><code>\/dev\/vda<\/code> (20 GiB) as the main system disk.<\/li>\n<li><code>\/dev\/vdb<\/code> (500 GiB) and <code>\/dev\/vdc<\/code> (500 GiB) which will be used to create and expand our volume group.<\/li>\n<\/ul>\n<h3>Step 1: Install LVM2<\/h3>\n<p>Before proceeding with creating a volume group, make sure that <code>lvm2<\/code> is installed on your system. If the <code>pvcreate<\/code> command is not found, you need to install <code>lvm2<\/code>.<\/p>\n<h4>1.1 Install LVM2<\/h4>\n<p>To install <code>lvm2<\/code>, run the following command depending on your Linux distribution:<\/p>\n<ul data-spread=\"false\">\n<li><strong>On CentOS\/RHEL\/Fedora<\/strong>:\n<pre><code>yum install lvm2<\/code><\/pre>\n<\/li>\n<li><strong>On Ubuntu\/Debian<\/strong>:\n<pre><code>apt-get install lvm2<\/code><\/pre>\n<\/li>\n<\/ul>\n<p>Once installed, verify the installation by running:<\/p>\n<pre><code>pvcreate --version<\/code><\/pre>\n<p>This should display the version of <code>pvcreate<\/code>, confirming that <code>lvm2<\/code> is installed successfully.<\/p>\n<h3>Step 2: Create a Volume Group from a Partition<\/h3>\n<p>To begin, we need to create a volume group from an existing partition. In this example, we assume you have a disk <code>\/dev\/vdb<\/code> with 500 GiB that you want to use.<\/p>\n<h4>2.1 Create a Physical Volume (PV)<\/h4>\n<p>The first step is to create a Physical Volume (PV) from the disk. This PV will later be used to create a volume group.<\/p>\n<p>Run the following command:<\/p>\n<pre><code>pvcreate \/dev\/vdb<\/code><\/pre>\n<p>This command initializes the disk so that it can be used in a volume group.<\/p>\n<h4>2.2 Create a Volume Group (VG)<\/h4>\n<p>Now, create a volume group from the physical volume you just created. Let&#8217;s call the volume group <code>vg_data<\/code>:<\/p>\n<pre><code>vgcreate vg_data \/dev\/vdb<\/code><\/pre>\n<p>This command creates the volume group <code>vg_data<\/code>, which now contains the physical volume <code>\/dev\/vdb<\/code>.<\/p>\n<h4>2.3 Create a Logical Volume (LV)<\/h4>\n<p>Next, create a logical volume within the volume group. Let&#8217;s name it <code>lv_data<\/code> and use the entire available space:<\/p>\n<pre><code>lvcreate -n lv_data -l 100%FREE vg_data<\/code><\/pre>\n<p>This command creates the logical volume <code>lv_data<\/code> within the volume group <code>vg_data<\/code> using all available space.<\/p>\n<h4>2.4 Format and Mount the Logical Volume<\/h4>\n<p>After creating the logical volume, format it with a file system, such as <code>ext4<\/code>:<\/p>\n<pre><code>mkfs.ext4 \/dev\/vg_data\/lv_data<\/code><\/pre>\n<p>Then, create a directory where the volume will be mounted, and mount it:<\/p>\n<pre><code>mkdir \/data\r\nmount \/dev\/vg_data\/lv_data \/data<\/code><\/pre>\n<p>To ensure the volume is automatically mounted after reboot, add an entry to <code>\/etc\/fstab<\/code>:<\/p>\n<pre><code>\/dev\/vg_data\/lv_data \/data ext4 defaults 0 0<\/code><\/pre>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\" wp-image-34519 aligncenter\" src=\"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2024\/12\/Screenshot_2-300x80.jpg\" alt=\"\" width=\"750\" height=\"200\" srcset=\"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2024\/12\/Screenshot_2-300x80.jpg 300w, https:\/\/green.cloud\/docs\/wp-content\/uploads\/2024\/12\/Screenshot_2-768x205.jpg 768w, https:\/\/green.cloud\/docs\/wp-content\/uploads\/2024\/12\/Screenshot_2-20x5.jpg 20w, https:\/\/green.cloud\/docs\/wp-content\/uploads\/2024\/12\/Screenshot_2-32x9.jpg 32w, https:\/\/green.cloud\/docs\/wp-content\/uploads\/2024\/12\/Screenshot_2.jpg 922w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/p>\n<h3>Step 3: Expand the Volume Group with a New Partition<\/h3>\n<p>After some time, you may find that your storage needs have increased, and you need more space. Fortunately, Logical Volume Management (LVM) makes it easy to expand existing storage by adding new partitions.<\/p>\n<h4>3.1 Create a Physical Volume from the New Disk<\/h4>\n<p>Suppose you have a new disk <code>\/dev\/vdc<\/code> with 500 GiB that you want to add to the existing volume group.<\/p>\n<p>First, create a physical volume from the new disk:<\/p>\n<pre><code>pvcreate \/dev\/vdc<\/code><\/pre>\n<p>This command initializes the new disk so that it can be added to a volume group.<\/p>\n<h4>3.2 Add the New Physical Volume to the Volume Group<\/h4>\n<p>Now, add the newly created physical volume to the existing volume group <code>vg_data<\/code>:<\/p>\n<pre><code>vgextend vg_data \/dev\/vdc<\/code><\/pre>\n<p>This command extends the volume group <code>vg_data<\/code> to include the new physical volume <code>\/dev\/vdc<\/code>.<\/p>\n<h4>3.3 Extend the Logical Volume<\/h4>\n<p>After expanding the volume group, the next step is to extend the logical volume to use the newly added space:<\/p>\n<pre><code>lvextend -l +100%FREE \/dev\/vg_data\/lv_data<\/code><\/pre>\n<p>This command extends the logical volume <code>lv_data<\/code> to use all of the free space available in the volume group.<\/p>\n<h4>3.4 Resize the File System<\/h4>\n<p>Finally, you need to resize the file system so that it can utilize the newly added space. Depending on the file system, use the appropriate command:<\/p>\n<ul data-spread=\"false\">\n<li>For <code>ext4<\/code>:\n<pre><code>resize2fs \/dev\/vg_data\/lv_data<\/code><\/pre>\n<\/li>\n<li>For <code>xfs<\/code>:\n<pre><code>xfs_growfs \/dev\/vg_data\/lv_data<\/code><\/pre>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"alignnone wp-image-34523 aligncenter\" src=\"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2024\/12\/Screenshot_3-300x89.jpg\" alt=\"\" width=\"607\" height=\"180\" srcset=\"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2024\/12\/Screenshot_3-300x89.jpg 300w, https:\/\/green.cloud\/docs\/wp-content\/uploads\/2024\/12\/Screenshot_3-768x228.jpg 768w, https:\/\/green.cloud\/docs\/wp-content\/uploads\/2024\/12\/Screenshot_3-20x6.jpg 20w, https:\/\/green.cloud\/docs\/wp-content\/uploads\/2024\/12\/Screenshot_3-32x10.jpg 32w, https:\/\/green.cloud\/docs\/wp-content\/uploads\/2024\/12\/Screenshot_3.jpg 818w\" sizes=\"(max-width: 607px) 100vw, 607px\" \/><\/p>\n<h3>Conclusion<\/h3>\n<p>Managing storage with Logical Volume Management (LVM) in Linux is a powerful way to handle dynamic storage requirements. By following these steps, you can easily create a volume group, add logical volumes, and expand them as your storage needs grow. This approach allows you to efficiently allocate disk space and avoid the need for disruptive reconfigurations in the future.<\/p>\n<p>Whether you&#8217;re managing a personal server or an enterprise environment, understanding how to create and expand volume groups is an essential skill for ensuring your systems have the storage they need.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Managing storage in Linux is crucial for system administrators. In this guide, we&#8217;ll walk through the process of creating a volume group from a partition and then expanding it by adding a new partition. This is particularly useful for managing dynamic storage needs and efficiently using available disk space. For this guide, we will use [&hellip;]<\/p>\n","protected":false},"author":21,"featured_media":0,"parent":17817,"menu_order":212,"comment_status":"closed","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-34507","docs","type-docs","status-publish","hentry","no-post-thumbnail"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Create and Expand a Volume Group in Linux - GreenCloud Documentation<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/green.cloud\/docs\/greencloud-documents\/linux-operating-systems\/how-to-create-and-expand-a-volume-group-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create and Expand a Volume Group in Linux - GreenCloud Documentation\" \/>\n<meta property=\"og:description\" content=\"Managing storage in Linux is crucial for system administrators. In this guide, we&#8217;ll walk through the process of creating a volume group from a partition and then expanding it by adding a new partition. This is particularly useful for managing dynamic storage needs and efficiently using available disk space. For this guide, we will use [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/green.cloud\/docs\/greencloud-documents\/linux-operating-systems\/how-to-create-and-expand-a-volume-group-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"GreenCloud Documentation\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-25T08:19:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2024\/12\/Screenshot_2.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"922\" \/>\n\t<meta property=\"og:image:height\" content=\"246\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/greencloud-documents\\\/linux-operating-systems\\\/how-to-create-and-expand-a-volume-group-in-linux\\\/\",\"url\":\"https:\\\/\\\/green.cloud\\\/docs\\\/greencloud-documents\\\/linux-operating-systems\\\/how-to-create-and-expand-a-volume-group-in-linux\\\/\",\"name\":\"How to Create and Expand a Volume Group in Linux - GreenCloud Documentation\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/greencloud-documents\\\/linux-operating-systems\\\/how-to-create-and-expand-a-volume-group-in-linux\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/greencloud-documents\\\/linux-operating-systems\\\/how-to-create-and-expand-a-volume-group-in-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/green.cloud\\\/docs\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/Screenshot_2-300x80.jpg\",\"datePublished\":\"2024-12-03T05:46:14+00:00\",\"dateModified\":\"2026-02-25T08:19:33+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/greencloud-documents\\\/linux-operating-systems\\\/how-to-create-and-expand-a-volume-group-in-linux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/green.cloud\\\/docs\\\/greencloud-documents\\\/linux-operating-systems\\\/how-to-create-and-expand-a-volume-group-in-linux\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/greencloud-documents\\\/linux-operating-systems\\\/how-to-create-and-expand-a-volume-group-in-linux\\\/#primaryimage\",\"url\":\"https:\\\/\\\/green.cloud\\\/docs\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/Screenshot_2.jpg\",\"contentUrl\":\"https:\\\/\\\/green.cloud\\\/docs\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/Screenshot_2.jpg\",\"width\":922,\"height\":246},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/greencloud-documents\\\/linux-operating-systems\\\/how-to-create-and-expand-a-volume-group-in-linux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/green.cloud\\\/docs\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"GreenCloud Documents\",\"item\":\"https:\\\/\\\/green.cloud\\\/docs\\\/docs\\\/greencloud-documents\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Linux Operating Systems\",\"item\":\"https:\\\/\\\/green.cloud\\\/docs\\\/linux-operating-systems\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"How to Create and Expand a Volume Group in Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/green.cloud\\\/docs\\\/#website\",\"url\":\"https:\\\/\\\/green.cloud\\\/docs\\\/\",\"name\":\"GreenCloud Documentation\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/green.cloud\\\/docs\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create and Expand a Volume Group in Linux - GreenCloud Documentation","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/green.cloud\/docs\/greencloud-documents\/linux-operating-systems\/how-to-create-and-expand-a-volume-group-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"How to Create and Expand a Volume Group in Linux - GreenCloud Documentation","og_description":"Managing storage in Linux is crucial for system administrators. In this guide, we&#8217;ll walk through the process of creating a volume group from a partition and then expanding it by adding a new partition. This is particularly useful for managing dynamic storage needs and efficiently using available disk space. For this guide, we will use [&hellip;]","og_url":"https:\/\/green.cloud\/docs\/greencloud-documents\/linux-operating-systems\/how-to-create-and-expand-a-volume-group-in-linux\/","og_site_name":"GreenCloud Documentation","article_modified_time":"2026-02-25T08:19:33+00:00","og_image":[{"width":922,"height":246,"url":"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2024\/12\/Screenshot_2.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/green.cloud\/docs\/greencloud-documents\/linux-operating-systems\/how-to-create-and-expand-a-volume-group-in-linux\/","url":"https:\/\/green.cloud\/docs\/greencloud-documents\/linux-operating-systems\/how-to-create-and-expand-a-volume-group-in-linux\/","name":"How to Create and Expand a Volume Group in Linux - GreenCloud Documentation","isPartOf":{"@id":"https:\/\/green.cloud\/docs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/green.cloud\/docs\/greencloud-documents\/linux-operating-systems\/how-to-create-and-expand-a-volume-group-in-linux\/#primaryimage"},"image":{"@id":"https:\/\/green.cloud\/docs\/greencloud-documents\/linux-operating-systems\/how-to-create-and-expand-a-volume-group-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2024\/12\/Screenshot_2-300x80.jpg","datePublished":"2024-12-03T05:46:14+00:00","dateModified":"2026-02-25T08:19:33+00:00","breadcrumb":{"@id":"https:\/\/green.cloud\/docs\/greencloud-documents\/linux-operating-systems\/how-to-create-and-expand-a-volume-group-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/green.cloud\/docs\/greencloud-documents\/linux-operating-systems\/how-to-create-and-expand-a-volume-group-in-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/green.cloud\/docs\/greencloud-documents\/linux-operating-systems\/how-to-create-and-expand-a-volume-group-in-linux\/#primaryimage","url":"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2024\/12\/Screenshot_2.jpg","contentUrl":"https:\/\/green.cloud\/docs\/wp-content\/uploads\/2024\/12\/Screenshot_2.jpg","width":922,"height":246},{"@type":"BreadcrumbList","@id":"https:\/\/green.cloud\/docs\/greencloud-documents\/linux-operating-systems\/how-to-create-and-expand-a-volume-group-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/green.cloud\/docs\/"},{"@type":"ListItem","position":2,"name":"GreenCloud Documents","item":"https:\/\/green.cloud\/docs\/docs\/greencloud-documents\/"},{"@type":"ListItem","position":3,"name":"Linux Operating Systems","item":"https:\/\/green.cloud\/docs\/linux-operating-systems\/"},{"@type":"ListItem","position":4,"name":"How to Create and Expand a Volume Group in Linux"}]},{"@type":"WebSite","@id":"https:\/\/green.cloud\/docs\/#website","url":"https:\/\/green.cloud\/docs\/","name":"GreenCloud Documentation","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/green.cloud\/docs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/docs\/34507","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/comments?post=34507"}],"version-history":[{"count":9,"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/docs\/34507\/revisions"}],"predecessor-version":[{"id":35061,"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/docs\/34507\/revisions\/35061"}],"up":[{"embeddable":true,"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/docs\/17817"}],"wp:attachment":[{"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/media?parent=34507"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/green.cloud\/docs\/wp-json\/wp\/v2\/doc_tag?post=34507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}