{"id":319,"date":"2009-06-18T23:07:38","date_gmt":"2009-06-18T23:07:38","guid":{"rendered":"http:\/\/blog.cyberwizzard.nl\/?p=319"},"modified":"2016-03-20T16:41:28","modified_gmt":"2016-03-20T15:41:28","slug":"growing-lvm-storage","status":"publish","type":"post","link":"https:\/\/blog.cyberwizzard.nl\/?p=319","title":{"rendered":"Growing LVM storage"},"content":{"rendered":"<p>After adding some new storage to the backup system at work, I\u00a0needed a way to transfer the roughly 400GB\u00a0of backups to the new installation &#8211; without the use of a USB\u00a0disk or another server (would take way too long). So after installing CentOS\u00a05.3 with LVM2 enabled, I\u00a0dedicated the better part of 1TB\u00a0to the new backup storage on the new hard drive.<\/p>\n<p>After mounting the old storage, I\u00a0copied the old archives to the new LVM storage and did the following.<\/p>\n<h2 id=\"post-319-prepping-partition-for-lvm\">Prepping partition for LVM <a class=\"heading-link\" href=\"https:\/\/blog.cyberwizzard.nl\/?p=319#prepping-partition-for-lvm\" title=\"Link to this section\">&#8734;<\/a><\/h2>\n<p>Use fdisk to change the partition type to &#8216;Linux LVM&#8217;, hex code &#8216;8e&#8217;: <code class=\"not-hl\">fdisk \/dev\/sdb<\/code><\/p>\n<p>Then create the structure needed for use with LVM\u00a0on the new partition:\u00a0<code class=\"not-hl\">pvcreate \/dev\/sdb1<\/code><\/p>\n<p>Finally, add the new LVM\u00a0partition to the LVM caches by letting the automated scan picking it up:\u00a0<code class=\"not-hl\">vgscan<\/code><\/p>\n<p>Now to actually append the new partition to the storage pool: <code class=\"not-hl\">vgextend VolGroup00 \/dev\/sdb1<\/code><\/p>\n<h2 id=\"post-319-adding-to-lvm\">Adding to LVM <a class=\"heading-link\" href=\"https:\/\/blog.cyberwizzard.nl\/?p=319#adding-to-lvm\" title=\"Link to this section\">&#8734;<\/a><\/h2>\n<p>If you run <code class=\"not-hl\">vgdisplay<\/code>, you should now see the space you just added as free space in the LVM\u00a0storage pool.<\/p>\n<p>You can now add the free space to one or more storage volumes that need it: <code class=\"not-hl\">lvextend -L +353.5G \/dev\/VolGroup00\/LogVolBackups<\/code><\/p>\n<p>Finally, let the filesystem on the drive resize to fill the new space: <code class=\"not-hl\">resize2fs \/dev\/VolGroup00\/LogVolBackups<\/code><\/p>\n<p>And there we go, 353.5GiB\u00a0added to the LVM2 storage. Now next time I won&#8217;t think twice to use LVM2.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After adding some new storage to the backup system at work, I\u00a0needed a way to transfer the roughly 400GB\u00a0of backups to the new installation &#8211; without the use of a USB\u00a0disk or another server (would take way too long). So after installing CentOS\u00a05.3 with LVM2 enabled, I\u00a0dedicated the better part of 1TB\u00a0to the new backup [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[305,367,253,366],"class_list":["post-319","post","type-post","status-publish","format-standard","hentry","category-linux-gentoolinux","tag-centos","tag-hardware","tag-linux","tag-lvm"],"views":1447,"_links":{"self":[{"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/posts\/319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=319"}],"version-history":[{"count":3,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/posts\/319\/revisions"}],"predecessor-version":[{"id":581,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/posts\/319\/revisions\/581"}],"wp:attachment":[{"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}