From: Robert Scheck (scheck_at_etes.de)
Date: Sat Dec 22 2007 - 01:32:57 CET
Date: Sat, 22 Dec 2007 01:32:57 +0100 From: Robert Scheck <scheck@etes.de> Message-ID: <20071222003257.GA28849@intranet.hq.stgt.etes.de> Subject: Re: [suse-sles-e] Upgrade to SLES9 SP4 results in non-bootable systems when using SATA
On Sat, 22 Dec 2007, Eberhard Moenkeberg wrote:
> The old kernel(s) have to get conserved somehow.
> But you surely do not want to have your /boot partition exploded by old
> kernels...
It could be made a configuration option how many old Linux kernels should
be kept in /boot as others already do. Most of the relevant code would have
to be included into mkinitrd and whatever is maybe executed in %post of the
kernel RPM package.
> I do this always with the first kernel from a release, and again from time
> to time:
I wrote a nice script a longer time ago which could be of interest for you
as well. Unfortunately this script saved my ass already a couple of times -
unfortunately, because I shouldn't run into a scenario where this would be
needed.
--- snipp ---
#!/bin/bash
echo "Found kernels saved: "
# All found kernel packages
for NAME in $(rpm -qa --qf "%{name}\n" | grep "^kernel" | grep -E -v "(devel|source)"); do
# Get version and arch from installed rpm package
VERSION="$(rpm -q $NAME -qa --qf '%{version}-%{release}')"
ARCH="$(rpm -q $NAME -qa --qf '%{arch}')"
# Tarball any bound kernel files from /lib and /usr
tar cfzP $NAME-$VERSION.$ARCH.tar.gz \
$(rpm -ql $NAME | grep -E "^/(lib|usr)") \
/boot/*$VERSION*
# Save a copy of grub configuration
cp -f /boot/grub/menu.lst $NAME-$VERSION.$ARCH.grub.lst
# Finally display the saved file archives
ls -l $NAME-$VERSION.$ARCH.{tar.gz,grub.lst}
done
echo " "
echo "For saving the stuff back:"
echo " - Unpack the .tar.gz files containing kernel"
echo " - Modify /boot/grub/menu.lst from .grub.lst"
--- snapp ---
# ./suse-kernel-backup.sh
Found kernels saved:
-rw------- 1 root root 924 Dec 22 01:20 kernel-xen-2.6.16.53-0.16.x86_64.grub.lst
-rw-r--r-- 1 root root 96110797 Dec 22 01:20 kernel-xen-2.6.16.53-0.16.x86_64.tar.gz
-rw------- 1 root root 924 Dec 22 01:21 kernel-smp-2.6.16.53-0.16.x86_64.grub.lst
-rw-r--r-- 1 root root 98054536 Dec 22 01:21 kernel-smp-2.6.16.53-0.16.x86_64.tar.gz
For saving the stuff back:
- Unpack the .tar.gz files containing kernel
- Modify /boot/grub/menu.lst from .grub.lst
#
Merry christmas
Robert Scheck
-- Robert Scheck Web: http://www.etes.de E-Mail: scheck@etes.de ETES GmbH Libanonstrasse 58 A D-70184 Stuttgart Fon: +49 (7 11) 48 90 83 - 12 Fax: +49 (7 11) 48 90 83 - 50 Registergericht: Amtsgericht Stuttgart HRB 721182 Geschäftsführende Gesellschafter: Markus Espenhain und Jan Theofel Sitz der Gesellschaft: Stuttgart USt.-Id.Nr.: DE814767446 --------------------------------------------------------------------- To unsubscribe, e-mail: suse-sles-e-unsubscribe@suse.com For additional commands, e-mail: suse-sles-e-help@suse.com
This archive was generated by hypermail 2.1.7 : Fri Dec 21 2007 - 14:33:34 CET