Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I wanted to resize the FS on a machine but i ran into problems:

Purpose: the LV of /home is too big, the LV of / is too small (they're on 1 VG.) - I need to put 10 GByte from /home to /!!

Problem: gparted only shows this (can't see the LV's.. :):

enter image description here

How can I put 10 GByte to / from /home if they're encrypted with LUKS?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

GParted doesn't support LVM at all (unless this has changed recently?). You'll need to use the command line tools.

First, if you're booting from some rescue media, ensure that the volume group involved is active. The sequence will be something like

cryptsetup luksOpen /dev/sda2 encrypted
pvscan
vgchange -ay /dev/mapper/my_volume_group
lvchange -ay /dev/mapper/my_volume_group-root /dev/mapper/my_volume_group-home

Then shrink the filesystem of the home volume. Use the right tool depending on the filesystem, e.g. resize2fs for ext2/ext3/ext4, resize_reiserfs for ReiserFS, …

Then resize the logical volumes, first shrinking home to make room, then expanding root to use the available space. Check the documentation for the units you can use with lvreduce.

lvreduce -L NEWSIZE /dev/mapper/my_volume_group-home
lvextend /dev/mapper/my_volume_group-root

Finally extend the filesystem of the root volume.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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