linux_wiki:extend_existing_logical_volumes

Differences

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

Link to this comparison view

linux_wiki:extend_existing_logical_volumes [2016/03/03 21:53]
billdozor [Extend Existing Logical Volumes]
linux_wiki:extend_existing_logical_volumes [2019/05/25 23:50]
Line 1: Line 1:
-====== Extend Existing Logical Volumes ====== 
- 
-**General Information** 
- 
-Expanding existing logical volumes non-destructively.  
- 
----- 
- 
-==== Basic LVM Setup ==== 
- 
-**Create single partition on a new disk** 
-<code bash> 
-fdisk /dev/sdb 
-n (new partition) 
-(use defaults) 
-t (change type) 
-8e (Linux LVM) 
-w (write changes and quit) 
-</code> 
- 
-**Create physical volume** 
-<code bash> 
-pvcreate /dev/sdb1 
-pvdisplay 
-</code> 
- 
-**Create volume group** 
-<code bash> 
-vgcreate vglocal /dev/sdb1 
-vgdisplay 
-</code> 
- 
-**Create logical volume** 
-<code bash> 
-lvcreate -n lvstorage -L 20G vglocal 
-lvdisplay 
-</code> 
- 
-**Create XFS Filesystem** 
-<code bash> 
-mkfs -t xfs /dev/vglocal/lvstorage 
-</code> 
- 
-**Mount the volume** 
-<code bash> 
-mkdir -p /mnt/mystorage 
-mount /dev/vglocal/lvstorage /mnt/mystorage 
-</code> 
- 
----- 
- 
-==== Extend a volume group ==== 
- 
-**Create a partition on a new disk** 
-<code bash> 
-gdisk /dev/sdc 
-(same defaults + lvm type change as basic setup) 
-</code> 
- 
-**Create physical volume from created partition** 
-<code bash> 
-pvcreate /dev/sdc1 
-</code> 
- 
-**Extend the "vglocal" volume group and verify** 
-<code bash> 
-vgextend vglocal /dev/sdc1 
-vgdisplay 
-</code> 
- 
----- 
- 
-==== Move physical extents ==== 
- 
-**Move physical extents off /dev/sdb1** 
-<code bash> 
-pvmove /dev/sdb1 
-OR 
-pvmove /dev/sdb1 /dev/sdc1 
-</code> 
- 
-**Remove /dev/sdb1 from volume group** 
-<code bash> 
-vgreduce vglocal /dev/sdb1 
-</code> 
- 
----- 
- 
-==== Extend a logical volume ==== 
- 
-**Extend volume to be 30G in size(from 20G original)** 
-<code bash> 
-lvextend -L 30G /dev/vglocal/lvstorage 
-OR 
-lvextend -L +10G /dev/vglocal/lvstorage 
-</code> 
-  * df -h shows that filesystem still needs to be resized to fill the LV container 
- 
-**Resize the filesystem** 
-<code bash> 
-xfs_growfs /dev/vglocal/lvstorage 
-</code> 
-  * If EXT filesystem, use: resize2fs /dev/vglocal/lvstorage 
- 
----- 
  
  • linux_wiki/extend_existing_logical_volumes.txt
  • Last modified: 2019/05/25 23:50
  • (external edit)