From 74fa008bfcd3263eb691cc0b3f7a055b17569f8b Mon Sep 17 00:00:00 2001 From: Eduardo Otubo Date: Tue, 30 Mar 2021 18:08:25 +0200 Subject: Add support to resize rootfs if using LVM (#721) This patch adds support to resize a single partition of a VM if it's using an LVM underneath. The patch detects if it's LVM if the given block device is a device mapper by its name (e.g. `/dev/dm-1`) and if it has slave devices under it on sysfs. After that syspath is updated to the real block device and growpart will be called to resize it (and automatically its Physical Volume). The Volume Group will be updated automatically and a final call to extend the rootfs to the remaining space available will be made. Using the same growpart configuration, the user can specify only one device to be resized when using LVM and growpart, otherwise cloud-init won't know which one should be resized and will fail. rhbz: #1810878 LP: #1799953 Signed-off-by: Eduardo Otubo Signed-off-by: Scott Moser --- doc/examples/cloud-config-growpart.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc') diff --git a/doc/examples/cloud-config-growpart.txt b/doc/examples/cloud-config-growpart.txt index 393d5164..09268117 100644 --- a/doc/examples/cloud-config-growpart.txt +++ b/doc/examples/cloud-config-growpart.txt @@ -13,6 +13,8 @@ # # devices: # a list of things to resize. +# if the devices are under LVM, the list should be a single entry, +# cloud-init will then extend the single entry, otherwise it will fail. # items can be filesystem paths or devices (in /dev) # examples: # devices: [/, /dev/vdb1] -- cgit v1.2.3