LVM vergrössern

Extending a LVM Volume

  1. Log into the device using LVM, in this example I’ll be extending the pve-root and data volumes in Proxmox
  2. Run the following commands in terminal # login as root if needed (not needed for proxmox)
    sudo su
    # list disks and partitions
    fdisk -l
    # list volume groups
    vgdisplay
    # list logical volumes
    lvdisplay
    # edit partitions with fdisk, change device id as needed
    fdisk /dev/sda
    # print the partition table
    p
    # delete a partition
    d
    # enter the lvm partition number
    3
    # create a new partition
    n
    # enter the new partition number, same as the number deleted
    3
    # press enter to accept the default first sector
    # press enter to accept the default last sector
    # when prompted about removing the LVM signature, enter N
    n
    # set the partition type
    t
    # enter the partition number
    3
    # set the type to Linux LVM
    30
    # write the changes
    w
    # list disks and partitions, noting the size increase
    fdisk -l
    # extend the existing physical volume
    pvresize /dev/sda3
    # extend the pve-root logical volume to 100% available free space
    lvresize -L +8GB /dev/pve/root
    # extend the underlying file system
    resize2fs /dev/mapper/pve-root
    # list logical volumes, noting root is now 8GB larger
    lvdisplay
    # extend the data to 100% available free space
    lvextend -l +100%FREE pve/data
    # list logical volumes, noting data is now over 35GB
    lvdisplay

Further Reading: https://wiki.ubuntu.com/Lvm

Schreibe einen Kommentar