0

Ubuntu version is 22.04 LTS Desktop

My boot disk is /dev/sda, and it has three partitions.

Here are the relevant mounts:

~$ df -h
Filesystem                   Size  Used Avail Use% Mounted on
tmpfs                        762M   12M  751M   2% /run
/dev/mapper/ubuntu--vg-root  227G   64G  152G  30% /
tmpfs                        3.8G  546M  3.2G  15% /dev/shm
tmpfs                        5.0M  4.0K  5.0M   1% /run/lock
/dev/sda2                    235M  180M   43M  81% /boot
/dev/sda1                    487M  5.3M  481M   2% /boot/efi

/dev/sda3 is the partition that ubuntu--vg-root is on:

~$ sudo pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda3
  VG Name               ubuntu-vg
  PV Size               <237.76 GiB / not usable 2.00 MiB
...

I have plenty of free space in /dev/sda3 (/) but it starts right after the way-too-small /dev/sda2 /boot partition.

I'm uncertain if I can shrink /dev/sda3 and the pv / lv by moving the start further back rather than the end of that partition forward, but that seems like what I should do here. The other problem is I have no idea how to go about doing this. Probably a live cd and some full-fledged partition manager that can work with lvm volumes but I'm getting conflicting information about the best way to go about doing that in 2023.

If I can't do that, what are some other options I have available here? Would it be straightforward to move /boot right into the main / partition? Even if this is possible, is it a good idea?

Note that this isn't the same as "Increase partition size on which Ubuntu is installed?" because my / partition is fine. The only problem is my /boot partition is too small, and the tricky part is it's sandwiched in between two other partitions, the latter of which is LVM.

The suggested answers on the question of 'how to shrink my lvm volume' don't include any examples where the shrinking occurs by moving the front of the partition forward so there's more space in front of the LVM volume.

Any help would be appreciated, thank you!

tamale
  • 1,459
  • Of course you make a complete back up of the all the data from the disk. Accidents and mistakes can and will happen. – David Mar 25 '23 at 19:25
  • Thanks @David - I know how to grow and shrink partitions in general but your comment seems to imply you didn't read about the nuance of my situation. I need to shrink a partition by moving the start of an LVM partition further back or come up with a more creative solution altogether. I spent all morning looking for advice for people in a similar situation and didn't find anything remotely close. – tamale Mar 25 '23 at 20:11
  • 1
  • 1
    You've provided no OS/release details, which is the first step I consider (also server/desktop). I see nothing unique in your question as LVM partitions have had little to no changes in 15+ years. If it was me I'd likely not make any partition changes & just drop (ignore) your existing /boot & use space on your / instead (ie. logical changes only to your file-system table) once the data has been copied across. Once you know its working, you can recover the the wasted space of your prior /boot too. uEFI systems require a ESP (efi sys.partition or /boot/efi) but no /boot is required. – guiverc Mar 25 '23 at 22:00
  • no @guiverc that question is unrelated to my problem.

    OS version is Ubuntu 22.04 LTS - Desktop

    Again, the unique problem is my /boot partition is 'sandwiched' between two other partitions. I can't just grow it. If I can drop the /boot partition and just use /, that's great. But I don't see any guides on how to go about doing that. It's not even clear if I can directly load kernels from an LVM partition, which my / is a part of.

    – tamale Mar 27 '23 at 19:54
  • 1
    You don't tell us if you have your LVM partitions encrypted using LUKs. Please edit your question and add your OS version and all other information you have put in comments. – user68186 Mar 28 '23 at 21:43
  • thanks @user68186 - done and done. And no, the LVM partitions are not encrypted but I don't think that's relevant here. – tamale Mar 29 '23 at 22:06

0 Answers0