Trying to clean up /boot with no luck :-(

hello - not entirely sure that this belongs here - if not, sorry.

I am trying to clean up my /boot directory as it has run full

Found a suggested approach using

rpm -qa |grep ^kernel

followed by

rpm -e kernel-x.x.x-x.fc16.x86_64 kernel-devel-x.x.x-x.fc16.x86_64

using all but the most recent kernel found

luckily this system was not important - as I am unable to boot after doing so

Q1: What is the recommended / OpenSuSE-way to do this?
Q2: is there a way to recover the system after my attempt to do the house keeping? It’s a virtual host (KVM)

thanks in advance
Jens

Hi
Sure your in the right forum since you have fedora kernels?

On openSUSE 13.1 there is a configuration change you can make to the zypper config to only keep the latest kernel. In saying that the systemd service purge-kernels.service should clean it up, else run this manually…

With a default openSUSE install if you opt for a separate boot partition you need to allow space for 3 kernels, this is about 400- 500 meg. You can adjust the zypper configuration so that old kernels are not kept. Basically when a new kernel is installed therr can be as many as 3 kernels once the newest successfully boots the oldest is removed.

I just wish they had a release note about having multiple kernels enabled by default :, oh well life goes on…

Any way to edit zypp.conf

First make a backup.

cp -v /etc/zypp/zypp.conf /etc/zypp/zypp.conf.orig

Now to edit it.

printf '%s
' 'g/^multiversion/s/^/# /' w | ed -s /etc/zypp/zypp.conf

check what is in there.

grep '^^#]' /etc/zypp/zypp.conf

Remove the other kernels that you do not use and you should only have one kernel installed at a time. The question is can you live with just one kernel installed? I can ;).

As long a the new kernel does not break something. It really is nice to have a drop back/

I believe the kernel policy is in the release notes. But it did start with 12.3 I think

On 2014-07-03 05:36, gogalthorp wrote:
>
> As long a the new kernel does not break something. It really is nice to
> have a drop back/

Indeed.

But auto-creation of initrd can be a problem some times.

> I believe the kernel policy is in the release notes. But it did start
> with 12.3 I think

Or earlier. The autopurge was a later addition.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

  • Actually, I just copy/paste’d :slight_smile:
    I was unable to access the history on the box with the problem since it couldn’t boot :slight_smile:

Hi - yeah, I realised that some time ago, but I forgot to change the boot partition size for this (and frankly, a couple of other) system. So rather than making a fresh install I tried to get around with some cleaning.
Seemed quite reasonable … at least before I tried to do it :slight_smile:

  • Thanks, I’ll try this ASAP on another system.
    In fact, I don’t mind allocating 500 MB boot (or 1G) - on the other hand I’m pretty sure I’ll never use other kernels.
    What bothers me is wheter updating would also fill the 1G eventually

– jens

Shouldn’t happen.
By default only the two most recent kernels are kept.

Older ones should be removed automatically by that purge-kernels.service.
Check that this is enabled:

systemctl status purge-kernels.service

(or YaST->System->Services Manager)

Btw, what you wrote in your first post would work on openSUSE as well, i.e. “rpm -qa|grep ^kernel” to get a list of the installed kernels, then run “rpm -e kernel-desktop-3.11.10-10” f.e. to remove a specific one.
Or use YaST->Software Management, if you click on the “Versions” tab below the package list, you can install/remove specific versions.

Of course you have to keep at least one kernel to be able to boot.

The easiest way to recover the system would be to boot from an installation CD/DVD and select “Upgrade an existing installation”. You might even de-select all packages to be installed (click on “Software” on the overview screen) except for the kernel.

On 2014-07-03 11:06, jens middelfart wrote:

> Hi - yeah, I realised that some time ago, but I forgot to change the
> boot partition size for this (and frankly, a couple of other) system. So
> rather than making a fresh install I tried to get around with some
> cleaning.
> Seemed quite reasonable … at least before I tried to do it :slight_smile:

My boot partition is just 190 MB, and I have the default two kernels
(which is three during a kernel update; on the next boot, the older
kernel of the three gets purged and we are back to two). The small
partition suffices because I removed plymouth from the installation.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

190 MB should be plenty even with plymouth.

I have 3 kernels installed here at the moment (I installed an additional 3.12 kernel for testing something):

:~> du -h /boot
321K    /boot/grub
0       /boot/grub2/backgrounds
2,3M    /boot/grub2/i386-pc
1,5M    /boot/grub2/fonts
2,1M    /boot/grub2/locale
172K    /boot/grub2/themes/openSUSE/icons
4,7M    /boot/grub2/themes/openSUSE
4,7M    /boot/grub2/themes
11M     /boot/grub2
126M    /boot

Each initrd has 24MB, all the other kernel files (that are in /boot) are about 15 MB per kernel.
So with 190 MB there would be more than enough space for a fourth kernel, too.

On 2014-07-03 13:56, wolfi323 wrote:
>
> robin_listas;2652207 Wrote:

> Each initrd has 24MB, all the other kernel files (that are in /boot) are
> about 15 MB per kernel.
> So with 190 MB there would be more than enough space for a fourth
> kernel, too.

My initrd, without plymouth, are 18 MiB each. With plymouth, they were
about double. And I also have a locally compiled kernel, and some margin:


Telcontar:~ # df -h /boot/
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdc2       190M   91M   87M  52% /boot
Telcontar:~ #


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

As I said, they are 24 MB here each (with plymouth, on 13.1). And I didn’t tweak anything.
I think on 12.3 they were bigger though.

Btw, on my Factory installation they are only 16MB now… :wink:

But the actual size also depends on your system of course, i.e. what stuff exactly has to be put into the initrd.
The nvidia kernel module is somewhat bigger than my radeon f.e.

With the size you mentioned (36 MB per initrd), one would get about 50 MB per kernel, so 190 MB would still be plenty for 3 kernels.

And I also have a locally compiled kernel, and some margin:

Telcontar:~ # df -h /boot/
Filesystem Size Used Avail Use% Mounted on
/dev/sdc2 190M 91M 87M 52% /boot
Telcontar:~ #

But still you should have enough space even with plymouth. According to your numbers that would be 36MB more, which would still leave 50M free.
That doesn’t mean that you should install it again, though. I’m just saying that 190MB should be enough even if you don’t remove plymouth… :wink:
For the default 2 (+1) kernels, that is.

Always thought 200 meg was enough but when I last posted that several people said 200 was not enough. I don’t use a separate boot so I have never had to personally worry about it. Also it is a good idea to always allow a bit of elbow room so 500 meg is not unreasonable.

It’s still a problem with Tumbleweed, where kernels accumulate (not being cleaned up).


13.1 (without plymouth)
-rw------- 1 root root 13076926 Jun 27 06:15 initrd-3.11.10-17-desktop

factory (without plymouth)
-rw------- 1 croot root 7137588 Jun 28 13:38 initrd-3.15.0-rc7-1-desktop

factory (with plymouth)
-rw------- 1 root root 17312420 Jul  3 06:42 initrd-3.15.0-rc7-1-desktop

Those are all using an encrypted LVM. I no longer have a 12.3 system to check.

Yes, that’s a flaw in the purge-kernels script.
https://bugzilla.novell.com/show_bug.cgi?id=820367

This is fixed in the latest version contained in the dracut package though AFAIK. (available in Factory and from Base:System)