29 ms·
- FLAVOR: Ubuntu Desktop - HEADLINE: Please, please, please fix space issues with /boot. - DESCRIPTION: I'm constantly running out of space in /boot, due to
by karlmdavis 10y ago
- FLAVOR: Ubuntu Desktop
- HEADLINE: Please, please, please fix space issues with /boot.
- DESCRIPTION:
I'm constantly running out of space in /boot, due to kernel updates. It drives me so incredibly batty. If I had to guess, this is due to poor defaults in the installer for folks that opt to encrypt their whole disk. Even still, this system was setup back on 14.04 (don't think it started on 12.04), and I have no intention of reinstalling from scratch just to fix it.
Publish something official on how to fix this problem! Make it easy and stress free! Yell at the people who didn't catch this bug before it went out! Sorry, but this is just a really bad problem: it leads to folks like me wasting time, and probably a whole bunch of other folks just not being able to install updates, and no idea why.
- ROLE/AFFILIATION: software developer in the federal government
- noja 10y ago+1 then I can kill my custom "remove oldest kernels, except the running one, and leave at least two other kernels" script.
- jcadam 10y agoYes, I had this same problem when I was on Xubuntu. Fedora and CentOS(and I'm assuming many other distros) seem to handle kernel updates just fine without forcing me to manually clean out old images from /boot periodically (was always too lazy to write a script).
- vetinari 10y agoWhat Fedora and CentOS do is a generic yum/dnf option: installonly_limit. It allows you to keep limit on the amount of packages with the same name and different versions, kernel included.
- nyolfen 10y agowould you mind sharing this in the meantime?
- tombrossman 10y agoI've been using this for years. I believe it only keeps one old kernel version though, not two like you requested. Tested and working for weekly use since 12.04 though 16.04: echo $(dpkg --list | grep linux-image | awk '{ print $2 }' | sort | sed -n '/'`uname -r`'/q;p') $(dpkg --list | grep linux-headers | awk '{ print $2 }' | sort -n | sed -n '/'"$(uname -r | sed "s/\([0-9.-]*\)-\([^0-9]\+\)/\1/")"'/q;p') | xargs sudo apt-get -y purge
- throwaway6556 10y agoI guarantee there's a way to get that pipe to purge all packages in your system.
- noja 10y agoThis is the new way to do it: sudo purge-old-kernels --keep 3 -qy TIL
- stsp 10y ago+1 -- This is the one and only problem I have to regularly help my non-technical Ubuntu friends (and their friends) with. Every few months they cannot install updates anymore because their /boot fills up and apt fails to install a new kernel package. The simplest fix would probably be to make /boot large enough by default (in the order of 10GB or 20GB or so -- the current size is 512MB IIRC). A better fix would be to purge old unused kernels automatically but as far as I understand there were some difficult edge cases around that.
- TheCowboy 10y agoThis is the main problem that keeps me from wanting to set up less technical family members on Ubuntu. It's possible to get in a spot where even a simple command won't solve this.
- justinsaccount 10y ago> The simplest fix would probably be to make /boot large enough by default (in the order of 10GB or 20GB or so -- the current size is 512MB IIRC). Sure, I'll just use 1/6th of SSD to store 60 megabytes. $ du -hs /boot/ 56M /boot/ If 512M is not enough space for /boot you're doing something wrong.
- deleted 10y ago[deleted]
- lukeschlather 10y agoIf you're running updates weekly it will fill up on Ubuntu. This is a recent problem, and I've only experienced it on my laptop with full-disk encryption. The update process generates on the order of 100mb/month.
- jayess 10y agoIt's not new. It's been happening to me since I started using Ubuntu in the 8.x range.
- 10y ago
- BiohaZd 10y ago+1
- janwillemb 10y ago+1 as well. This made me brick my entire installation (entirely my own fault: trying to fix it with insufficient knowledge). It made me switch to another distribution.
- jstrassburg 10y agoDespite having cleaned out old kernels before, I spaced one day and accidentally removed the kernel I was running. This is fixable if you boot a live distro you can mount the relevant volumes (like your root disk to /mnt/foo, and your boot partition to /mnt/boot), then, after a chroot to /mnt/foo you can re-install the kernel. Here is an article describing it (but it misses mounting the boot partition) http://askubuntu.com/questions/28099/how-to-restore-a-system-after-accidentally-removing-all-kernels#28100 http://askubuntu.com/questions/28099/how-to-restore-a-system...
- kkarp 10y agoomg, I am on 14.04 LTS and didn't believe until now it is not fixed in newer releases! :)
- snt 10y ago-FLAVOR: and Ubuntu Server +1
- theandrewbailey 10y agoIn other words: integrate purge-old-kernels http://manpages.ubuntu.com/manpages/xenial/man1/purge-old-kernels.1.html http://manpages.ubuntu.com/manpages/xenial/man1/purge-old-ke... Maybe add some stats to know which kernels have booted successfully, so one knows which old ones can be safely deleted, and keep the last 1 or 2 good ones (not always the latest!).
- no_gravity 10y ago$ apt-get install purge-old-kernels The program 'purge-old-kernels' is currently not installed. You can install it by typing: apt install byobu "byobu"? packages.debian.org to the rescue... https://packages.debian.org/jessie/byobu https://packages.debian.org/jessie/byobu "Using Byobu, you can quickly create and move between different windows over a single SSH connection or TTY terminal, split each of those windows into multiple panes, monitor dozens of important statistics about your system, detach and reattach to sessions later while your programs continue to run in the background." Uhm... what?
- deleted 10y ago[deleted]
- deleted 10y ago[deleted]
- justinsaccount 10y ago> "byobu"? packages.debian.org to the rescue... You don't ned to use packages.debian.org to look up what packages do. > apt show byobu .. Description: text window manager, shell multiplexer, integrated DevOps environment Byobu is Ubuntu's powerful text-based window manager, shell multiplexer, and integrated DevOps environment.
- deleted 10y ago[deleted]
- JdeBP 10y agoQuite right. One uses packages.ubuntu.com: * http://packages.ubuntu.com/yakkety/all/byobu/filelist http://packages.ubuntu.com/yakkety/all/byobu/filelist (-:
- bhollan 10y ago+1. This is one of my major annoyances w/ Ubuntu. Been using it 3 years now and this seems like a fundamental issue that should be fixed.
- AdmiralAsshat 10y agoI don't use Ubuntu, but in Fedora it keeps only a handful of old kernels (i.e. one or two back) and deletes the rest. I guess Ubuntu just holds onto every kernel you've ever had since the beginning of time?
- n0us 10y agoI quit using Ubuntu as a Desktop OS because this was so obnoxious. I would gladly return if they fix this.
- dustinkirkland 10y agoThis will get fixed. Mark my words ;-)
- n0us 10y agoAwesome! thanks, looking forward to it!
- dallamaneni 10y ago+1 I recently had this issue. I have Ubuntu on my machine (not dual boot) and I installed with all the default options. I hardly installed any heavy applications and it started saying it cannot install updates as /boot is full. Thanks for bringing this up.
- agd 10y agoThis would be fantastic. This problem has no official or easy solution for non-technical people and delays updates which could cause security issues. Please, please provide a fix for this!
- Symbiote 10y agoWhy do you have a /boot partition? $ mountpoint /boot /boot is not a mountpoint I don't know if this is the default, but my KUbuntu machines have been fine for many years without a separate /boot.
- darpa_escapee 10y agoUbuntu mounts my EFI partition as /boot.
- theandrewbailey 10y agoI try to do the same, but sometimes there's no way around it. LUKS comes to mind: can't boot an encrypted kernel because EFI/BIOS has no decryption facilities. I'm sure there are other cases, but this is the only one that comes to mind.
- JoshTriplett 10y agoIf you want to install with full disk encryption, you normally want a /boot partition. In theory, GRUB can load kernels off of a LUKS-encrypted partition, but in practice I've never managed to set that up without having two passphrase prompts, one from GRUB and one for mounting the root filesystem under Linux.
- kobeya 10y agoLUKS.
- oneplane 10y agoWhy is boot still a separate partition. I most cases it doesn't need to be.
- nyolfen 10y agoLUKS
- onozz 10y agoapt autoremove will clean it up.
- nathan_f77 10y agoOnly if you catch it in time, before you've completely run out space. `apt autoremove` will crash if there is not enough space on the disk.
- STRML 10y agoWhich would be another worthwhile fix: some way to run `apt remove` or `apt autoremove` in a zero free-space environment. It could detect it and pick pick data somewhere (like /usr/src) to persist to memory temporarily while it works, then replace.
- theandrewbailey 10y agoI've never noticed autoremove removing old kernel images in /boot.
- TorKlingberg 10y agoI had this problem on a previous work laptop. Very annoying. I thought it was the local IT people who had installed it wrong.
- nathan_f77 10y agoI agree, I've had to deal with this issue many times. I think it has happened at least 4 times in the last year. A few times I had to manually go in and start deleting old kernels because it had completely run out of space, so apt couldn't do anything without crashing. I eventually set up a cron script to regularly delete everything except the last 3 kernels. I think this should really be the default behavior. "Save all the old kernels until you run out of space and everything crashes" doesn't sound like a very sane default.
- godelski 10y agoI used to use Arch and seriously one of my favourite things to see was an update that used negative disk space. Apt has come a long way, but this DEFINITELY needs to be fixed.
- amarant 10y agosounds like you're keeping too many old kernels, I've had this problem too in the past..try this nice little oneliner: dpkg --list | grep linux-image | awk '{ print $2 }' | sort -V | sed -n '/'`uname -r`'/q;p' | xargs sudo apt-get -y purge really, this is what your package manager should do automatically before/after installing new kernels for your reference: http://askubuntu.com/questions/2793/how-do-i-remove-old-kernel-versions-to-clean-up-the-boot-menu http://askubuntu.com/questions/2793/how-do-i-remove-old-kern...
- alphapapa 10y agoThat's not a good one liner, because it doesn't do anything about the linux-headers packages (which are hundreds of thousands of small files) or the linux-image-extra packages. Just run "apt-get autoremove".
- tkuraku 10y ago+1 - I didn't even know this was an issue. Usually i just use apt to update and run autoremove after I get a new kernel and verify it is working. I recently installed Ubuntu on some old computers for my relatives and they really like it. If they keep updating and after a couple of months their system fails to work that will be a disaster for any good will they will have developed for Ubuntu. This needs to be fixed NOW! How can Ubuntu even pretend to be a viable desktop operating systems if normal updating renders the system unusable?!
- yrro 10y agoUbuntu should just integrate Debian's /etc/kernel/postinst.d/apt-auto-removal script.
- ejp 10y agoThis is the primary reason I've recently replaced Ubuntu as the OS on my home server/NAS. I'd be happy to come back!
- daguu 10y agoAnother related issue: I have helped get a few co-workers set up with Ubuntu on their laptops. Inevitably, once every few months, one comes to me and says "I just ran an update and the 'Restart' popup came up, so I restarted, now my laptop says 'No bootable devices found.'" This happens when Ubuntu is installed in UEFI mode. A kernel update sometimes wipes out the boot image. To fix it, I to get into the BIOS and reselect a bootable UEFI image. This should never, ever happen.
- vetinari 10y agoI have similar experience, but with Virtualbox in UEFI mode. After any restart, UEFI will complain that it cannot find anything bootable, I will run the bootloader from UEFI shell (Virtualbox does not have BIOS menus), in booted system run the efibootmgr to register it, just to have it lost at next reboot and doing the dance again. Only Ubuntu does that, other linux distributions don't have this problem.
- lph 10y ago+1 Yes! Please!!
- schoen 10y agoI've also encountered this issue, and I assumed it was a bug to do with the fact that I sometimes use apt-get and sometimes accept the Ubuntu GUI software update prompts. If people are encountering it on this wide a scale, it must be a truly severe problem (that's also probably causing many people who haven't learned about apt-get to give up on software updates entirely!).
- mrb 10y agoIt's user error on your part. The proper way to upgrade a Debian/Ubuntu system is: $ apt-get dist-upgrade $ apt-get autoremove dist-upgrade installs new kernels, and autoremove will automatically remove old kernels (and keep the last 2 most recent ones.)
- edoloughlin 10y agoautoremove followed by dist-upgrade to 16.04 for me somehow decided to build multiple kernel versions and ran out of space on /boot mid build. That was really annoying to fix.
- mrb 10y agoRun autoremove after dist-upgrade.
- blacksmith_tb 10y agodist-upgrade shouldn't try and move you to another release version, do-release-upgrade alone does that, as far as I know. Things get a little more confusing using apt update/upgrade vs. apt-get update/dist-upgrade, they don't seem to be quite the same in all cases for me. But I agree with the general frustration that it shouldn't be necessary to run apt(-get) autoremove frequently to keep /boot from filling up with old kernels.
- mrb 10y agoThere is a lot of confusion in this thread. dist-upgrade is NOT (in most cases) meant to upgrade to a newer distribution (eg. Ubuntu 14.04 to 16.04). dist-upgrade is just like upgrade except it also installs additional packages if necessary (eg. linux-kernel-4.1 AND linux-kernel-4.2). Most people should always run "apt-get dist-upgrade" and never "apt-get upgrade" in order to simply keep their packages up-to-date. An actual distribution upgrade is triggered by a different command. On Ubuntu: do-release-upgrade
- lathiat 10y agoI like to use apt-get dist-upgrade --auto-remove, all in one step. Though for kernels they will be removed on the next invocation after reboot as the default logic keeps the last installed kernel version as well as the current one. As for the original issue of not cleaning up the kernels, this is fixed in xenial/16.04 but not in trusty/14.04, see bug report here: https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/1439769 https://bugs.launchpad.net/ubuntu/+source/update-manager/+bu...
- a3n 10y ago+1 This is a feature (kernel update) that is used by everyone, including newbs. They don't have to understand anything to enjoy the update, and they shouldn't have to understand anything to avoid the space filling issue. Lots of ways to fix it, I don't claim to know which is best: * Always leave N% /boot available, and delete or move old kernels to satisfy that. * Move old kernels to /old_kernels, outside of /boot. Driven either by satisfying N% space, or no more than K number of kernels kept in /boot. * Opt in, opt out, ask this on installation and for non-server installs, default to "never have to think about this again." * Easily configurable in the "whatever that box was called when I last used Ubuntu years ago" box.
- saltvedt 10y ago+1 This more than anything. I believe it is this issue (at least for me): https://bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/1357093 https://bugs.launchpad.net/ubuntu/+source/unattended-upgrade...
- yungchin 10y agoIndeed this is due to missing options in the installer: with some manual fiddling, it's long been possible to make grub boot from encrypted disk (thus removing the need for a separate /boot and its space issues): https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1062623 https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1062623 You could probably fix this on your system without installing from scratch, but it would take some careful planning (mostly wrt backups!). You'd need to boot from a recovery cd or such, copy /boot into /, edit /etc/fstab accordingly, and then follow the last few steps in the bug report above (from the chrooting onwards). I'd probably test this in a VM first.
- pascalo 10y ago+1 ... plusa nice command to clean out unused kernels
- vzaliva 10y agoThis is an annoying problem indeed but there is an easy workaround. Here is a script I use whenever I ran out of space on /boot partitition: https://gist.github.com/vzaliva/bee68ed709ddd2724791a56714eca5f6 https://gist.github.com/vzaliva/bee68ed709ddd2724791a56714ec...
- lathiat 10y agoBit late to the party, but I believe this was fixed in xenial/16.04 but not trusty/14.04 The relevant bug report is here: https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/1439769 https://bugs.launchpad.net/ubuntu/+source/update-manager/+bu... Side note, give up on a separate /boot in future, not needed 99.9% of the time.
- nightsky30 10y agoThis might be aggravated by this DKMS bug which was found in v2.2.0.3, which incidentally is used in Ubuntu 16.04 LTS, and maybe other versions. It doesn't remove old initrd files in /boot which lead to full /boot issues and subsequent update problems I manually removed a bunch of old initrd images the other day. http://askubuntu.com/questions/616512/purging-old-kernels-fails-to-remove-old-initrd-files http://askubuntu.com/questions/616512/purging-old-kernels-fa... https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=717584 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=717584 They've got a bug reported upstream. We need this fixed in Ubuntu
- nightsky30 10y agoUbuntu Launchpad bug here regarding DKMS leaving old files to fill /boot: https://bugs.launchpad.net/ubuntu/+source/dkms/+bug/1515513 https://bugs.launchpad.net/ubuntu/+source/dkms/+bug/1515513 You can add yourself to the list of people affected to increase the Bug Heat and get this issue fixed.
- bakhy 10y agoThe old kernels should be purged automatically on desktops. That really is an annoying issue.