{"id":95,"date":"2011-11-21T20:52:24","date_gmt":"2011-11-21T19:52:24","guid":{"rendered":"https:\/\/blogs.gentoo.org\/mgorny\/?p=95"},"modified":"2012-11-27T06:19:46","modified_gmt":"2012-11-27T05:19:46","slug":"cleaning-up-boot-with-eclean-kernel","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/mgorny\/2011\/11\/21\/cleaning-up-boot-with-eclean-kernel\/","title":{"rendered":"Cleaning up \/boot with eclean-kernel"},"content":{"rendered":"<pre><code># make install\r\nsh \/usr\/src\/linux-drm-next\/arch\/x86\/boot\/install.sh 3.2.0-rc2-pomiocik+ arch\/x86\/boot\/bzImage \\\r\n\t\tSystem.map \"\/boot\"\r\ncat: write error: No space left on device\r\nmake[1]: *** [install] Error 1\r\nmake: *** [install] Error 2<\/code><\/pre>\n<p>Ever hit an issue like that when trying to install a new kernel? Ever thought how much you hate manually removing old kernels? Ever forgot to remove modules as well? If you do, then you may be interested in a tiny new tool called <a rel=\"external\" href=\"https:\/\/bitbucket.org\/mgorny\/eclean-kernel\">eclean-kernel<\/a>.<\/p>\n<p>In simplest words, eclean-kernel could be called an old kernel harvester. Given a few tiny settings, it finds the kernels installed in the system, chooses ones to remove and removes them along with the modules and sources (if not used by any other kernel).<\/p>\n<p>The usual way of using it is to set it to keep a few newest kernels, and remove all older than them. To do this, you just need to pass the number as <code>--num<\/code>. For example:<\/p>\n<pre><code>eclean-kernel -n 3 --ask<\/code><\/pre>\n<p>will remove all kernels but the newest three, asking before removing each one. For non-interactive use, omit <code>--ask<\/code>; you can also use <code>--pretend<\/code> for eclean-kernel to list the kernel versions which would be removed.<\/p>\n<p>By default, it preserves all kernels referenced by the bootloader. The <code>--destructive<\/code> option can be used to disable that. If it fails to detect the correct bootloader (or multiple bootloaders are installed), <code>--bootloader<\/code> option can be used to specify the one to use.<\/p>\n<p>It can also preserve some kinds of kernel files to fit more specific setups. For example, if you&#8217;d like to keep old kernel configs, just pass <code>--exclude config<\/code>.<\/p>\n<p>And finally, you can avoid having to repeatedly provide the same options by putting them in your <code>~\/.config\/eclean-kernel.rc<\/code>. An example file could look like:<\/p>\n<pre><code>-n 3 --ask --exclude config<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p># make install sh \/usr\/src\/linux-drm-next\/arch\/x86\/boot\/install.sh 3.2.0-rc2-pomiocik+ arch\/x86\/boot\/bzImage \\ System.map &#8220;\/boot&#8221; cat: write error: No space left on device make[1]: *** [install] Error 1 make: *** [install] Error 2 Ever hit an issue like that when trying to install a new kernel? Ever thought how much you hate manually removing old kernels? Ever forgot to remove &hellip; <a href=\"https:\/\/blogs.gentoo.org\/mgorny\/2011\/11\/21\/cleaning-up-boot-with-eclean-kernel\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Cleaning up \/boot with eclean-kernel&#8221;<\/span><\/a><\/p>\n","protected":false},"author":137,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[3],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/posts\/95"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/users\/137"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/comments?post=95"}],"version-history":[{"count":7,"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/posts\/95\/revisions"}],"predecessor-version":[{"id":183,"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/posts\/95\/revisions\/183"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/media?parent=95"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/categories?post=95"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/mgorny\/wp-json\/wp\/v2\/tags?post=95"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}