[sf-lug] NEED INFO ABOUT BOOT SECTOR, SPACE LIMITS

Rick Moen rick at linuxmafia.com
Mon Jul 31 16:50:18 PDT 2017


Quoting Tom Turner (seameadowlake at gmail.com):

> This url might (or might not) provide some relevant information about the
> "boot partition full" problem.
> 
> https://bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/1357093
> 
> The above web-page includes links to other pages reporting the problem.
> 
> I and thousands of others ran into this problem.  There simply was no way
> to clear out space, no "remove type" command would work.

Thanks, Tom.  Quoting:

   Once kernel updates start being released this partition soon fills
   until people are left unable to upgrade.
   [...]

   Especially a problem when setting up systems for clients, who you
   only visit once or twice a year. The kernel updates fill the boot
   partition fast and so users are warned at the start that no space is
   left.
   [...]

   boot partition fills up with updates of kernel.

   autoremove does not remove previous kernels

So, through relying on mostly-automated package maintenance and never
paying attention to details until too late, you accumulate a bunch of 
linux-image-<version>-* packages, almost all of which you have no use for
(and do not use), which overfill /boot.

> The cure was to >back up the data, and >re-install Linux, being certain to
> _not_ choose the LVM option.

Less drastic cure follows.  

1.  Open terminal, do 'sudo su -' to become root.  (This is not the
Ubuntu Way, so if you prefer to use sudo for all such things as follow,
feel free, but I'm not going to write it up that way.)

2.  cd to /boot.  Look around.  You'll probably see a huge bunch of 
initrd.img-* and vmlinuz.* files sitting around.  Note down what's there, 
maybe on a piece of paper.  (Hint:  'ls -alh' is your friend.)

3.  Note in grub.cfg, or whatever the hell Ubuntu uses, which kernel or
kernels you actually use.  Note that down, so you don't accidentally
mess with it.

4.  mv the unneeded initrd.img-* and vmlinuz.* files to /tmp .  The
point of putting them in /tmp is that you can quickly put them back if
necessary.  (Just be sure not to reboot before you're sure you don't
need them, because /tmp is probably a tmpfs = RAMdisk on your system.
If you want to preseve them against reboot, put them somewhere
nonvolatile for temporary storage, like /usr/local .)

5.  Do 'apt-get --purge autoremove'.  Probably won't accomplish much in this
context, because as noted it doesn't automatically remove kernels.  But
the point is to observe what it does and doesn't accomplish.

6.  Do 'df -h /boot' to see whether you've substantially improved free
space in /boot, which you probably did.

7.  Do 'dpkg -l | grep linux-image'.  This will tell you what kernel
binary packages are installed.

8.  Do 'dpkg --purge -r <packagename>' for all the kernel binary
packages you no longer want.

You are done.  _Not_ necessary to reinstall.

And, going forward, don't just ignore what packages you have and treat
this as something that will be automagically done correctly.  In
particular, it's in your interest to occasionally look at the installed
packages list and think 'Do I actually want all this stuff?'  E.g.:

   dpkg -l | less

It couldn't hurt to occasionally do basic housekeeping like 'df -h' to 
make sure you're not running low on space anywhere.  That way, you won't 
suddenly get hit over the head by a problem you've been ignoring for a
long time and has been slowly creeping up on you.


> Another point, I believe that Synaptic is better than apt-get at
> uninstalling old versions of the kernel.

Um... that comparison doesn't actually make sense.  Different categories
of programs.  Synaptic is a gtk+ graphical front-end _only_.  It
needs to invoke apt-get to do actual package operations.

  Synaptic is a graphical package management program for apt. 

(http://www.nongnu.org/synaptic/)



> Mr. Texstar, the guru behind
> PCLinuxOS is adamant that updates should be performed by using Synaptic,
> not apt-get.

Mr. Texstar is welcome to like using his preferred front-end graphical
UI, Synaptic or anything else, but he's still using apt-get if he uses
Synaptic.

Are you sure you're paraphrasing him correctly?  I'd be really surprise
if he were unaware of the basic fact that using Synaptic _is_ using
apt-get.


> More information about the problem, from a post at the above url:
> 
> Begin quote:
> "The issue here isn't so much the absolute space initially allocated to the
> /boot/ LV, it is that the installer allocates 100% of the Volume Groups
> space.
> 
> The great advantage of LVM is that space can by dynamically allocated and
> removed from Logical Volumes as needed.
> 
> If the installer were to leave 5% of the Volume Group unallocated it would
> be possible for the system to detect this out-of-space condition and extend
> the /boot/ LV:

Yeah, that's kind of dumb, _but_ there's nothing wrong with a 200MB
/boot partition.  Just don't overfill it.  Then, you don't have this 
sort of problem.

It's senseless to have six or seven sets of kernel binary images and
matching initrds when you use _one_.  So, Don't Do That, Then.

FWIW, Ubuntu's page is:
https://help.ubuntu.com/community/RemoveOldKernels




More information about the sf-lug mailing list