Site Tools


linux:general:lvm

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
Last revisionBoth sides next revision
linux:general:lvm [2019/03/11 14:54] lunetikklinux:general:lvm [2019/10/23 17:50] lunetikk
Line 35: Line 35:
 <code> <code>
 pvcreate /dev/sdb1 pvcreate /dev/sdb1
-vgcreate data /dev/sdb1 +vgcreate datavg /dev/sdb1 
-lvcreate -l 100%FREE -n backup data +lvcreate -l 100%FREE -n backuplv datavg 
-mkfs.ext3 -Ldata /dev/data/backup  +mkfs.ext3 -Lbackup /dev/datavg/backuplv  
-#mkfs.xfs -Ldata /dev/data/backup+#mkfs.xfs -Lbackup /dev/datavg/backuplv
 vi /etc/fstab vi /etc/fstab
-/dev/mapper/data-backup /data                    ext3     defaults        0 0+/dev/mapper/datavg-backuplv /data                    ext3     defaults        0 0
 </code> </code>
  
Line 129: Line 129:
  
 Extend the disk (PV/VG, example above)\\ Extend the disk (PV/VG, example above)\\
-Then extend the LV+Then extend the LV (100% is the full VG, check the "Other commands"-section for other parameters)
 <code> <code>
 lvextend -l +100%FREE /dev/data/backup      lvextend -l +100%FREE /dev/data/backup     
Line 156: Line 156:
 |  lvdisplay    show all LVs  |\\ |  lvdisplay    show all LVs  |\\
 |  vgchange -ay <VGNAME>  |  activate LV  |\\ |  vgchange -ay <VGNAME>  |  activate LV  |\\
 +|  vgextend datavg /dev/sdd  |  add disk sdd (unpartitioned) to VG datavg  |\\
 |  lvextend -L+5G /dev/data/backup  |  extend by 5GB  |\\ |  lvextend -L+5G /dev/data/backup  |  extend by 5GB  |\\
 |  lvextend -L 10G /dev/data/backup  |  extend to 10GB total  |\\ |  lvextend -L 10G /dev/data/backup  |  extend to 10GB total  |\\
 +|  lvcreate -L20G -n backuplv datavg  |  create LV with 20GB total  |\\
 +|  lvresize -r -L+5G /dev/data/backup  |  extend by 5GB and do resize2fs/ xfs_growfs  |\\
  
 === Useful links === === Useful links ===
Line 168: Line 171:
 === Cant mount a logical volume === === Cant mount a logical volume ===
  
-== Description ==+__**Description**__
  
 Mounting the device leads to the following error Mounting the device leads to the following error
Line 181: Line 184:
 </code> </code>
  
-== Reason ==+__**Reason**__
  
 Its deactivated. Its deactivated.
Line 191: Line 194:
 </code> </code>
  
-== Fix ==+__**Fix**__
  
 Run the following command to activate it Run the following command to activate it
linux/general/lvm.txt · Last modified: 2020/11/16 17:39 by lunetikk