0

I have 2 logical volumes.

                             Size  Used  Avail  Use%  Mounted on
/dev/mapper/vg_name-lv_root  38G   5.3G  24G    19%
tmpfs                        1.1G  420K  1.1G    1%   /dev/shm
/dev/sda1                    485M  48M   412M   11%   /boot
/dev/mapper/vg_name-lv_home   29G  210M  28G     1%   /home

How can I extend my logical volume lv_home taking spaces from lv_root?

I tried lvextend -L +1G /dev/vg_name/lv_home

It gives me error:

Insufficient free space: 256 extents needed, but only 0 available

2

To use space from lv_root, you need to shrink it. This is only possible (without reformatting) if the file system you’re using supports shrinking; ext3/ext4 are fine, XFS isn’t (in this regard).

The appropriate tool is lvreduce:

lvreduce -r -L -1G /dev/vg_name/lv_root

The -r options instructs it to use fsadm to resize the file system before shrinking the LV. Once it finishes, you’ll have enough free space in your VG to extend your home LV.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.