Grubby kernel update problems with CentOS 5 AMI (missing /boot partition)
groentebroer May 31, 2012 7:05 PMHi All,
I use boxgrinder to create my own CentOS 5 AMI for Amazon.
The problem is when I want to update the kernel of that CentOS 5 instance "grubby" (part of mkinitrd) cannot modify /boot/grub/grub.conf with the following message:
grubby fatal error: unable to find a suitable template
Tracing back and testing shows that grubby is unable to find a labeled root partition in /etc/fstab, and then it searches for the vmlinuz- in / instead of in /boot, which is not there.
After I found this out, I created a new AMI, with a /boot partition I thought. But as mentioned in: https://community.jboss.org/message/728904#728904 this is not honored for specific reasons for an Amazon AMI.
Within the creation of the AMI, this error is also thrown:
D, [2012-05-31T18:48:09.101647 #17367] DEBUG -- : Executing 'yum -y install kernel-xen' command... D, [2012-05-31T18:48:09.101825 #17367] DEBUG -- : GFS: sh "setarch x86_64 << 'SETARCH_EOF' yum -y install kernel-xen SETARCH_EOF" T, [2012-05-31T18:48:09.103774 #17367] TRACE -- : GFS: guestfsd: main_loop: proc 111 (sh) took 19.92 seconds guestfsd: main_loop: new request, len 0x74 T, [2012-05-31T18:48:09.107860 #17367] TRACE -- : GFS: mount --bind /dev /sysroot/dev T, [2012-05-31T18:48:09.271194 #17367] TRACE -- : GFS: mount --bind /dev/pts /sysroot/dev/pts T, [2012-05-31T18:48:09.436907 #17367] TRACE -- : GFS: mount --bind /proc /sysroot/proc T, [2012-05-31T18:48:09.601001 #17367] TRACE -- : GFS: mount --bind /selinux /sysroot/selinux T, [2012-05-31T18:48:09.766540 #17367] TRACE -- : GFS: mount --bind /sys /sysroot/sys T, [2012-05-31T18:48:09.964003 #17367] TRACE -- : GFS: /bin/sh -c setarch x86_64 << 'SETARCH_EOF' yum -y install kernel-xen SETARCH_EOF T, [2012-05-31T18:49:48.593640 #17367] TRACE -- : GFS: warning: T, [2012-05-31T18:49:48.595140 #17367] TRACE -- : GFS: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897 T, [2012-05-31T18:49:48.824185 #17367] TRACE -- : GFS: Importing GPG key 0xE8562897 "CentOS-5 Key (CentOS 5 Official Signing Key) <centos-5-key@centos.org>" f rom /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 T, [2012-05-31T18:51:06.919459 #17367] TRACE -- : GFS: grubby fatal error: unable to find a suitable template T, [2012-05-31T18:51:09.842969 #17367] TRACE -- : GFS: umount /sysroot/sys T, [2012-05-31T18:51:10.048853 #17367] TRACE -- : GFS: umount /sysroot/selinux T, [2012-05-31T18:51:10.243856 #17367] TRACE -- : GFS: umount /sysroot/proc T, [2012-05-31T18:51:10.426842 #17367] TRACE -- : GFS: umount /sysroot/dev/pts T, [2012-05-31T18:51:10.627088 #17367] TRACE -- : GFS: umount /sysroot/dev D, [2012-05-31T18:51:10.827552 #17367] DEBUG -- : GFS: sh = "Loaded plugins: fastestmirror
But after that some other commands with mkinitrd are executed which seem to work:
D, [2012-05-31T18:51:10.828013 #17367] DEBUG -- : Command 'yum -y install kernel-xen' executed. D, [2012-05-31T18:51:10.828304 #17367] DEBUG -- : GFS: ls "/lib/modules" T, [2012-05-31T18:51:10.829663 #17367] TRACE -- : GFS: guestfsd: main_loop: proc 111 (sh) took 143.53 seconds T, [2012-05-31T18:51:10.836617 #17367] TRACE -- : GFS: guestfsd: main_loop: new request, len 0x38 D, [2012-05-31T18:51:10.837027 #17367] DEBUG -- : GFS: ls = ["2.6.18-308.8.1.el5xen"] D, [2012-05-31T18:51:10.837230 #17367] DEBUG -- : GFS: sh "ls -1 /boot | grep initramfs | wc -l" T, [2012-05-31T18:51:10.857461 #17367] TRACE -- : GFS: guestfsd: main_loop: proc 6 (ls) took 0.00 seconds T, [2012-05-31T18:51:10.865609 #17367] TRACE -- : GFS: guestfsd: main_loop: new request, len 0x50 mount --bind /dev /sysroot/dev T, [2012-05-31T18:51:11.077014 #17367] TRACE -- : GFS: mount --bind /dev/pts /sysroot/dev/pts T, [2012-05-31T18:51:11.276830 #17367] TRACE -- : GFS: mount --bind /proc /sysroot/proc T, [2012-05-31T18:51:11.475016 #17367] TRACE -- : GFS: mount --bind /selinux /sysroot/selinux T, [2012-05-31T18:51:11.659699 #17367] TRACE -- : GFS: mount --bind /sys /sysroot/sys T, [2012-05-31T18:51:11.869753 #17367] TRACE -- : GFS: /bin/sh -c ls -1 /boot | grep initramfs | wc -l T, [2012-05-31T18:51:12.466343 #17367] TRACE -- : GFS: umount /sysroot/sys T, [2012-05-31T18:51:12.668430 #17367] TRACE -- : GFS: umount /sysroot/selinux T, [2012-05-31T18:51:12.869432 #17367] TRACE -- : GFS: umount /sysroot/proc T, [2012-05-31T18:51:13.066258 #17367] TRACE -- : GFS: umount /sysroot/dev/pts T, [2012-05-31T18:51:13.251854 #17367] TRACE -- : GFS: umount /sysroot/dev D, [2012-05-31T18:51:13.452708 #17367] DEBUG -- : GFS: sh = "0 " D, [2012-05-31T18:51:13.452964 #17367] DEBUG -- : GFS: exists "/sbin/dracut" T, [2012-05-31T18:51:13.454924 #17367] TRACE -- : GFS: guestfsd: main_loop: proc 111 (sh) took 2.02 seconds guestfsd: main_loop: new request, len 0x38 D, [2012-05-31T18:51:13.458303 #17367] DEBUG -- : GFS: exists = 0 T, [2012-05-31T18:51:13.458484 #17367] TRACE -- : Additional modules to preload in kernel: xenblk, xennet D, [2012-05-31T18:51:13.458678 #17367] DEBUG -- : Recreating kernel image for 2.6.18-308.8.1.el5xen kernel... D, [2012-05-31T18:51:13.458903 #17367] DEBUG -- : GFS: sh "/sbin/mkinitrd -f -v --preload=xenblk --preload=xennet /boot/initrd-2.6.18-308.8.1.el5xen.img 2.6.18-308.8.1.el5xen" T, [2012-05-31T18:51:13.461012 #17367] TRACE -- : GFS: guestfsd: main_loop: proc 36 (exists) took 0.00 seconds guestfsd: main_loop: new request, len 0xa0 T, [2012-05-31T18:51:13.463372 #17367] TRACE -- : GFS: mount --bind /dev /sysroot/dev T, [2012-05-31T18:51:13.682592 #17367] TRACE -- : GFS: mount --bind /dev/pts /sysroot/dev/pts T, [2012-05-31T18:51:13.876233 #17367] TRACE -- : GFS: mount --bind /proc /sysroot/proc T, [2012-05-31T18:51:14.080065 #17367] TRACE -- : GFS: mount --bind /selinux /sysroot/selinux T, [2012-05-31T18:51:14.283468 #17367] TRACE -- : GFS: mount --bind /sys /sysroot/sys T, [2012-05-31T18:51:14.503953 #17367] TRACE -- : GFS: /bin/sh -c /sbin/mkinitrd -f -v --preload=xenblk --preload=xennet /boot/initrd-2.6.18-308.8.1.el5xen.img 2.6.18-308.8.1.el5xen T, [2012-05-31T18:52:22.700121 #17367] TRACE -- : GFS: umount /sysroot/sys T, [2012-05-31T18:52:22.940627 #17367] TRACE -- : GFS: umount /sysroot/selinux T, [2012-05-31T18:52:23.167042 #17367] TRACE -- : GFS: umount /sysroot/proc T, [2012-05-31T18:52:23.396860 #17367] TRACE -- : GFS: umount /sysroot/dev/pts
How to make this work to be able to update the kernel on these CentOS 5 instances created with this AMI to avoid manually changing every /boot/grub/grub.conf and /boot/grub/menu.lst?
Thanks for the help.
Regards,
Groentebroer