Boot partition is full, running old kernel, new kernels “waiting” - safe to reboot? [duplicate]
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
This question already has an answer here:
How can I remove old kernels/install new ones when /boot is full?
7 answers
This is not a duplicate as suggested above - for why, see the text below.
I have the strange situation that an "old" kernel is running (in fact it is the OLDEST):
uname -r
> 4.13.0-43-generic
Using a command to show available kernels I only see NEWER kernels(!):
sudo dpkg --list 'linux-image*'|awk '{ if ($1=="ii") print $2}'|grep -v `uname -r`
linux-image-4.13.0-45-generic
linux-image-4.15.0-24-generic
linux-image-4.15.0-29-generic
linux-image-4.15.0-30-generic
linux-image-4.15.0-32-generic
linux-image-4.15.0-33-generic
linux-image-4.15.0-34-generic
linux-image-extra-4.13.0-45-generic
It looks as if the system never rebooted to "get to the new kernels" - I see for example that in the root dir:
ls -al
lrwxrwxrwx 1 root root 33 Sep 11 06:02 initrd.img -> boot/initrd.img-4.15.0-34-generic
lrwxrwxrwx 1 root root 33 Sep 11 06:02 initrd.img.old -> boot/initrd.img-4.15.0-33-generic
lrwxrwxrwx 1 root root 30 Sep 11 06:02 vmlinuz -> boot/vmlinuz-4.15.0-34-generic
lrwxrwxrwx 1 root root 30 Sep 11 06:02 vmlinuz.old -> boot/vmlinuz-4.15.0-33-generic
which kind of suggests this to me (I'm not an ubuntu guru)...
This is not a duplicate question but a new question because I have no old kernels to delete. Other answers detail deleting old kernels with version numbers less than the current kernel.
The running kernel is the oldest listed. I was worried about deleting kernels newer than the current kernel - between the current kernel and the newest and the kernel that was wanting to be installed - but blocked because of 100% full boot partition.
All answers using "apt" do not work when the boot partition is 100% full so please ignore them :)
From my original question:
So I'm tempted to reboot the machine. But is this dangerous - since the boot partition is 100% full.
"Normally" I'd delete old kernels etc. to free up space.
What's the best/safest way to proceed here?
I ask because it seems I "should" make some space (see Will ubuntu boot if the /boot partition is full?)... but how in this particular case?
THIS IS HOW I SOLVED the problem:
In the end as apt autoremove
etc. do not work in this situation I followed the hints given here:https://gist.github.com/ipbastola/2760cfc28be62a5ee10036851c654600
(See: "Case II: Can't Use apt i.e. /boot is 100% full")
In my case I deleted a newer kernel by hand to release space in /boot
in order to be able to proceed:
cd /boot
ls *4.13.0-45*
rm -rf *4.13.0-45*
df -h
sudo apt-get -f install
sudo apt-get autoremove
sudo update-grub
more grub/grub.cfg
reboot
df -h
shows boot no longer 100% full
With more grub/grub.cfg
you can check if the system is catering for the correct kernels (i.e. whether the update grub
worked well)
kernel boot-partition
marked as duplicate by user535733, user68186, Fabby, karel, Eric Carvalho Feb 13 at 13:04
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
How can I remove old kernels/install new ones when /boot is full?
7 answers
This is not a duplicate as suggested above - for why, see the text below.
I have the strange situation that an "old" kernel is running (in fact it is the OLDEST):
uname -r
> 4.13.0-43-generic
Using a command to show available kernels I only see NEWER kernels(!):
sudo dpkg --list 'linux-image*'|awk '{ if ($1=="ii") print $2}'|grep -v `uname -r`
linux-image-4.13.0-45-generic
linux-image-4.15.0-24-generic
linux-image-4.15.0-29-generic
linux-image-4.15.0-30-generic
linux-image-4.15.0-32-generic
linux-image-4.15.0-33-generic
linux-image-4.15.0-34-generic
linux-image-extra-4.13.0-45-generic
It looks as if the system never rebooted to "get to the new kernels" - I see for example that in the root dir:
ls -al
lrwxrwxrwx 1 root root 33 Sep 11 06:02 initrd.img -> boot/initrd.img-4.15.0-34-generic
lrwxrwxrwx 1 root root 33 Sep 11 06:02 initrd.img.old -> boot/initrd.img-4.15.0-33-generic
lrwxrwxrwx 1 root root 30 Sep 11 06:02 vmlinuz -> boot/vmlinuz-4.15.0-34-generic
lrwxrwxrwx 1 root root 30 Sep 11 06:02 vmlinuz.old -> boot/vmlinuz-4.15.0-33-generic
which kind of suggests this to me (I'm not an ubuntu guru)...
This is not a duplicate question but a new question because I have no old kernels to delete. Other answers detail deleting old kernels with version numbers less than the current kernel.
The running kernel is the oldest listed. I was worried about deleting kernels newer than the current kernel - between the current kernel and the newest and the kernel that was wanting to be installed - but blocked because of 100% full boot partition.
All answers using "apt" do not work when the boot partition is 100% full so please ignore them :)
From my original question:
So I'm tempted to reboot the machine. But is this dangerous - since the boot partition is 100% full.
"Normally" I'd delete old kernels etc. to free up space.
What's the best/safest way to proceed here?
I ask because it seems I "should" make some space (see Will ubuntu boot if the /boot partition is full?)... but how in this particular case?
THIS IS HOW I SOLVED the problem:
In the end as apt autoremove
etc. do not work in this situation I followed the hints given here:https://gist.github.com/ipbastola/2760cfc28be62a5ee10036851c654600
(See: "Case II: Can't Use apt i.e. /boot is 100% full")
In my case I deleted a newer kernel by hand to release space in /boot
in order to be able to proceed:
cd /boot
ls *4.13.0-45*
rm -rf *4.13.0-45*
df -h
sudo apt-get -f install
sudo apt-get autoremove
sudo update-grub
more grub/grub.cfg
reboot
df -h
shows boot no longer 100% full
With more grub/grub.cfg
you can check if the system is catering for the correct kernels (i.e. whether the update grub
worked well)
kernel boot-partition
marked as duplicate by user535733, user68186, Fabby, karel, Eric Carvalho Feb 13 at 13:04
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Perhaps you couldsudo apt autoremove
which should remove older kernels, leave the current running kernel and the latest update. This will free space, but not fix the booting into the old kernel problem.
– Charles Green
Feb 12 at 16:36
add a comment |
This question already has an answer here:
How can I remove old kernels/install new ones when /boot is full?
7 answers
This is not a duplicate as suggested above - for why, see the text below.
I have the strange situation that an "old" kernel is running (in fact it is the OLDEST):
uname -r
> 4.13.0-43-generic
Using a command to show available kernels I only see NEWER kernels(!):
sudo dpkg --list 'linux-image*'|awk '{ if ($1=="ii") print $2}'|grep -v `uname -r`
linux-image-4.13.0-45-generic
linux-image-4.15.0-24-generic
linux-image-4.15.0-29-generic
linux-image-4.15.0-30-generic
linux-image-4.15.0-32-generic
linux-image-4.15.0-33-generic
linux-image-4.15.0-34-generic
linux-image-extra-4.13.0-45-generic
It looks as if the system never rebooted to "get to the new kernels" - I see for example that in the root dir:
ls -al
lrwxrwxrwx 1 root root 33 Sep 11 06:02 initrd.img -> boot/initrd.img-4.15.0-34-generic
lrwxrwxrwx 1 root root 33 Sep 11 06:02 initrd.img.old -> boot/initrd.img-4.15.0-33-generic
lrwxrwxrwx 1 root root 30 Sep 11 06:02 vmlinuz -> boot/vmlinuz-4.15.0-34-generic
lrwxrwxrwx 1 root root 30 Sep 11 06:02 vmlinuz.old -> boot/vmlinuz-4.15.0-33-generic
which kind of suggests this to me (I'm not an ubuntu guru)...
This is not a duplicate question but a new question because I have no old kernels to delete. Other answers detail deleting old kernels with version numbers less than the current kernel.
The running kernel is the oldest listed. I was worried about deleting kernels newer than the current kernel - between the current kernel and the newest and the kernel that was wanting to be installed - but blocked because of 100% full boot partition.
All answers using "apt" do not work when the boot partition is 100% full so please ignore them :)
From my original question:
So I'm tempted to reboot the machine. But is this dangerous - since the boot partition is 100% full.
"Normally" I'd delete old kernels etc. to free up space.
What's the best/safest way to proceed here?
I ask because it seems I "should" make some space (see Will ubuntu boot if the /boot partition is full?)... but how in this particular case?
THIS IS HOW I SOLVED the problem:
In the end as apt autoremove
etc. do not work in this situation I followed the hints given here:https://gist.github.com/ipbastola/2760cfc28be62a5ee10036851c654600
(See: "Case II: Can't Use apt i.e. /boot is 100% full")
In my case I deleted a newer kernel by hand to release space in /boot
in order to be able to proceed:
cd /boot
ls *4.13.0-45*
rm -rf *4.13.0-45*
df -h
sudo apt-get -f install
sudo apt-get autoremove
sudo update-grub
more grub/grub.cfg
reboot
df -h
shows boot no longer 100% full
With more grub/grub.cfg
you can check if the system is catering for the correct kernels (i.e. whether the update grub
worked well)
kernel boot-partition
This question already has an answer here:
How can I remove old kernels/install new ones when /boot is full?
7 answers
This is not a duplicate as suggested above - for why, see the text below.
I have the strange situation that an "old" kernel is running (in fact it is the OLDEST):
uname -r
> 4.13.0-43-generic
Using a command to show available kernels I only see NEWER kernels(!):
sudo dpkg --list 'linux-image*'|awk '{ if ($1=="ii") print $2}'|grep -v `uname -r`
linux-image-4.13.0-45-generic
linux-image-4.15.0-24-generic
linux-image-4.15.0-29-generic
linux-image-4.15.0-30-generic
linux-image-4.15.0-32-generic
linux-image-4.15.0-33-generic
linux-image-4.15.0-34-generic
linux-image-extra-4.13.0-45-generic
It looks as if the system never rebooted to "get to the new kernels" - I see for example that in the root dir:
ls -al
lrwxrwxrwx 1 root root 33 Sep 11 06:02 initrd.img -> boot/initrd.img-4.15.0-34-generic
lrwxrwxrwx 1 root root 33 Sep 11 06:02 initrd.img.old -> boot/initrd.img-4.15.0-33-generic
lrwxrwxrwx 1 root root 30 Sep 11 06:02 vmlinuz -> boot/vmlinuz-4.15.0-34-generic
lrwxrwxrwx 1 root root 30 Sep 11 06:02 vmlinuz.old -> boot/vmlinuz-4.15.0-33-generic
which kind of suggests this to me (I'm not an ubuntu guru)...
This is not a duplicate question but a new question because I have no old kernels to delete. Other answers detail deleting old kernels with version numbers less than the current kernel.
The running kernel is the oldest listed. I was worried about deleting kernels newer than the current kernel - between the current kernel and the newest and the kernel that was wanting to be installed - but blocked because of 100% full boot partition.
All answers using "apt" do not work when the boot partition is 100% full so please ignore them :)
From my original question:
So I'm tempted to reboot the machine. But is this dangerous - since the boot partition is 100% full.
"Normally" I'd delete old kernels etc. to free up space.
What's the best/safest way to proceed here?
I ask because it seems I "should" make some space (see Will ubuntu boot if the /boot partition is full?)... but how in this particular case?
THIS IS HOW I SOLVED the problem:
In the end as apt autoremove
etc. do not work in this situation I followed the hints given here:https://gist.github.com/ipbastola/2760cfc28be62a5ee10036851c654600
(See: "Case II: Can't Use apt i.e. /boot is 100% full")
In my case I deleted a newer kernel by hand to release space in /boot
in order to be able to proceed:
cd /boot
ls *4.13.0-45*
rm -rf *4.13.0-45*
df -h
sudo apt-get -f install
sudo apt-get autoremove
sudo update-grub
more grub/grub.cfg
reboot
df -h
shows boot no longer 100% full
With more grub/grub.cfg
you can check if the system is catering for the correct kernels (i.e. whether the update grub
worked well)
This question already has an answer here:
How can I remove old kernels/install new ones when /boot is full?
7 answers
kernel boot-partition
kernel boot-partition
edited Mar 14 at 17:42
James Cook
asked Feb 12 at 11:28
James CookJames Cook
11
11
marked as duplicate by user535733, user68186, Fabby, karel, Eric Carvalho Feb 13 at 13:04
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by user535733, user68186, Fabby, karel, Eric Carvalho Feb 13 at 13:04
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Perhaps you couldsudo apt autoremove
which should remove older kernels, leave the current running kernel and the latest update. This will free space, but not fix the booting into the old kernel problem.
– Charles Green
Feb 12 at 16:36
add a comment |
Perhaps you couldsudo apt autoremove
which should remove older kernels, leave the current running kernel and the latest update. This will free space, but not fix the booting into the old kernel problem.
– Charles Green
Feb 12 at 16:36
Perhaps you could
sudo apt autoremove
which should remove older kernels, leave the current running kernel and the latest update. This will free space, but not fix the booting into the old kernel problem.– Charles Green
Feb 12 at 16:36
Perhaps you could
sudo apt autoremove
which should remove older kernels, leave the current running kernel and the latest update. This will free space, but not fix the booting into the old kernel problem.– Charles Green
Feb 12 at 16:36
add a comment |
1 Answer
1
active
oldest
votes
Run these commands, in that order, one by one and check space every time.
sudo apt autoremove
then
sudo apt autoclean
and if not enough space yet run:
sudo apt clean
and
sudo update-grub
must work.
after reboot in new kernel confirm that the latest kernels are fully installed. by running:
uname -r
and
sudo update-initramfs -u -k all
then run
sudo apt purge $(dpkg -l|egrep 'linux-image-[0-9]|linux-headers-[0-9]'|awk '{print $3,$2}'|grep -v `uname -r|cut -f1,2 -d"-"`|sort -nr|tail -n +4|awk '{ print $2}')
this will remove all old kernels except the one you are using and the latest one.
Edit
Note: You can run sudo update-initramfs -u -k all
to confirm that the latest kernels are fully installed, before all these commands.
I don't understand the purpose of the 'autoclean' step, since the following step ('clean') will delete all cached packages anyway.
– user535733
Feb 12 at 13:18
That's why I said run the commands and check. Maybe you don't need to run 'clean'.
– Vijay
Feb 12 at 14:08
1
Right. I think you should clarify that in the answer.
– user535733
Feb 12 at 14:09
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Run these commands, in that order, one by one and check space every time.
sudo apt autoremove
then
sudo apt autoclean
and if not enough space yet run:
sudo apt clean
and
sudo update-grub
must work.
after reboot in new kernel confirm that the latest kernels are fully installed. by running:
uname -r
and
sudo update-initramfs -u -k all
then run
sudo apt purge $(dpkg -l|egrep 'linux-image-[0-9]|linux-headers-[0-9]'|awk '{print $3,$2}'|grep -v `uname -r|cut -f1,2 -d"-"`|sort -nr|tail -n +4|awk '{ print $2}')
this will remove all old kernels except the one you are using and the latest one.
Edit
Note: You can run sudo update-initramfs -u -k all
to confirm that the latest kernels are fully installed, before all these commands.
I don't understand the purpose of the 'autoclean' step, since the following step ('clean') will delete all cached packages anyway.
– user535733
Feb 12 at 13:18
That's why I said run the commands and check. Maybe you don't need to run 'clean'.
– Vijay
Feb 12 at 14:08
1
Right. I think you should clarify that in the answer.
– user535733
Feb 12 at 14:09
add a comment |
Run these commands, in that order, one by one and check space every time.
sudo apt autoremove
then
sudo apt autoclean
and if not enough space yet run:
sudo apt clean
and
sudo update-grub
must work.
after reboot in new kernel confirm that the latest kernels are fully installed. by running:
uname -r
and
sudo update-initramfs -u -k all
then run
sudo apt purge $(dpkg -l|egrep 'linux-image-[0-9]|linux-headers-[0-9]'|awk '{print $3,$2}'|grep -v `uname -r|cut -f1,2 -d"-"`|sort -nr|tail -n +4|awk '{ print $2}')
this will remove all old kernels except the one you are using and the latest one.
Edit
Note: You can run sudo update-initramfs -u -k all
to confirm that the latest kernels are fully installed, before all these commands.
I don't understand the purpose of the 'autoclean' step, since the following step ('clean') will delete all cached packages anyway.
– user535733
Feb 12 at 13:18
That's why I said run the commands and check. Maybe you don't need to run 'clean'.
– Vijay
Feb 12 at 14:08
1
Right. I think you should clarify that in the answer.
– user535733
Feb 12 at 14:09
add a comment |
Run these commands, in that order, one by one and check space every time.
sudo apt autoremove
then
sudo apt autoclean
and if not enough space yet run:
sudo apt clean
and
sudo update-grub
must work.
after reboot in new kernel confirm that the latest kernels are fully installed. by running:
uname -r
and
sudo update-initramfs -u -k all
then run
sudo apt purge $(dpkg -l|egrep 'linux-image-[0-9]|linux-headers-[0-9]'|awk '{print $3,$2}'|grep -v `uname -r|cut -f1,2 -d"-"`|sort -nr|tail -n +4|awk '{ print $2}')
this will remove all old kernels except the one you are using and the latest one.
Edit
Note: You can run sudo update-initramfs -u -k all
to confirm that the latest kernels are fully installed, before all these commands.
Run these commands, in that order, one by one and check space every time.
sudo apt autoremove
then
sudo apt autoclean
and if not enough space yet run:
sudo apt clean
and
sudo update-grub
must work.
after reboot in new kernel confirm that the latest kernels are fully installed. by running:
uname -r
and
sudo update-initramfs -u -k all
then run
sudo apt purge $(dpkg -l|egrep 'linux-image-[0-9]|linux-headers-[0-9]'|awk '{print $3,$2}'|grep -v `uname -r|cut -f1,2 -d"-"`|sort -nr|tail -n +4|awk '{ print $2}')
this will remove all old kernels except the one you are using and the latest one.
Edit
Note: You can run sudo update-initramfs -u -k all
to confirm that the latest kernels are fully installed, before all these commands.
edited Feb 12 at 14:37
answered Feb 12 at 13:10
VijayVijay
2,1041822
2,1041822
I don't understand the purpose of the 'autoclean' step, since the following step ('clean') will delete all cached packages anyway.
– user535733
Feb 12 at 13:18
That's why I said run the commands and check. Maybe you don't need to run 'clean'.
– Vijay
Feb 12 at 14:08
1
Right. I think you should clarify that in the answer.
– user535733
Feb 12 at 14:09
add a comment |
I don't understand the purpose of the 'autoclean' step, since the following step ('clean') will delete all cached packages anyway.
– user535733
Feb 12 at 13:18
That's why I said run the commands and check. Maybe you don't need to run 'clean'.
– Vijay
Feb 12 at 14:08
1
Right. I think you should clarify that in the answer.
– user535733
Feb 12 at 14:09
I don't understand the purpose of the 'autoclean' step, since the following step ('clean') will delete all cached packages anyway.
– user535733
Feb 12 at 13:18
I don't understand the purpose of the 'autoclean' step, since the following step ('clean') will delete all cached packages anyway.
– user535733
Feb 12 at 13:18
That's why I said run the commands and check. Maybe you don't need to run 'clean'.
– Vijay
Feb 12 at 14:08
That's why I said run the commands and check. Maybe you don't need to run 'clean'.
– Vijay
Feb 12 at 14:08
1
1
Right. I think you should clarify that in the answer.
– user535733
Feb 12 at 14:09
Right. I think you should clarify that in the answer.
– user535733
Feb 12 at 14:09
add a comment |
Perhaps you could
sudo apt autoremove
which should remove older kernels, leave the current running kernel and the latest update. This will free space, but not fix the booting into the old kernel problem.– Charles Green
Feb 12 at 16:36