Score:0

I messed up and made my /boot partition laughably small over 4 years ago. Resizing it will not be straightforward. What can I do?

cn flag

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!

David avatar
cn flag
Of course you make a complete back up of the all the data from the disk. Accidents and mistakes can and will happen.
tamale avatar
cn flag
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.
guiverc avatar
cn flag
Does this answer your question? [Increase partition size on which Ubuntu is installed?](https://askubuntu.com/questions/116351/increase-partition-size-on-which-ubuntu-is-installed)
guiverc avatar
cn flag
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.
tamale avatar
cn flag
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.
ar flag
Does this answer your question? [How can I resize an LVM partition? (i.e: physical volume)](https://askubuntu.com/questions/196125/how-can-i-resize-an-lvm-partition-i-e-physical-volume)
ar flag
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.
tamale avatar
cn flag
thanks @user68186 - done and done. And no, the LVM partitions are not encrypted but I don't think that's relevant here.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.