You are not logged in.

#1 2015-02-13 08:17:10

jmanes
Member
From: Kansas City
Registered: 2015-01-10
Posts: 21
Website

[SOLVED] Resizing boot partition. LUKS on LVM.

Hello everyone,

I was an idiot and made my boot partition 64 megs during install. It is currently set up with ext4 and mounts to /boot. My root partition is LUKS on top of LVM. The layout is as follows.

NAME         MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda            8:0    0 223.6G  0 disk  
├─sda1         8:1    0     1M  0 part  
├─sda2         8:2    0    61M  0 part  /boot
└─sda3         8:3    0 223.5G  0 part  
  └─lvm-root 254:0    0 223.5G  0 lvm   
    └─root   254:1    0 223.5G  0 crypt /

sda2 is full and because of this I am having issues using mkinitcpio. I need to resize /dev/sda2 to have more space, but first I must resize /dev/sda3 I am guessing. Since LUKS is on top of LVM does this mean I can follow this guide? Any pointers or tips before I do this?

Thanks

Last edited by jmanes (2015-02-13 16:45:26)


Software Engineer. BS in Computer Science.

Offline

#2 2015-02-13 15:03:08

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,362

Re: [SOLVED] Resizing boot partition. LUKS on LVM.

I think you may have to decrypt before resizing.  Is this a completely new installation?  If so, it may just be easier to scrap and restart.  But then you'd need to move the package files where they can be reused.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#3 2015-02-13 16:14:03

frostschutz
Member
Registered: 2013-11-15
Posts: 1,417

Re: [SOLVED] Resizing boot partition. LUKS on LVM.

64M /boot is small but not impossible. You can probably shave a few M off grub (who needs themes, anyway?), that should give you enough room for two kernels and initramfs.

Otherwise, in order to add e.g. 512M to your /boot, with LUKS on LVM as in your case, you'd have to

- shrink the filesystem by 512M,
- shrink the LUKS by 512M (you may skip this if you're doing this from a live cd where you can luksClose),
- shrink the LV by 512M
- move the PV extents (first 512M) to the end of the disk using pvmove
- dump the LVM configuration
- edit the LVM configuration to change PE offsets minus 512M
- move the beginning of the sda3 partition by +512M
- restore the edited LVM configuration
- grow sda2 by 512M
- grow the /boot filesystem

It's complicated and prone to errors. But the only way if you want to move no more than 512M of data. The alternative would be moving 223.5G by shifting the entire partition contents; you could just as well reinstall entirely. Or sacrifice the 64M boot partition, just shrink the / and LVM and add another /boot partition at the very end of the disk.

I think I'd just make do with 64M in /boot. I can live with the choice of but a single kernel.

Offline

#4 2015-02-13 16:45:07

jmanes
Member
From: Kansas City
Registered: 2015-01-10
Posts: 21
Website

Re: [SOLVED] Resizing boot partition. LUKS on LVM.

frostschutz wrote:

64M /boot is small but not impossible. You can probably shave a few M off grub (who needs themes, anyway?), that should give you enough room for two kernels and initramfs.

Otherwise, in order to add e.g. 512M to your /boot, with LUKS on LVM as in your case, you'd have to

- shrink the filesystem by 512M,
- shrink the LUKS by 512M (you may skip this if you're doing this from a live cd where you can luksClose),
- shrink the LV by 512M
- move the PV extents (first 512M) to the end of the disk using pvmove
- dump the LVM configuration
- edit the LVM configuration to change PE offsets minus 512M
- move the beginning of the sda3 partition by +512M
- restore the edited LVM configuration
- grow sda2 by 512M
- grow the /boot filesystem

It's complicated and prone to errors. But the only way if you want to move no more than 512M of data. The alternative would be moving 223.5G by shifting the entire partition contents; you could just as well reinstall entirely. Or sacrifice the 64M boot partition, just shrink the / and LVM and add another /boot partition at the very end of the disk.

I think I'd just make do with 64M in /boot. I can live with the choice of but a single kernel.

Good info... Yeah well even with one kernel it is still using 100% of the disk (no themes either). It works... but just barely. Instead of doing all that mess you mentioned I think I'll just backup my home folder and do a re-install this afternoon. I don't feel as though moving things around like that will be error free with me behind the wheel lol. Because your info seems legit I'll mark this as solved.


Software Engineer. BS in Computer Science.

Offline

Board footer

Powered by FluxBB