Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Ubuntu Server Development (http://www.linux-archive.org/ubuntu-server-development/)
-   -   /boot maintenance (http://www.linux-archive.org/ubuntu-server-development/700812-boot-maintenance.html)

Tom H 09-05-2012 02:30 PM

/boot maintenance
 
On Wed, Sep 5, 2012 at 9:44 AM, Dean Henrichsmeyer <dean@ubuntu.com> wrote:
>
> I realize this has been covered in the past but I've been observing more of
> it lately so thought I'd revisit it. Here's the problem I've been observing.
> Service providers that offer dedicated servers running Ubuntu default to
> 100MB /boot partitions. This is true of providers like Peer1, Softlayer,
> etc. Granted, you can fix that by re-provisioning the machine with your own
> partition preferences prior to putting your data/configuration on the host
> but most won't note the potential problem until it's too late.
>
> So what happens is if you use something that keeps the machine up to date
> like Landscape or something of your own, /boot is going to fill up fast. As
> far as I can tell, Ubuntu Server doesn't tell you that you need a reboot
> when a new kernel is installed like Desktop does and it's no time at all
> before /boot is filled up. If you're not monitoring your partitions and/or
> manually house cleaning /boot consistently, you're going to run into
> problems.
>
> I realize the ideal thing would be to get providers to change their defaults
> to something more modern that is in line with the size of today's disks and
> kernels. That being said, I also think it would be really nice to set a
> policy or something on the number of kernels you keep around. I'd like users
> getting dedicated servers running Ubuntu to have a positive experience. I
> don't know if anything is planned in this area but I thought I'd provide
> some feedback in case it factors in.

There was a ubuntu-server thread earlier this year about cleaning up
old kernels via a package. One or two scripts were proposed but I've
forgotten how the discussion ended, if it ended at all.

--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam

"Tyler J. Wagner" 09-05-2012 04:24 PM

/boot maintenance
 
On 2012-09-05 15:46, Dean Henrichsmeyer wrote:
> On Wed, Sep 5, 2012 at 8:56 AM, Tyler J. Wagner <tyler@tolaris.com
> http://www.tolaris.com/2012/07/19/removing-old-kernels-from-ubuntu/
>
> That purges any kernel that isn't either the highest-versioned one, or one
> which is currently running.
>
>
> I hope people read that code before running it. It makes assumptions that
> are not accurate with reality. For example, running that right now on a
> precise machine says:
>
> <root@courage>:~# echo $KERNEL_HIGHEST
> 3.2.0-9
> <root@courage>:~# echo $KERNEL_CURRENT
> 3.2.0-29

You should always read a script before running it. :)

Your result is anomalous. I've been using that for 4 years now, with never
an error. Testing today on a machine up for 3 days, so it has today's
newest kernel, gives:

root@baal:~# echo $KERNEL_HIGHEST
3.2.0-30
root@baal:~# echo $KERNEL_CURRENT
3.2.0-29

Perhaps your dpkg database is fresh from a install (apt-get update never
ran)? If not, please poke at the code, or contact me privately with the
results of:

dpkg -l linux-image* | cat

The cat prevents dpkg from truncating version numbers due to terminal width.

Regards,
Tyler

--
"We are on the cusp of this time where I can say, 'I speak as a citizen
of the world' without others saying, 'God, what a nut.'"
-- Lawrence Lessig

--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam

"Tyler J. Wagner" 09-06-2012 12:21 PM

/boot maintenance
 
On 2012-09-05 15:46, Dean Henrichsmeyer wrote:
> On Wed, Sep 5, 2012 at 8:56 AM, Tyler J. Wagner <tyler@tolaris.com
> I agree; a 100 MB boot is just silly. So, run a daily script with this
> in it.
>
> http://www.tolaris.com/2012/07/19/removing-old-kernels-from-ubuntu/
>
> That purges any kernel that isn't either the highest-versioned one, or one
> which is currently running.
>
>
> I hope people read that code before running it. It makes assumptions that
> are not accurate with reality. For example, running that right now on a
> precise machine says:
>
> <root@courage>:~# echo $KERNEL_HIGHEST
> 3.2.0-9
> <root@courage>:~# echo $KERNEL_CURRENT
> 3.2.0-29
>
> Just a heads up.

I've updated my post to correct the bug Dean found. The code now correctly
sorts the version string to find the latest installed kernel.

http://www.tolaris.com/2012/07/19/removing-old-kernels-from-ubuntu/

Thanks for the help, Dean.

Regards,
Tyler

--
"Those who make peaceful revolution impossible will make violent
revolution inevitable."
-- John F. Kennedy

--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam


All times are GMT. The time now is 07:33 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.