User Tools

Site Tools


creating_lvms

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
creating_lvms [2015/11/23 09:31] luke7858creating_lvms [2024/05/23 07:26] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +==== Physical Volume Create ====
 +First we need to put markers on the devices that will be used to create the volume groups:
 +<sxh bash>
 +pvcreate /dev/device1 /dev/device2 /dev/device3
 +</sxh>
 +\\
 ==== Creating Volume Groups ==== ==== Creating Volume Groups ====
-Below is the command used to create a volume group from one or more physical volumes. +Now we need to create a volume group: Below is the command used to create a volume group from one or more physical volumes. 
 <sxh bash> <sxh bash>
-vgcreate vg1 /dev/device1 /dev/device2+vgcreate vg1 /dev/device1 /dev/device2 /dev/device3
 </sxh> </sxh>
 When physical volumes are used to create volume group, the disk space is divided into 4mb extents. This means that the logical volumes are increased and decreased by this size.  When physical volumes are used to create volume group, the disk space is divided into 4mb extents. This means that the logical volumes are increased and decreased by this size. 
Line 38: Line 44:
 vgdisplay vgdisplay
 </sxh> </sxh>
 +\\
 +=== Removing Physical Volume from Volume Group ===
 +If you wish to remove a physical device from a volume group you will first need to make sure that the device is not being used. If the device IS being used then you will need to move the data off (pvmove). Below shows an output of a full device. 
 <sxh bash> <sxh bash>
 +pvdisplay /dev/device2 
 +</sxh> 
 +Example output: 
 +<sxh bash> 
 +-- Physical volume --- 
 +PV Name               /dev/device2 
 +VG Name               vg 
 +PV Size               1.95 GB / NOT usable 4 MB [LVM: 122 KB] 
 +PV#                   1 
 +PV Status             available 
 +Allocatable           yes (but full) 
 +Cur LV                1 
 +PE Size (KByte)       4096 
 +Total PE              499 
 +Free PE               0 
 +Allocated PE          499 
 +PV UUID               Sd44tK-9IRw-SrMC-MOkn-76iP-iftz-OVSen7 
 +</sxh> 
 +Once you move off the data you can use vgreduce: 
 +<sxh bash> 
 +vgreduce vg1 /dev/device2 
 +</sxh> 
 +\\ 
 +== Renaming Volume Group == 
 +There are two ways to rename a volume group 
 +<sxh bash> 
 +vgrename /dev/vg02 /dev/my_volume_group 
 +</sxh> 
 +<sxh bash> 
 +vgrename vg02 my_volume_group 
 +</sxh> 
 +\\ 
 +==== Creating a Logical Volume ==== 
 +<sxh bash> 
 +lvcreate -L 20M lvnew vg1
 </sxh> </sxh>
creating_lvms.1448271104.txt.gz · Last modified: 2024/05/23 07:26 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki