5 ms·
My /boot partition is 256MB because that was the default in the Ubuntu installer way back when I installed it. I can't easily resize it because my primary parti
by gavinsyancey 3y ago
My /boot partition is 256MB because that was the default in the Ubuntu installer way back when I installed it. I can't easily resize it because my primary partition starts right after it. I am constantly running out of space in /boot because Apt doesn't fully clean up after old kernel versions automatically. An extra 20-30MB (per kernel version, at least) is absolutely a huge deal.
- jml78 3y agoI am in the same boat as you. I still haven’t found a solution for keeping it clean in an automated and safe way.
- orra 3y agoHowever, you could consider shrinking your main partition using gparted live. Then put a new /boot at the end. Of course, you'd lose the original /boot partition space, however.
- aidenn0 3y agoI don't know if any tools support moving partitions, but you can use "dd" to move a partition backwards if you are very careful. I'm not recommending this on any system that you don't have good backups for, but it is possible.
- simcop2387 3y agogparted supports this and it's relatively easy to do after shrinking the original partition
- simcop2387 3y agoWhy not just use gparted to move the partition instead? Just three steps 1. Shrink the main partition 2. Move the main partition to the right, leaving free space between it and /boot 3. Resize /boot to fit into the newly freed space That's what I did at one point to make my /boot 2gb or so, haven't had issues since.
- justinclift 3y agoDoes moving the main partition like that have potential weirdness with some filesystems, or does this gparted approach rewrite the entire partition to a new (offset) location?
- simcop2387 3y agoI've never ran into anything weird, since it moves the whole partition's address rather than the filesystem within the partition or anything like that.
- orra 3y agoYes, that works, but I didn't suggest it because it's riskier and takes way longer. The whole filesystem has to be moved, instead of just the excess data. Although this is usually successful, my advice would be: don't have a power outage if you're moving the whole filesystem.
- pshirshov 3y agoNixOS
- yjftsjthsd-h 3y agoI run out of space on /boot semi-regularly on one of my nixos machines; if anything, I would argue that it's worse at handling the situation if you don't regularly delete old generations
- pshirshov 3y agoIt does that on its own, set a reasonable limit on generations and enable auto gc.
- aidenn0 3y agoI moved my /boot to a USB thumb drive when I ended up in a similar situation.
- mixmastamyk 3y agoPerhaps Ubuntu and its derivatives but mine (now Mint) has been removing the fourth kernel for probably five years. May need to run autoremove (haha) however.
- kiwijamo 3y agoI swear Debian only keeps two versions ie current and the previous. Is keeping four a Ubuntu thing?
- mixmastamyk 3y agoKeeps three and when the fourth arrives the oldest gets the heave-ho. Probably configurable.
- wubrr 3y agoYou can resize your primary partition, move it to a larger offset, then resize /boot. You can also move /boot to the end of your disk. gparted supports this stuff pretty well.
- LoganDark 3y agoThere's no way. You cannot just relocate a Linux partition while it's running like you can macOS, unless gparted somehow supports moving a live system into a tmpfs while the operation is performed. Windows software that does this has to completely reboot into a dedicated executable that does the work before the system is actually started.
- wubrr 3y agoNot while it's running obviously... you boot into gparted live and do it. And btw, yes you can move partitions while linux is running.
- LoganDark 3y ago> you boot into gparted live and do it. This is not the same as simply running gparted from the partition to be resized. > And btw, yes you can move partitions while linux is running. Not your root partition, unless you can manage to unmount it without having a fatal system crash.
- wubrr 3y ago> This is not the same as simply running gparted from the partition to be resized. Nobody said you have to run it from that filesystem/partition? > Not your root partition, unless you can manage to unmount it without having a fatal system crash. You can resize your root partition using fdisk/partprobe without unmounting it, then move /boot to be after root. I'm sure there are many other ways to do it as well (pivot_root, etc).
- Timshel 3y agoYou just need to run off a live distro to do it.
- aragilar 3y agoUbuntu is configured that way. Most other apt-based systems are configured correctly.
- akaij 3y agoYou can still create and use an XBOOTLDR partition.