[Solved] /boot partition has no space.
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
[Solved] /boot partition has no space.
When I installed Linux Mint 17.2, it configured /boot with only 100 Mb of space. Since each new kernel update keeps previous ones, there is no space for anything new since 4.4.0-127.. How do I go about removing stale kernels?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: /boot partition has no space.
If you only installed kernels via the Update Manager then you can use it to remove them, go View > Linux kernels, click each one and select remove except for those you want to keep. If you installed kernels via other sources then you'll probably have to remove them in other ways, e.g. Synaptic or apt-get.
Once you install a new version of Mint I suggest not to have a separate /boot partition, there's no good reason for it these days.
Once you install a new version of Mint I suggest not to have a separate /boot partition, there's no good reason for it these days.
Re: /boot partition has no space.
That's not big enough for more than one kernel.
I'm pretty sure that's wrong.Since each new kernel update keeps previous ones,
To change/update kernels you'll have to make /boot larger or do some hacking, like move the files somewhere else and makes links to them.there is no space for anything new since 4.4.0-127.. How do I go about removing stale kernels?
Edit: after you enlarge the /boot partition, you should probably
Code: Select all
sudo grub-install /dev/sda # (PROBABLY sda = the DISK, not partition, you want to boot from)
sudo update-grub
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Your data and OS are backed up....right?
Re: /boot partition has no space.
I didn't set the size. The setup gui didn't offer such a choice. But I made a mistake. It's not quite as small as I indicated. 236 Mb, not 100Mb which is still too small. I notice that LM 17.3 makes 15Gb so that installation should have no such problem.
I updated the kernel when aptitude updated packages. Maybe there's an option to remove stale kernels but it's not the default with aptitude safe-upgrade.I'm pretty sure that's wrong.Since each new kernel update keeps previous ones,
I'd prefer to avoid the process of copying files and linking to them to get the partition larger -- too much room for error for me with limited skill. I'd prefer to enlarge the partition if it's safe to do so with gparted? Or do I still need to copy everything to a temporary place, then copy them back after /boot has been enlarged?To change/update kernels you'll have to make /boot larger or do some hacking, like move the files somewhere else and makes links to them.there is no space for anything new since 4.4.0-127.. How do I go about removing stale kernels?
Edit: after you enlarge the /boot partition, you should probablybecause grub needs to know where the start of the /boot partition.Code: Select all
sudo grub-install /dev/sda # (PROBABLY sda = the DISK, not partition, you want to boot from) sudo update-grub
Re: /boot partition has no space.
I have installed 17.2 many times and it does not create a /boot partition automatically. You would have had to create it with the Something else option.
Yes, anytime that you install a newer kernel, the older one remains so that you can boot using that older one just in case you can't boot using the newer one.
I usually keep 2 kernels. If and when I install a new kernel, I immediately delete the oldest one which leaves the previous kernel that I was using just in case I need to boot using the previous kernel.
If you're going to use Gparted, run it from a live USB/DVD and before doing that, make sure you backup important files.
If I not mistaken, Grub placement will depend on how the disk is set up and if it's MBR or GPT.Flemur wrote: ⤴Fri Jul 20, 2018 11:55 am
Edit: after you enlarge the /boot partition, you should probablybecause grub needs to know where the start of the /boot partition.Code: Select all
sudo grub-install /dev/sda # (PROBABLY sda = the DISK, not partition, you want to boot from) sudo update-grub
Re: /boot partition has no space.
OK, I stand corrected. My memory of the process is lacking.
I like that approach. Just how did you go about deleting the oldest one? Is it a simple matter ofYes, anytime that you install a newer kernel, the older one remains so that you can boot using that older one just in case you can't boot using the newer one.
I usually keep 2 kernels. If and when I install a new kernel, I immediately delete the oldest one which leaves the previous kernel that I was using just in case I need to boot using the previous kernel.
Code: Select all
aptitude delete initrd.img-4.4.0-124-generic?
Thanks for all the help.
Re: /boot partition has no space.
No, never try it like that (not that it would work, but still, never try to remove those files manually). The easiest and safest way on Mint to remove a kernel is to do it through the Update Manager > View > Linux kernels, click the one you want to remove and click on Remove.Tuxkid wrote: ⤴Fri Jul 20, 2018 11:48 pm I like that approach. Just how did you go about deleting the oldest one? Is it a simple matter ofIs that the appropriate way to specify the target kernel? Will that take care of the vmlinuz*, abi*, config* etc files? That would be more straightforward than modifying the partition size.Code: Select all
aptitude delete initrd.img-4.4.0-124-generic?
Thanks for all the help.
Re: /boot partition has no space.
I was led to understand that the Update Manager was appropriate only when it was used to install them. Otherwise, I should use apt or Synaptic. Is that not the case?gm10 wrote: ⤴Sat Jul 21, 2018 4:14 amNo, never try it like that (not that it would work, but still, never try to remove those files manually). The easiest and safest way on Mint to remove a kernel is to do it through the Update Manager > View > Linux kernels, click the one you want to remove and click on Remove.Tuxkid wrote: ⤴Fri Jul 20, 2018 11:48 pm I like that approach. Just how did you go about deleting the oldest one? Is it a simple matter ofIs that the appropriate way to specify the target kernel? Will that take care of the vmlinuz*, abi*, config* etc files? That would be more straightforward than modifying the partition size.Code: Select all
aptitude delete initrd.img-4.4.0-124-generic?
Thanks for all the help.
I'm having difficulty understanding the connection between what's visible to the Update Manager and what's in /boot/ such as
Code: Select all
-rw-r--r-- 1 root root 6572944 Jan 6 2016 vmlinuz-3.19.0-32-generic
-rw------- 1 root root 7013728 Jan 24 12:00 vmlinuz-4.4.0-112-generic
-rw------- 1 root root 7041440 Feb 16 23:58 vmlinuz-4.4.0-116-generic
-rw------- 1 root root 7049120 Apr 3 07:39 vmlinuz-4.4.0-119-generic
-rw------- 1 root root 7053328 May 20 04:29 vmlinuz-4.4.0-127-generic
-rw------- 1 root root 7057968 Jun 15 02:53 vmlinuz-4.4.0-130-generic
installed, but Update Manager also has one ending in 124 (which is
labelled as 'loaded'). So the loaded one doesn't appear in /boot?
Added to that, 127, 128 and 130 are listed but not installed.
What am I not understanding about /boot?
Re: /boot partition has no space.
As long as a kernel shows up in Update Manager's Linux kernels window, it's safe to remove it that way. There are some kernels that would not show up in Update Manager due to the way it detects them, that's when you'd need to use apt or Synaptic.
That said, old kernels that you originally installed via apt or Synaptic can be automatically removed via
sudo apt-get autoremove --purge
. Feel free to try it. Due to the way Update Manager installs kernels that command won't work for those though.If it lists one as loaded, that probably means that it's the kernel that's currently in use. The commandTuxkid wrote: ⤴Sat Jul 21, 2018 5:40 am I'm having difficulty understanding the connection between what's visible to the Update Manager and what's in /boot/ such asI thought that meant those ending in 112, 116, 119, 127, 130 wereCode: Select all
-rw-r--r-- 1 root root 6572944 Jan 6 2016 vmlinuz-3.19.0-32-generic -rw------- 1 root root 7013728 Jan 24 12:00 vmlinuz-4.4.0-112-generic -rw------- 1 root root 7041440 Feb 16 23:58 vmlinuz-4.4.0-116-generic -rw------- 1 root root 7049120 Apr 3 07:39 vmlinuz-4.4.0-119-generic -rw------- 1 root root 7053328 May 20 04:29 vmlinuz-4.4.0-127-generic -rw------- 1 root root 7057968 Jun 15 02:53 vmlinuz-4.4.0-130-generic
installed, but Update Manager also has one ending in 124 (which is
labelled as 'loaded'). So the loaded one doesn't appear in /boot?
Added to that, 127, 128 and 130 are listed but not installed.
What am I not understanding about /boot?
uname -r
will tell you for sure. The command ls -l /vmlinuz
will tell you where the current default kernel is located.Never ever try to remove the currently active kernel. All the others are free game. If removing them via Update Manager does not work, open up Synaptic and in the sections list select "Kernel and modules". Installed packages are marked with a green square in front. You can now right-click and mark for complete removal every installed package in the "Kernel and modules" section that meets two conditions:
- It has a version number in the name ("Package" column)
- The version number ("Installed Version" column) is different from the one output by the
uname -r
command. Note that if the command outputs something like 4.4.0-130-generic and the "Installed Version" column says 4.4.0-130.156 or 4.4.0.130.156, that's still the same version. 4.4.0-127.153 would be a different version.
Re: /boot partition has no space.
Here's what I don't understand about it: you said /boot was 100Meg, which isn't enough space for two kernels, yet you have parts of six kernels in /boot...what do these commands return?Tuxkid wrote: ⤴Sat Jul 21, 2018 5:40 amI'm having difficulty understanding the connection between what's visible to the Update Manager and what's in /boot/ such asWhat am I not understanding about /boot?Code: Select all
-rw-r--r-- 1 root root 6572944 Jan 6 2016 vmlinuz-3.19.0-32-generic -rw------- 1 root root 7013728 Jan 24 12:00 vmlinuz-4.4.0-112-generic ...
Code: Select all
df | grep boot
ls -lh /boot
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Your data and OS are backed up....right?
Re: /boot partition has no space.
I use Update Manager, just as gm10 posted.Tuxkid wrote: ⤴Fri Jul 20, 2018 11:48 pmI like that approach. Just how did you go about deleting the oldest one?JerryF wrote: ⤴Fri Jul 20, 2018 10:40 pm Yes, anytime that you install a newer kernel, the older one remains so that you can boot using that older one just in case you can't boot using the newer one.
I usually keep 2 kernels. If and when I install a new kernel, I immediately delete the oldest one which leaves the previous kernel that I was using just in case I need to boot using the previous kernel.
...
Thanks for all the help.
Re: /boot partition has no space.
Oops - but it's still not enough room for six kernels (he has at least part of six kernels there), which are > 55Meg each.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Your data and OS are backed up....right?
Re: /boot partition has no space.
See if this doesnt remove stubborn leftover residual garbage from deleted kernels:...DAMIEN
Kernel Cleanup after Deletion
do these one at a time, dont worry if the first dpkg -l says error etc...just means nothing is there is all:
sudo apt autoremove
dpkg -l | grep '^rc' | awk '{print $2}' | sudo xargs dpkg --purge
dpkg -l | grep '^rc' | awk '{print $2}' | xargs sudo apt-get purge
dpkg --get-selections | grep linux-headers && dpkg --get-selections | grep linux-image
then reboot a couple of times.
Kernel Cleanup after Deletion
do these one at a time, dont worry if the first dpkg -l says error etc...just means nothing is there is all:
sudo apt autoremove
dpkg -l | grep '^rc' | awk '{print $2}' | sudo xargs dpkg --purge
dpkg -l | grep '^rc' | awk '{print $2}' | xargs sudo apt-get purge
dpkg --get-selections | grep linux-headers && dpkg --get-selections | grep linux-image
then reboot a couple of times.
Re: /boot partition has no space.
Many thanks for that information. It didn't go very smoothly. I got a messagegm10 wrote: ⤴Sat Jul 21, 2018 6:28 am
If it lists one as loaded, that probably means that it's the kernel that's currently in use. The commanduname -r
will tell you for sure. The commandls -l /vmlinuz
will tell you where the current default kernel is located.
Never ever try to remove the currently active kernel. All the others are free game. If removing them via Update Manager does not work, open up Synaptic and in the sections list select "Kernel and modules". Installed packages are marked with a green square in front. You can now right-click and mark for complete removal every installed package in the "Kernel and modules" section that meets two conditions:There is a possibility that the removal of some packages fails due to lack of space in /boot, but we'll talk about that should it happen.
- It has a version number in the name ("Package" column)
- The version number ("Installed Version" column) is different from the one output by the
uname -r
command. Note that if the command outputs something like 4.4.0-130-generic and the "Installed Version" column says 4.4.0-130.156 or 4.4.0.130.156, that's still the same version. 4.4.0-127.153 would be a different version.
Code: Select all
E: linux-image-extra-4.4.0-127-generic: subprocess installed post-removal script returned error exit status 1
E: linux-image-extra-4.4.0-111-generic: subprocess installed post-removal script returned error exit status 1
I have managed to clear 87Mb for my /boot partition, and can make more space since I know how.
Thanks to the many contributors to this discussion. It has been immeasurably useful to me.
Re: /boot partition has no space.
Ok, no problem, this wasn't entirely unexpected due to the lack of free space. You might be able to remove those above normally now since you cleared one of them, but otherwise see if this works:Tuxkid wrote: ⤴Sun Jul 22, 2018 2:16 am Many thanks for that information. It didn't go very smoothly. I got a messagewhen I attempted to delete 4.4.0-111. It appears to me that 127 was garbage and it needed to be deleted before 111 could be deleted. However, despite that, I was able to clear initrd.img-3.16.0-38-generic without any complaint.Code: Select all
E: linux-image-extra-4.4.0-127-generic: subprocess installed post-removal script returned error exit status 1 E: linux-image-extra-4.4.0-111-generic: subprocess installed post-removal script returned error exit status 1
Code: Select all
sudo update-initramfs -d -k 4.4.0-127-generic
sudo update-initramfs -d -k 4.4.0-111-generic
sudo dpkg -P linux-image-4.4.0-127-generic linux-image-extra-4.4.0-127-generic
sudo dpkg -P linux-image-4.4.0-111-generic linux-image-extra-4.4.0-111-generic
Code: Select all
sudo apt-get -f install
sudo apt-get autoremove
sudo update-grub
Re: /boot partition has no space.
4.4.0-127 still appears in /boot.gm10 wrote: ⤴Sun Jul 22, 2018 3:24 am
Ok, no problem, this wasn't entirely unexpected due to the lack of free space. You might be able to remove those above normally now since you cleared one of them, but otherwise see if this works:If the last two commands worked then do:Code: Select all
sudo update-initramfs -d -k 4.4.0-127-generic sudo update-initramfs -d -k 4.4.0-111-generic sudo dpkg -P linux-image-4.4.0-127-generic linux-image-extra-4.4.0-127-generic sudo dpkg -P linux-image-4.4.0-111-generic linux-image-extra-4.4.0-111-generic
If it didn't work and fails on the post-removal script again, let me know and we'll simply temporarily disable that script and try again.Code: Select all
sudo apt-get -f install sudo apt-get autoremove sudo update-grub
Code: Select all
-rw------- 1 root root 7045024 Apr 17 10:10 vmlinuz-4.4.0-121-generic
-rw------- 1 root root 7046048 May 3 21:25 vmlinuz-4.4.0-124-generic
-rw------- 1 root root 7053328 May 20 04:29 vmlinuz-4.4.0-127-generic
Code: Select all
nvidia_340_uvm.ko:
- Uninstallation
- Deleting from: /lib/modules/4.4.0-127-generic/kernel/drivers/video/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
depmod....
DKMS: uninstall completed.
dkms: removing: virtualbox-guest 4.3.36 (4.4.0-127-generic) (x86_64)
Does that complicate matters?
Re: [Solved] /boot partition has no space.
Shouldn't be a problem.
Did you get that post-removal script error message again though? That was the immediate thing I wanted to fix with those commands. If you didn't, then you should now be able to remove the remaining kernel packages via Synaptic. We'll clean up whatever is left manually afterwards, if anything.
Did you get that post-removal script error message again though? That was the immediate thing I wanted to fix with those commands. If you didn't, then you should now be able to remove the remaining kernel packages via Synaptic. We'll clean up whatever is left manually afterwards, if anything.
Re: [Solved] /boot partition has no space.
No. There is only 121 and 124 present and I have 140Mb of space on that partition.gm10 wrote: ⤴Mon Jul 23, 2018 4:36 am Shouldn't be a problem.
Did you get that post-removal script error message again though? That was the immediate thing I wanted to fix with those commands. If you didn't, then you should now be able to remove the remaining kernel packages via Synaptic. We'll clean up whatever is left manually afterwards, if anything.
Do I need to update grub again?
Thanks for all the help.