LVM Disk Resize

Reload Disk Info

echo 1 > /sys/block/sdX/device/rescan

Resize Disk

Use parted to resize partition if needed

# for example /dev/sda3
$ parted /dev/sdXX
(parted) print free
(...)

Number  Start   End     Size    File system  Name                  Flags
        17.4kB  1049kB  1031kB  Free Space
 1      1049kB  630MB   629MB   fat32        EFI System Partition  boot, esp
 2      630MB   1704MB  1074MB  xfs
 3      1704MB  64.4GB  62.7GB                                     lvm
        64.4GB  164.4GB 100GB   Free Space

(parted) resizepart 3
End?  [64.4GB]? 164.4GB
(parted) quit

Resize pv

# for example /dev/sda3
pvresize /dev/sdXX

Resize lv

# Specific size
lvresize --size 1.34t /dev/mapper/cl-root

# Full
lvresize -l+100%FREE /dev/mapper/cl-root

Resize fs

# for ext3
resize2fs /dev/mapper/cl-root
# for xfs
xfs_growfs /dev/mapper/cl-root


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.