{"id":421,"date":"2014-06-19T03:49:21","date_gmt":"2014-06-19T03:49:21","guid":{"rendered":"http:\/\/www.incredigeek.com\/home\/?p=421"},"modified":"2022-10-24T15:07:16","modified_gmt":"2022-10-24T20:07:16","slug":"how-to-create-a-lvm-logical-volume-in-linux","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/how-to-create-a-lvm-logical-volume-in-linux\/","title":{"rendered":"How to Create a LVM Logical Volume in Linux"},"content":{"rendered":"<p>First we need to create the Physical Volume.\u00a0 Change &#8220;\/dev\/sda2&#8221; to your drive.<\/p>\n<pre>pvcreate \/dev\/sda2<\/pre>\n<p>Next we create the Volume Group.\u00a0 You can change &#8220;VGname&#8221; to something else if you so desire.<\/p>\n<pre>vgcreate VGname \/dev\/sda2<\/pre>\n<p>And finally, create the Logical Volume.\u00a0 The Logical Volume&#8217;s name will be home.\u00a0 Change as needed.<\/p>\n<pre>lvcreate -l %100FREE -n home VGname\n<\/pre>\n<p>The above command will create a Logical Volume that uses all the free space avaliable in the Volume Group.\u00a0 If you want the Logical Volume to be a specific size,\u00a0 change &#8220;-l 100%FREE&#8221; to &#8220;-L 60G&#8221;.\u00a0 Where &#8220;60G&#8221; is the size in GB.<br \/>\nExample:<\/p>\n<pre>lvcreate -L 60G -n home VGname<\/pre>\n<p>Your Logical Volume should be setup now.\u00a0 You can list all your Logical Volumes with<\/p>\n<pre>lvdisplay<\/pre>\n<p>You may need to format the new logical volume to mount it.\u00a0 Replace VGname and LVname for the Volume Group name and the Logical Volume name.<\/p>\n<pre>mkfs.ext4 \/dev\/VGname\/LVname<\/pre>\n<p>Mount it with<\/p>\n<pre>mount \/dev\/VGname\/LVname \/mount\/point<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>First we need to create the Physical Volume.\u00a0 Change &#8220;\/dev\/sda2&#8221; to your drive. pvcreate \/dev\/sda2 Next we create the Volume Group.\u00a0 You can change &#8220;VGname&#8221; to something else if you so desire. vgcreate VGname \/dev\/sda2 And finally, create the Logical &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/how-to-create-a-lvm-logical-volume-in-linux\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[7,149,150,148],"class_list":["post-421","post","type-post","status-publish","format-standard","hentry","category-linux","tag-linux-2","tag-logical-volume","tag-logical-volume-manager","tag-lvm"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/421","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=421"}],"version-history":[{"count":8,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/421\/revisions"}],"predecessor-version":[{"id":4607,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/421\/revisions\/4607"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}