{"id":2599,"date":"2020-04-08T01:05:06","date_gmt":"2020-04-08T01:05:06","guid":{"rendered":"https:\/\/wiki.thomasandsofia.com\/?p=2599"},"modified":"2020-07-20T16:19:07","modified_gmt":"2020-07-20T16:19:07","slug":"lvm-commands","status":"publish","type":"post","link":"https:\/\/wiki.thomasandsofia.com\/?p=2599","title":{"rendered":"LVM Commands"},"content":{"rendered":"<h1>Physical Volume Commands<\/h1>\n<h4>Display the Physical Volumes<\/h4>\n<ul>\n<li>Physical volumes will not show until they have been added to a Volume Group!<\/li>\n<\/ul>\n<pre>pvdisplay \/dev\/sdx<\/pre>\n<p>&nbsp;<\/p>\n<h4>Physical Volumes Show (Short?)<\/h4>\n<pre>pvs<\/pre>\n<p>&nbsp;<\/p>\n<h1>Volume Group Commands<\/h1>\n<h4>Create Volume Groups<\/h4>\n<pre>vgcreate &lt;groupName&gt; \/dev\/sdx1 \/dev\/sdx2 ...<\/pre>\n<p>&nbsp;<\/p>\n<h4>Display Volume Groups<\/h4>\n<pre>vgdisplay &lt;-v&gt; &lt;\/dev\/GROUPNAME&gt;<\/pre>\n<p>-v: Show Physical Volume information<\/p>\n<p>&nbsp;<\/p>\n<h4>Volume Group Show (Short?)<\/h4>\n<p>Limited display of all available volume groups<\/p>\n<pre>vgs<\/pre>\n<p>&nbsp;<\/p>\n<h4>Create Logical Volumes<\/h4>\n<pre>lvcreate -L NNGB -n LOG-VOL-NAME VOL-GROUP-NAME &lt;START-DISK&gt;&lt;:EXTENTS-RANGE&gt; &lt;NEXT-DISK&gt;&lt;:EXTENTS-RANGE&gt;\r\nlvcreate -L 50GB -n lvlab \/dev\/myvolgroup<\/pre>\n<p>-L: Size in MB, GB, TB<br \/>\n-l (lower case): Size in PE<br \/>\n-n: Name<br \/>\n-v, -vv, -vvv, -vvvv:<\/p>\n<ul>\n<li>Increasing amount of displayed detail<\/li>\n<li>Must be at the end of the command?\n<ul>\n<li>lvcreate -L NNGB -n LOG-VOL-NAME VOL-GROUP-NAME -vv<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&lt;START-DISK&gt;: Optional<\/p>\n<ul>\n<li>Define which PVs to take space from.<\/li>\n<li>You can define multiple disks.\u00a0 If you do not define HOW to share the disk space taken, it will split it evenly. (See &lt;EXTENTS-RANGE&gt; below)<\/li>\n<\/ul>\n<pre>lvcreate -l 5000 -n lvlab \/dev\/myvolgroup \/dev\/sdc2<\/pre>\n<p>&lt;START-DISK&gt;&lt;:EXTENTS-RANGE&gt;: Optional define the range of extents to take from each designated disk<\/p>\n<pre>lvcreate -l 50 -n lvlab \/dev\/myvolgroup \/dev\/sdc2:0-24 \/dev\/sdc3:50-74\r\nlvcreate -l 50 -n lvlab \/dev\/myvolgroup \/dev\/sdc2:0-24:200-<\/pre>\n<p>* In the last example all remaining space required will be taken from extent 200 onward.<\/p>\n<h4>Display Logical Volume Information<\/h4>\n<pre>lvdisplay \/dev\/VOL-GROUP-NAME\/LOG-VOL-NAME<\/pre>\n<p>&nbsp;<\/p>\n<h4>Logical Volume Show (Short?)<\/h4>\n<p>Limited display of all available logical volumes<\/p>\n<pre>lvs<\/pre>\n<p>&nbsp;<\/p>\n<h4>Remove a Logical Volume<\/h4>\n<pre>lvremove \/dev\/VOL-GROUP-NAME\/LOG-VOL-NAME<\/pre>\n<p>This process will be difficult if the volume is in use.<\/p>\n<p>6:00<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Physical Volume Commands Display the Physical Volumes Physical volumes will not show until they have been added to a Volume Group! pvdisplay \/dev\/sdx &nbsp; Physical Volumes Show (Short?) pvs &nbsp; Volume Group Commands Create Volume Groups vgcreate &lt;groupName&gt; \/dev\/sdx1 \/dev\/sdx2 &#8230; &nbsp; Display Volume Groups vgdisplay &lt;-v&gt; &lt;\/dev\/GROUPNAME&gt; -v: Show Physical Volume information &nbsp; Volume ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/wiki.thomasandsofia.com\/?p=2599\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56],"tags":[],"class_list":["post-2599","post","type-post","status-publish","format-standard","hentry","category-logical-volume-manager"],"_links":{"self":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/2599","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2599"}],"version-history":[{"count":7,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/2599\/revisions"}],"predecessor-version":[{"id":3086,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/2599\/revisions\/3086"}],"wp:attachment":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2599"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2599"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2599"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}