Last active
July 30, 2023 12:48
-
-
Save tonmanna/683460a3be4318e5d9f2b9fe687c20c6 to your computer and use it in GitHub Desktop.
LV PV Linux Extends Drive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://carleton.ca/scs/2019/extend-lvm-disk-space/ | |
Modify (extend) the LVM: | |
Tell LVM the physical partition size has changed: sudo pvresize /dev/vda1 | |
Find the actual path of the LVM logical volume: sudo lvdisplay – The LV Path is the value needed | |
Tell LVM to extend the logical volume to use all of the new partition size: sudo lvextend -l +100%FREE /dev/COMPbase-vg/root – Using the LV Path from above | |
Resize the file system: | |
sudo resize2fs /dev/COMPbase-vg/root | |
Extend the physical drive partition: | |
sudo fdisk /dev/vda – Enter the fdisk tool to modify /dev/vda | |
NOTE: End each one letter command by pressing [Enter]; if the instructions do not specify a specific response to a question, just press [Enter] to accept the default | |
p – p command prints the disk info, same as running fdisk -l /dev/vda | |
d – d command delete the last partition (in this case, /dev/vda1) | |
n e n command creates a new partition; e makes that an extended partition | |
t – t changes the type of partition | |
8e – Enter 8e (lvm) as the partition type | |
NOTE: In some cases, the disk uses GPT signature rather than DOS. In that case, use the 31 (lvm) as the partition type | |
w – w writes the changes to disk and exits fdisk |
FOR SIMPLE PARTITION RESIZE
sudo resize2fs /dev/sda1
"blkid" for get UUID
UUID={YOUR-UID} {/path/to/mount/point} {file-system-type} defaults,errors=remount-ro 0 1
lvextend -l +100%FREE /dev/centos/root.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#Create
pvcreate /dev/sdb /dev/sdc
#Get status
pvs
#Display info
pvdisplay /dev/sdb
#Combind morethan one drive
vgcreate vg00 /dev/sdb /dev/sdc
#Display group information
vgdisplay vg00
#Logical Volumes Create
lvcreate -n vol_projects -L 10G vg00
#File System
mkfs.ext4 /dev/vg00/vol_projects
https://www.tecmint.com/manage-and-create-lvm-parition-using-vgcreate-lvcreate-and-lvextend/