Need to resize encrypted /home and / partitions

I allowed openSUSE 13.2 to automatically set the size fo the encrypted disk, which is a 240GB SSD, and for some odd reason, it only allocated 40GB to root and 50GB to the home partition. Now, I am stuck with about 140GB of unused space of which I would rather send another 20 GB to / and the rest to /home.

This is what my partition looks like at present. With my system partition residing on /dev/sda2. /dev/system shows the size of my / and home partitions. I would appreciate any assistance. Thanks!

http://thestrayworld.com/wp-content/uploads/2015/04/encrypted.png

You used an LVM and LVM is made to expand even across disks. So add another LVM container and link the two

Thanks for the quick reply. Is there a recommended guide? I literally just started using openSUSE and LVMs last Friday so I am still stumbling around a lot of things. I am more familiar with Kubuntu to be honest.

Maybe on a side track, you should check why you need a 60 GB / file system. openSUSE normally offers 20 GB and that is more then enough for most.

Well, I have been running Kubuntu for a while and installing things tend to take up a lot of space, and I have always been worried about space after I had to retroactively resize my / partition from 20GB to 40GB. I imagine I will need more space since this is a desktop system, and I intend to use it for compiling stuff.

Generally the default root is 20gig for ext4 file system 40 gig for BTRFS swap 1-2X memory and the rest of free space for home. But I’m not sure of the LVM defaults. But again we have someone that did not read all the screens presented and just clicked blindly through via the Microsoft reflex. Always read the screens and be sure you understand them . If you don’t ask. You were presented with a partition scheme screen with all the facts on it.

I’ve never played with LVM so I’ll just point you to a how to

http://tldp.org/HOWTO/LVM-HOWTO/

I imagine this how openSUSE community members usually act to someone new to the distro asking questions about the distro?

Rather than be more acrimonious about it, I will only say I spent more than 8 hours reading up on encryption and partitioning systems before deciding to go with the guided route because setting up encrypted swap, encrypted home, and encrypted root looked daunting and I had already failed to get the loopback devices properly set up. 7 or 9 installation attempts later, I decided to go with the guided encrypted partitioning.

I do use an encrypted LVM here.

If I were in your situation I would consider two possibilities:

  1. Backup everything to an external drive. Recreate the LVM to the desired new sizes. Restore. Note that this is complex because “fstab” and the grub2 boot configuration need to be changed to match the new UUIDs for the file system.
  2. Backup only “/home” to an external drive. Recreate the LVM to the new sizes. Restore the “/home” to its LVM volume. Then do a complete fresh install, but preserving “/home”. This is easier to do, because the changes to “fstab” and “grub2” are taken care of by the new install. But it will require re-doing all of the changes made since, such as tweaking settings and installing additional software.

I would probably go with the second of those two options.

Yes, it is possible to add more space to an LVM, and then resize. I’m not sure that I trust resizing file systems which have actual data.

I feel like I want to give it a shot. I can use

cryptsetup luksOpen /dev/sda1 luks

To unlock the drive in the liveCD. But the output after that is only /dev/system and no trace of /dev/system/home. Is there a secondary lock of sorts in place?

At this stage, I would settle for increasing the home folder to the maximum size. Thanks for the suggestions! :slight_smile:

After opening the LUKS encrypted LVM, use:


# vgchange -a y

That makes the LVM volumes accessible. You should then be able to mount them as needed in your live boot.

Thank you. You have been most helpful. I will try it out now.

I actually have my Home folder linked to the 1.8 TB disk thorough symlinks, so there won’e be much loss of data, only two days worth of customizing the system.

Success! Thank you for the solution nrickert.lol! That was relatively painless. All I was missing was the code to load the lvm, and it was all gold from there.

http://thestrayworld.com/wp-content/uploads/2015/04/successful-resizing-encrypted1.png

You can’t believe how many people simply breeze past the partition scheme without really looking at it. If you had you would have seen that the partitions were not what you wanted and at that point you can go back and fix it the way you wanted them.

It has become a bad habit that Windows user simply press accept accept without thought. Unfortunately we see that far to often here. Installing any OS is a lot more complicated then installing a Windows program. Since you used LVM for the encrypted container it shows you did research it, but you missed reading an important screen at install In any case looks like you have found a solution. :wink:

Perhaps I should not have been imbibing alcohol while doing the partitioning, and I did miss a page. Nevertheless, this exercise has taught me to not only do encrypted partitions correctly, but has served as a beginning course in LVM.

There may be many newbie users who don’t read the manual or the guides, stumble into an exercise, and do something wrong (I have met my fair share). There could also be a person like me, a Linux user since 2008 who is simply trying out something new, read everything I could get my hands on, and missed a crucial step somewhere.

Either way, I think being civil about it and not throwing an RTFM comment would do wonders for the communitiy’s reputation. :stuck_out_tongue:

When I first tried an encrypted LVM, I took the defaults. But I did not like the choices offered when I next tried. And then I found it hard to persuade the installer to do it the way that I wanted.

So I got into the habit of setting up the encrypted LVM first (typically using a live media boot), and starting the installer later to use existing partitioning.