Differences between revisions 6 and 12 (spanning 6 versions)
Revision 6 as of 2015-07-26 15:15:48
Size: 860
Editor: PieterSmit
Comment:
Revision 12 as of 2021-08-27 00:50:43
Size: 1919
Editor: PieterSmit
Comment:
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
 * NOTE:201507: Rather look at btrfs, it is reasonably mature, and does most thins lvm is used for.  * NOTE:201507: Rather look at [[linux/btrfs|BTRFS]], it is reasonably mature, and does most thins lvm is used for.
Line 18: Line 18:
vgscan --mknodes (may not be neccessary, but won't hurt) vgscan --mknodes (may not be necessary, but won't hurt)
Line 26: Line 26:

== 2021 Grow LVM ==
 1. Increase the disk (e.g. AWS resize)
 2. On linux check that size is visible with {{{
lsblk
xvdf 202:80 0 1000G 0 disk
└─xvdf1 202:81 0 500G 0 part
  └─home 253:0 0 500G 0 lvm /home
}}}
 3. If partition used for LVM grow it to full size, param: diskname <partition #> {{{
growpart /dev/xvdf 1
}}}
 4. Grow lvm physical volume {{{
pvs
pvresize /dev/xvdf1
pvs
}}}

 5. Grow volume group {{{
vgs

}}}

 6. Grow actual volume (--resizefs also resizes underlying filesystem) {{{
lvextend --resizefs --extents +100%FREE </dev/<lvg>/volume name>
df -h
}}}


== 2020 add disk to existing centos Linux ==
 * Start PV /dev/sda2, then using vmware extend disk, using fdisk /dev/sda add additional partition /dev/sda3
 * Add /dev/sda3 as PV $ sudo pvcreate /dev/sda3
 * Add PV to VG vgextend [vgname] /dev/sda3 $ sudo vgextend vg_<xyz> /dev/sda3
 * vgdisplay [vg)<xyz>]
 * add free space in VG to LV $ sudo lvextend -L+20G /dev/vg_xyz/lv_root

LVM Linux volume management

  • NOTE:201507: Rather look at BTRFS, it is reasonably mature, and does most thins lvm is used for.

  • All Harddrives(HD's = pv=physicalvolumes) are put into a vg(volume group = 1big virtual hd) and then you partion it into lv's(logical volumes)
  • #Installing_Debian_with_SATA_based_RAID

Why ?

  • LV's can migrate while live - e.g. remove a disk
  • LV's can expand while live

Notes

vgchange -a n
vgscan --mknodes (may not be necessary, but won't hurt)
vgexport -a
vgimport -a
vgchange -a y

That should bring them back to life.

2021 Grow LVM

  1. Increase the disk (e.g. AWS resize)
  2. On linux check that size is visible with

    lsblk
    xvdf             202:80   0 1000G  0 disk
    └─xvdf1          202:81   0  500G  0 part
      └─home         253:0    0  500G  0 lvm  /home
  3. If partition used for LVM grow it to full size, param: diskname <partition #>

    growpart /dev/xvdf  1
  4. Grow lvm physical volume

    pvs
    pvresize /dev/xvdf1
    pvs
  5. Grow volume group

    vgs
  6. Grow actual volume (--resizefs also resizes underlying filesystem)

    lvextend --resizefs --extents +100%FREE </dev/<lvg>/volume name>
    df -h

2020 add disk to existing centos Linux

  • Start PV /dev/sda2, then using vmware extend disk, using fdisk /dev/sda add additional partition /dev/sda3
  • Add /dev/sda3 as PV $ sudo pvcreate /dev/sda3
  • Add PV to VG vgextend [vgname] /dev/sda3 $ sudo vgextend vg_<xyz> /dev/sda3

  • vgdisplay [vg)<xyz>]

  • add free space in VG to LV $ sudo lvextend -L+20G /dev/vg_xyz/lv_root


CategoryLinux

linux/LVM (last edited 2021-08-27 00:50:43 by PieterSmit)