/boot full unable to clean successfully
Hi, I know this has been discussed and fixed in other forums/posts but I cannot seem to get any of the documentation I have read on this issue to fix my problem. Can someone please help?
FYI - I am a novice at linux
The company I work for has a Ubuntu 16.04 LTS web server hosting several JOOMLA websites. Recently it came to my attention through Webmin our /boot volume is full. Yikes! I have tried several different posts/suggestions on the issue but all have failed.
When I remove the kernels and try to run "sudo apt -f install" it reinstalls all the kernels due to unmet dependencies or something similar. I could really use 5 year old instructions at this point to help sort this mess out. Any help would be greatly appreciated.
My goal is to successfully clean the /boot and then update.
Thanks in advance!
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Ubuntu Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Revision history for this message
|
#1 |
For diagnostic purposes please provide the output of the commands
uname -a
lsb_release -crid
ls -l /boot
dpkg -l | grep ' linux-i'
df -h
(In case that you see the need to hide certain information from the public, you are free to obfuscate it - as long as the data that are required for diagnostics stay readable.)
Revision history for this message
|
#2 |
Thanks you for responding,I apologize about the delay in response, I had to type this all out as I could not find a way to copy from my terminal on the VM to another source:
uname -a
Linux NASBUBUNTU 4.4.0-164-generic #192-Ubuntu SMP Fri Sep 13 12:02:50 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial
ls -l /boot
total 960496
-rw-r--r-- 1 root root 1252309 Oct 24 2018 abi-4.4.
-rw-r--r-- 1 root root 1252309 Nov 14 2018 abi-4.4.
-rw-r--r-- 1 root root 1252429 Dec 5 2018 abi-4.4.
-rw-r--r-- 1 root root 1252376 Jan 16 2019 abi-4.4.
-rw-r--r-- 1 root root 190611 Oct 24 2018 config-
-rw-r--r-- 1 root root 190611 Nov 14 2018 config-
-rw-r--r-- 1 root root 190611 Dec 5 2018 config-
-rw-r--r-- 1 root root 190580 Jan 16 2019 config-
-rw-r--r-- 1 root root 190560 Feb 7 2019 config-
-rw-r--r-- 1 root root 190580 Mar 26 2019 config-
-rw-r--r-- 1 root root 190862 Apr 3 2019 config-
-rw-r--r-- 1 root root 190862 May 7 2019 config-
-rw-r--r-- 1 root root 190871 May 29 15:11 config-
-rw-r--r-- 1 root root 190871 June 11 04:47 config-
-rw-r--r-- 1 root root 190871 June 25 01:43 config-
-rw-r--r-- 1 root root 190871 July 23 06:05 config-
-rw-r--r-- 1 root root 190943 Aug 1 12:47 config-
-rw-r--r-- 1 root root 190973 Aug 27 04:24 config-
-rw-r--r-- 1 root root 190973 Sep 13 08:29 config-
-rw-r--r-- 1 root root 190973 Sep 17 15:18 config-
drwxr-xr-x 5 root root 4096 Sep 18 01:49 grub
-rw-r--r-- 1 root root 18050833 Dec 12 2018 initrd.
-rw-r--r-- 1 root root 18100094 Dec 12 2018 initrd.
-rw-r--r-- 1 root root 18136042 Dec 12 2018 initrd.
-rw-r--r-- 1 root root 18134435 Dec 12 2018 initrd.
-rw-r--r-- 1 root root 18136404 Dec 12 2018 initrd.
-rw-r--r-- 1 root root 18134681 Dec 12 2018 initrd.
-rw-r--r-- 1 root root 18134687 Dec 12 2018 initrd.
-rw-r--r-- 1 root root 18141564 Dec 12 2018 initrd.
-rw-r--r-- 1 root root 40754033 Jul 19 01:52 initrd.
-rw-r--r-- 1 root root 40747007 Jul 19 01:51 initrd.
-rw-r--r-- 1 root root 40747009 Jul 19 01:51 initrd.
-rw-r--r-- 1 root root 40764929 Jul 19 01:50 initrd.
-rw-r--r-- 1 root root 40764147 Jul 19 01:50 initrd.
-rw-r--r-- 1 root root 40771776 Jul 19 01:49 initrd.
-rw-r--r-- 1 root root 40771314 Jul 19 01:49 initrd.
-rw-r--r-- 1 root root 40763262 Jul 19 01:48 initrd.
-rw-r--r-- 1 root root 40764571 Jul 19 01:48 initrd.
-rw-r--r-- 1 root root 40767807 Jul 19 01:48 initrd.
-rw-r--r-- 1 root root 40768715 Jul 19 01:47 initrd.
-rw-r--r-- 1 root root 40774202 Jul 25 01:49 initrd.
-rw-r--r-- 1 root root 40786072 Aug 14 01:50 initrd.
-rw-r--r-- 1 root root 40783652 Sep 3 01:51 initrd.
-rw-r--r-- 1 root root 40785985 Sep 18 01:49 initrd.
-rw-r--r-- 1 root root 10527127 Jul 19 01:52 initrd.
-rw-r--r-- 1 root root 37838848 Apr 9 2018 initrd.
drwx------ 2 root root 16384 May 1 2017 lost+found
-rw-r--r-- 1 root root 255 Oct 24 2018 retpoline-
-rw-r--r-- 1 root root 255 Nov 14 2018 retpoline-
-rw-r--r-- 1 root root 255 Dec 5 2018 retpoline-
-rw-r--r-- 1 root root 255 Jan 16 2019 retpoline-
-rw------- 1 root root 3904765 Oct 24 2018 System.
-rw------- 1 root root 3905265 Nov 14 2018 System.
-rw------- 1 root root 3905747 Dec 5 2018 System.
-rw------- 1 root root 3904797 Jan 16 2019 System.
-rw------- 1 root root 3905647 Feb 7 2019 System.
-rw------- 1 root root 3906115 Mar 26 2019 System.
-rw------- 1 root root 3906510 Apr 3 2019 System.
-rw------- 1 root root 3907764 May 7 2019 System.
-rw------- 1 root root 3908727 May 29 15:11 System.
-rw------- 1 root root 3908794 Jun 11 04:47 System.
-rw------- 1 root root 3908872 Jun 25 01:43 System.
-rw------- 1 root root 3909878 Jul 23 06:05 System.
-rw------- 1 root root 3910823 Aug 1 12:47 System.
-rw------- 1 root root 3911629 Aug 27 04:24 System.
-rw------- 1 root root 3911629 Sep 13 04:24 System.
-rw------- 1 root root 3911756 Sep 17 15:18 System.
-rw------- 1 root root 7168736 Oct 24 2018 vmlinuz-
-rw------- 1 root root 7169888 Nov 14 2018 vmlinuz-
-rw------- 1 root root 7171392 Dec 5 2018 vmlinuz-
-rw------- 1 root root 7184032 Jan 16 2019 vmlinuz-
-rw------- 1 root root 7190840 Feb 12 2019 vmlinuz-
-rw------- 1 root root 7188984 Mar 27 2019 vmlinuz-
-rw------- 1 root root 7197208 Apr 3 2019 vmlinuz-
-rw------- 1 root root 7196216 May 14 13:09 vmlinuz-
-rw------- 1 root root 7198616 May 30 03:28 vmlinuz-
-rw------- 1 root root 7198776 Jun 17 12:19 vmlinuz-
-rw------- 1 root root 7199000 Jun 25 11:58 vmlinuz-
-rw------- 1 root root 7202616 Jul 23 11:08 vmlinuz-
-rw------- 1 root root 7203416 Aug 6 12:34 vmlinuz-
-rw------- 1 root root 7206200 Aug 28 08:03 vmlinuz-
-rw------- 1 root root 7206264 Sep 17 14:28 vmlinuz-
dpkg -l | grep 'linux-i'
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
ii linux-image-
ii linux-image-
ii linux-image-
ii linux-image-
ii linux-image-
ii linux-image-
ii linux-image-
ii linux-image-
ii linux-image-
ii linux-image-
ii linux-image-
ii linux-image-
ii linux-image-
ii linux-image-
ii linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
rc linux-image-
ii linux-image-
ii linux-image-
ii linux-image-
ii linux-image-
rc linux-image-
rc linux-image-
iU linux-image-generic 4.4.0-166.174
df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.8G 0 3.8G 0% /dev
tmpfs 779M 8.7M 770M 2% /run
/dev/sda1 182G 11G 161G 7% /
tmpfs 3.9G 132K 3.9G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda6 967M 947M 0 100% /boot
tmpfs 779M 0 779 0% /run/user/1000
Revision history for this message
|
#3 |
I added a comment, was I supposed to press "I'm providing more information"
Revision history for this message
|
#4 |
General remark to avoid retyping:
What you could have done (or might do in future) is redirecting all output to a file,
e.g.
uname -a | tee mytempfile.txt
lsb_release -crid | tee -a mytempfile.txt #note the -a for append for subsequent commands
etc.
and then uploading that file to pastebin.ubuntu.com with the command
pastebinit mytempfile.txt
This last command will tell you an URL which you can type into this question document, and we can then see your output.
For your space problem:
I see some obsolete files that can be removed:
sudo rm /boot/*.old-dkms
sudo rm /boot/initrd.
sudo rm /boot/*
This should give enough free space that the package management will work again.
Then try
sudo dpkg --purge linux-image-
sudo dpkg --configure -a
and report the results.
Revision history for this message
|
#5 |
sudo dpkg -P linux-image-
sudo dpkg -P linux-image-
sudo dpkg -P linux-image-
sudo dpkg -P linux-image-
sudo dpkg -P linux-image-
sudo dpkg -P linux-image-
sudo dpkg -P linux-image-
sudo dpkg -P linux-image-
sudo dpkg -P linux-image-
sudo dpkg -P linux-image-
sudo dpkg -P linux-image-
sudo dpkg -P linux-image-
sudo dpkg -P linux-image-
sudo dpkg -P linux-image-
sudo dpkg -P linux-image-
sudo dpkg -P linux-image-
sudo dpkg -P linux-image-
sudo dpkg -P linux-image-
sudo dpkg -P linux-image-
Will also help
Revision history for this message
|
#6 |
Manfred,
Thank you fro your patience and help, I thought I could run the output command at the end, that didnt work so I printed the screen and uploaded here:
Im not certain but is there still an issue? I do have 171mb free on the boot drive so thats good.
actionparsnip, thank you for your suggestions.
Revision history for this message
|
#7 |
What is the output of:
df -h
Thanks
Revision history for this message
|
#9 |
Why make a pastebin? The forum is text based and there is no limit to posts so why not just post it in line?
You have 20% free on /boot
If you remove old kernels then it will free more space
Revision history for this message
|
#10 |
Hey,
I have a HyperV VM of Ubuntu, I have no way of copy text from terminal to clipboard that I know of. So do I run the commands you posted earlier? I am a novice at linux, please be as detailed as possible.
Also what do the messages of my last image above mean.....
dpkg: error processing package linux-image-generic (--configure)
It says that multiple times with different versions on each, should I be concerned about this?
Thanks
Revision history for this message
|
#11 |
Your uploaded image shows some missing dependencies, such that the command "sudo dpkg --configure" failed. There is already some free space on /boot, but I suggest to free some more first, end then try installing the missing packages.
Run the following commands
sudo dpkg --purge linux-image-
sudo dpkg --purge linux-image-
sudo apt install -f
and report what the last five lines of the last command are.
Revision history for this message
|
#12 |
Ok when I run
sudo dpkg --purge linux-image-
I got this:
dpkg: dependency problems prevent removal of linux-image-
linux-
dpkg: error processing package linux-image-
dependcy problems - not removing
dpkg: warning: ignoring request to remove linux-image-
Errors were encountered while processing:
linux-
I have not run any other of your posted commands since this failed.
Thanks
Revision history for this message
|
#13 |
Try the other way round
sudo dpkg --purge linux-image-
Revision history for this message
|
#14 |
Manfred,
Seriously thank you for your patience and help. I was able to run those commands the other way, when I run:
sudo apt install -f
These are the last five line, I have not proceeded:
0 upgraded, 3 newly installed, 0 to remove and 136 not upgraded.
4 not fully installed or removed
Need to get 0 B/25.8 MB of archives.
After this operation, 74.2 MB of additional disk space will be used.
Do you want to continue [Y/n]
I am assuming I should continue?
Thanks
Revision history for this message
|
#15 |
Yes, press enter to continue. And at the end tell us whether there is success, or iof there still are error messages.
Revision history for this message
|
#17 |
When looking at the Webmin URL it appears I should reboot, should I do that now or wait?
Revision history for this message
|
#18 |
Ok, no error shown, and all broken dependencies seem to be resolved. I assume that all normal package management commands will work again.
My suggestion is that you try rebooting whenever convenient, and checking the kernel version (with the command "uname -a") afterwards. It should then be 4.4.0-166.
What you also should do (if rebooting into the new kernel is working well):
1. purge the obsolete versions of the kernel packages, e.g. with the command
sudo apt --purge autoremove
2. install all available package updates, e.g. with the command
sudo apt full-upgrade
Revision history for this message
|
#19 |
Ok done,
It appears only 171MB are free in the /boot, how do I free up more of that space so this doesnt happen again?
Is there a better way of maintaining the /boot that I should learn about?
Thank you for you help
Revision history for this message
|
#20 |
Have you already executed the command "sudo apt --purge autoremove"?
If yes, then this can be caused by a known problem.
What is the contents of the file
/etc/apt/
(upload it to pastebin)
and what is now the output of
uname -a
and what is the output of
dpkg -l | grep ' linux-'
?
Revision history for this message
|
#21 |
Ok,
I had already run the command
sudo apt --purge autoremove
When that ran I thought it said it would free up 603MB, but that never re-appeared on the /boot
When I run
cd /etc/apt/
I get:
-bash: cd: /etc/apt/
uname -a
4.4.0-166-generic
Output of
dpkg -l | grep ' linux-' | tee mytempfile.txt
http://
Thank you
Revision history for this message
|
#22 |
to see the contents of a file you have to use the command cat
cat /etc/apt/
(or to upload: "pastbinit /etc/apt/
Please also show the output of the command
apt-mark showmanual linux-*
Revision history for this message
|
#23 |
Here it is
http://
and the next command you request output for
http://
Thanks
Revision history for this message
|
#24 |
Ok, as expected. several kernel packages are wrongly marked as "manually installed" (a known problem).
To reset the apt-mark flags on the packages and remove all obsolete kernel packages issue the following commands:
sudo apt-mark auto linux-headers-4*
sudo apt-mark auto linux-image-4*
sudo apt-mark auto linux-image-
sudo apt-mark auto linux-modules-*
sudo apt --purge autoremove
The commands ending with '*' will complain "... cannot be marked as it is not installed", but that is ok.
The last command will produce lots of output. If you look closely you should see that the list of grub options becomes shorter and shorter, until there area only two or three pairs left at the end.
Finally as verification execute the command
df -h
Result should be that the space usage of boot has gone down to about 20 or 30 %.
And the command
ls -l /boot
should show only packages with three version numbers containing -164-, -165- and -166-.
Revision history for this message
|
#25 |
Manfred,
I apologize for the delay, I will be getting back to this today and will let you know my results.
Thank you
Revision history for this message
|
#26 |
Manfred,
It appears I have 69% free on boot, nice! Here is the output of "ls -l /boot"
http://
I did notice there were old-dkms of 139-161, do I need to do anything with those?
Thanks
Revision history for this message
|
#27 |
The /boot/*.old-dkms files are obsolete and should also be deleted (already recommended in comment #4).
In case that they re-appear (e.g. after an upgrade that installs a new version of the kernel), then there seems to be some obsolete Information in the dkms configuration.
What is the output of
dkms status
Revision history for this message
|
#29 |
Looks good. What is the output of:
df -h
Thanks
Revision history for this message
|
#30 |
Agree with actionparsnip.
Looks good.
Possible further actions:
- verify whether all available package updates have been installed
(commands sudo apt update; apt list --upgradeable)
- remove the obsolete config files for packages that have already been removed
(those listed by the command dpkg -l | grep "^rc")
Revision history for this message
|
#32 |
70% used. Looks like Manfred saved the day
Revision history for this message
|
#33 |
He did!
Manfred,
Serious kudos to you my friend, thank you for your patience and continued support/help through this process. If I could buy you a beer I would. This help was greatly appreciated!!
-daniel
Revision history for this message
|
#34 |
619 MB used on /boot is still more than expected,
Are those initrd.
There are several discussions and bug Reports about these old-dkms files, and all agree that they can (and should) be deleted - at least those für kernel versions that already have been uninstalled.
https:/
Bug #1515513
Revision history for this message
|
#35 |
Manfred,
I am out of office today but will be back tomorrow and will update you on the the status of the old-dkms files.
Thanks
-daniel
Revision history for this message
|
#36 |
Manfred,
Sorry for the long delay, I had a week long conference to attend last week. So I am back in office and it appears I am back down to 21% free on /boot. Can we try to clean up the old dkms files or do you have a better suggestion?
Thanks
-daniel
Revision history for this message
|
#37 |
There is no need for those *.old-dkms files. They are not serving any purpsose (except for shor moment during the update run) and are just occupying space.
For diagnostic purposes, what is currently the output of the commands
df -h
ls -l /boot
Revision history for this message
|
#38 |
Hi Manfred, Thank you for your quick response.
df -h
http://
ls -l /boot
http://
-daniel
Revision history for this message
|
#39 |
Execute
sudo rm -v /boot/initrd.
and then repeat
df -h
What is now the usage percentage of /dev/sda6 ?
Revision history for this message
|
#40 |
Hi Mandfred,
When I run:
sudo rm -v /boot/initrd.
I get:
rm: cannot remove '/boot/
Output of:
df -h
http://
Thanks
Revision history for this message
|
#41 |
Strange.
http://
What is the output of
ls -l /boot/initrd.
Revision history for this message
|
#42 |
Manfred,
When I try that command I get:
ls: cannot access '/boot/
Thanks
-daniel
Revision history for this message
|
#43 |
and what is now the output of
ls -l /boot/
?
Revision history for this message
|
#45 |
Strange. There must be some kind of mistyping.
What is the output of
ls -l /boot/init*dkms
Revision history for this message
|
#47 |
ok, then execute the command:
sudo rm -v /boot/init*dkms
(no need to copy/paste the output, but check that only those *old-dkms files have been deleted)
What free percentage do you then have on /deb/sda6 ?
Revision history for this message
|
#48 |
Manfred,
Ok, looking better. It removed 139-165 and I now have 742mb of the 933mb on /dev/sda6 only 160mb used.
Kudos man!!
-daniel
Revision history for this message
|
#49 |
Ok, target achieved.
For the future:
If there again are some old-dkms files in the /boot directory after the next kernel version upgrade, then this should be investigated.
After the installation of a new version of the kernel packages, you should (after a certain testing period) run the command "sudo apt --purge autoremove" to uninstall the oldest version of the kernel packages.
I think that's it.
If you have further questions, don't hesitate to ask.
Revision history for this message
|
#50 |
Manfred,
Again, thank you for your continued support and help through this issue, I even managed to learn a few things so thank you.
-daniel
Revision history for this message
|
#51 |
The very last thing:
please mark this question document as solved.
Can you help with this problem?
Provide an answer of your own, or ask Daniel Clarke for more information if necessary.