{"id":987,"date":"2020-08-07T23:45:01","date_gmt":"2020-08-07T23:45:01","guid":{"rendered":"http:\/\/www.tech-g.com\/?p=987"},"modified":"2020-08-07T23:46:54","modified_gmt":"2020-08-07T23:46:54","slug":"987","status":"publish","type":"post","link":"https:\/\/www.voodoo.business\/blog\/2020\/08\/07\/987\/","title":{"rendered":"Quick 10 minute LVM Setup."},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>Sometimes, you realize you would want to use LVM in a computer but you want a tutorial to take you there fast, So i have put this post together to get you up and running in 10 minutes or less.<\/p>\n\n\n\n<p>First, let us start with the tools, install the following packages in your debian installation, (Debian 10-Buster in this tutorial)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt-get install lvm2 dmsetup mdadm reiserfsprogs xfsprogs<\/pre>\n\n\n\n<p>In this tutorial, I have two 8TB disks i want to combine with LVM to use as one<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1- Create partitions of type LVM on the disks<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Why not use the disk without a partition ? See this post<\/li><\/ul>\n\n\n\n<p>Start by running parted on every physical disk, and creating a big partition to span the whole disk (Or if you are using empty spaces on old disks, any partition is good enough really)<\/p>\n\n\n\n<p>In my example, where i wish to combine \/dev\/sdb and \/dev\/sdc into one logical volume (To be used as one block)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">parted \/dev\/sdb<br>mklabel gpt<br>unit mib<br>mkpart primary ext4 1 100%<br>set 1 lvm on<\/pre>\n\n\n\n<p>Now, repeat the above, but this time for \/dev\/sdc<\/p>\n\n\n\n<p>1- Prepare the physical volumes to be added to volume groups (those two partitions) (For instructions on how to add disks directly without an underlying partition which is not recommended, see here)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">pvcreate \/dev\/sdb1 \/dev\/sdc1<\/pre>\n\n\n\n<p>Now, you can see what we have with the commands<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">pvdisplay or pvs<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">2- Add the PVs to a logical volume<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">vgcreate LVMGroup \/dev\/sdb1 \/dev\/sdc1\n   Volume group \"LVMGroup\" successfully created<\/pre>\n\n\n\n<p>this will create a volume group (VG) called LVMGroup, you can see the VGs you have with the commands (vgdisplay, vgscan, and vgs)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">vgs -o +lv_size,lv_name<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">3- Create a logical group on the volume group<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">lvcreate -l 100%FREE -n bigvol LVMGroup\n  Logical volume \"bigvol\" created.<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">mkfs.ext4 \/dev\/LVMGroup\/bigvol\nor\nmkfs.ext4 \/dev\/mapper\/LVMGroup-bigvol<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">4- Mount, and add to fstab<\/h2>\n\n\n\n<p>To mount the volume, My mount point is at \/hds\/lvm<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes, you realize you would want to use LVM in a computer but you want a tutorial to take you there fast, So i have put this post together to get you up and running in 10 minutes or less. First, let us start with the tools, install the following packages in your debian installation, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-987","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/987","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/comments?post=987"}],"version-history":[{"count":3,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/987\/revisions"}],"predecessor-version":[{"id":990,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/987\/revisions\/990"}],"wp:attachment":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/media?parent=987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/categories?post=987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/tags?post=987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}