overcome full ubuntu 14 boot disk?

Pretty new to linux.  Actually my son set this machine up, but not available to me now and I have trouble.  I get an error message on boot that the boot disk is full.  Now it is so full I cannot even look at installed software, because it throws error messages, inviting to fix it, but just wraps around.

So after some quality Google time I found how to list the disk,  (ls /boot) and it appears I have seven kernels, about the same number of grubs, etc, which I assume is why the boot disk is full.  BTW: it is a partition on a nearly empty 2TB drive,.  Again from a Google hit I tried

    Sudo apt-get autoremove

but it did not cure the issue.  Tried to install synaptic, which is supposed to remove selected kernels, but cannot install anything.  So I don't know if I somehow need to resize the boot disk, delete old kernels, or ???
LVL 1
Mike CaldwellConsultant to IP industryAsked:
Who is Participating?
 
KimputerCommented:
Because you have 0 bytes left, some functions don't work anymore, including all the apt- stuff
Therefore my suggestions still stand:

Either: repartition, more space, commands will work again, longer time span before you run into problems again. After that, commands start working again, and you can follow above expert's commands again.

Or: manually remove some older kernels (which you are really sure you didn't use recently), just by sudo rm -rf /boot/old-kernel-file
You can clean it properly later when commands start working again (again, follow above expert's commands)
0
 
KimputerCommented:
Probably during install, the wrong size was chosen for the boot partition. Resize with a GParted live CD.
0
 
Mike CaldwellConsultant to IP industryAuthor Commented:
Partition was big enough for six months, now it is full of old kernels.

I have no idea how to do what you suggest.  Do I have to resize before I can remove the extra kernels?
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
KimputerCommented:
To repartition, means you won't have troubles for years to come, if the right size is chosen. Since you have 2TB, you obviously have enough space.
In emergency cases just removing the oldest kernels manually will also suffice.
0
 
Mike CaldwellConsultant to IP industryAuthor Commented:
I get that, but it doesn't tell me how to remove the old kernels.
0
 
gheistCommented:
first:
get a bit of space:
rm -rf /tmp/* /var/tmp/* /usr/tmp/*

apt-get autoremove ; apt-get autoclean ; apt-get clean

reboot
0
 
Mike CaldwellConsultant to IP industryAuthor Commented:
What I got was about 100 lines of error messages, all starting with:

rm: cannot remove {long path, etc} : operation not permitted.
0
 
gheistCommented:
You must gain superuser permissions:
$ sudo -s
Password:
# ... (but be careful about what you remove)
0
 
Mike CaldwellConsultant to IP industryAuthor Commented:
Well, seems to have run.  After the reboot I still got the error message that the boot disk has zero bytes.  All of the kernels are still there.  And I had another error message pop up saying there was a problem installing:

linux-image-3.31.0-51-geneeric3.13.0-51.84
0
 
Mike CaldwellConsultant to IP industryAuthor Commented:
autoremove gets:

root@FamilyRoom:~# apt-get autoremove
Reading package lists... Done
Building dependency tree      
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 linux-image-extra-3.13.0-52-generic : Depends: linux-image-3.13.0-52-generic but it is not installed
 linux-image-generic : Depends: linux-image-3.13.0-52-generic but it is not installed
E: Unmet dependencies. Try using -f.
root@FamilyRoom:~# ^C
root@FamilyRoom:~#
0
 
Mike CaldwellConsultant to IP industryAuthor Commented:
autoclean gets:
root@FamilyRoom:~# apt-get autoclean
Reading package lists... Done
Building dependency tree      
Reading state information... Done
0
 
Mike CaldwellConsultant to IP industryAuthor Commented:
But after an hour {clean} still gets  "There is a process still running on this terminal."
0
 
Mike CaldwellConsultant to IP industryAuthor Commented:
And /boot/ still has zero bytes available.
0
 
Mike CaldwellConsultant to IP industryAuthor Commented:
I'm thinking that my current kernel is somewhat messed up, and I have zero bytes free on that drive such that I cannot do anything with it.  What I am wondering is if I could reformat the root partition, then put in a current kernel, but not delete all the rest of my data.  This machine is my media server, so I have TV shows and many movies that I don't want to lose.  So can I format just the logical boot partition?  What do I need to do/have to do that?
0
 
gheistCommented:
You can remove old kernels from any GUI package manager.
Once some three are gone run
apt-get -f install (to solve dependencies)
then
autoremove
0
 
gheistCommented:
removing one initrd file should give enough space to delete old kernels.
But usually it is not with 0 bytes left, so you can uninstall them anyway.
0
 
Mike CaldwellConsultant to IP industryAuthor Commented:
Kimputer: worked!  Manually removed several initrd.img files, then apt-get -f install seems to have installed the latest kernel version (52).  However I still have the abi... Config.... System,map.... and vmlinuz.... images of the initrd.img images I deleted.  Will autoremove clean those up, or do I use the same line command as before but with those file names?
0
 
Mike CaldwellConsultant to IP industryAuthor Commented:
gheist:  "sudo autoremove" gets a "command not found" error.
0
 
gheistCommented:
Reboot with new kernel, then
sudo apt-get autoremove
sudo apt-get autoclean

After find all old kernels
sudo dpkg --get-selections
sudo apt-show-versions
And
apt-get-purge linux-image-* linux-headers-* linux-tools-*
for each in oldest half
0
 
Mike CaldwellConsultant to IP industryAuthor Commented:
I don't understand "for each in oldest half."
0
 
gheistCommented:
make a list of all kernels installed, then chop the old half off.
0
 
Mike CaldwellConsultant to IP industryAuthor Commented:
I am down to three.  Is this manageable?

I want to pursue two other steps:  1) increase the size of the /boot/ partition and 2) configure so that future kernel updates delete the oldest one when done.  To be fair, though, I'll post these as new questions.  The ubuntu machine now restarts with no error messages, so looks safe and sound now.  Thanks to all.
0
 
gheistCommented:
1) not good idea. new kernel comes out every 3 weeks, ubuntu lives 5 years...
2) you can schedule apt-get autoremove -y via cron
0
 
Mike CaldwellConsultant to IP industryAuthor Commented:
Just posted this as two new questions gheist.  Please answer there, and I can award additional points.  Thanks for all the help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.