After reading this article on performance. I decided to upgrade one of the EC2 instances to the latest kernel with the following command

sudo apt-get dist-upgrade

That command tries to install the typical ec2 packages, and at the same time attempts to upgrade from 2.6.32 to 2.6.38. Unfortunately, I hit a snag with the following message

Setting up linux-image-2.6.32-38-virtual (2.6.32-38.83) ...
Running depmod.
update-initramfs: Generating /boot/initrd.img-2.6.32-38-server
Running postinst hook script /usr/sbin/update-grub.
head: cannot open `/boot/grub/video.lst' for reading: No such file or directory
Generating grub.cfg ...
Skipping linux image [linux-ec2]: /boot/vmlinuz-2.6.32-316-ec2
Skipping linux image [linux-ec2]: /boot/vmlinuz-2.6.32-342-ec2
Found linux image: /boot/vmlinuz-2.6.32-38-server
Found initrd image: /boot/initrd.img-2.6.32-38-server
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/sda1.  Check your device.map.
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/sda1.  Check your device.map.
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/sda1.  Check your device.map.
Found linux image: /boot/vmlinuz-2.6.32-32-server
Found initrd image: /boot/initrd.img-2.6.32-32-server
Found memtest86+ image: /boot/memtest86+.bin
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/sda1.  Check your device.map.
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/sda1.  Check your device.map.
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/sda1.  Check your device.map. done
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/pm-utils 2.6.32-38-server /boot/vmlinuz-2.6.32-38-server
run-parts: executing /etc/kernel/postinst.d/x-grub-legacy-ec2 2.6.32-38-server /boot/vmlinuz-2.6.32-38-server
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Ignoring non-Xen Kernel on Xen domU host: vmlinuz-2.6.32-38-server
Ignoring non-Xen Kernel on Xen domU host: vmlinuz-2.6.32-32-server
Found kernel: /boot/vmlinuz-2.6.32-342-ec2
Found kernel: /boot/vmlinuz-2.6.32-316-ec2
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done

So the real question is.. how do I upgrade the Linux kernel on EC2 instances (it is a standard bitnami AMI running ubuntu 10.04)

asked 01 Mar '12, 10:36

Antony%20Wu's gravatar image

Antony Wu
61469
accept rate: 33%

edited 01 Mar '12, 10:38


Hi Antony, you can ignore those errors. The new kernel will be loaded once you reboot your instance. Take a look at: http://groups.google.com/group/ec2ubuntu/browse_thread/thread/e4d77bfc2ef44bba?pli=1

Amazon pv-grub kernel will take the configuration from /boot/grub/menu.lst. It doesn't require you to have a grub installation in the disk. You can find more details about how it works at the link below:

http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html#configuringGRUB

I hope it helps.

link

answered 02 Mar '12, 10:37

Beltran%20Rueda's gravatar image

Beltran Rueda ♦♦
11.2k81553
accept rate: 25%

edited 02 Mar '12, 10:42

Carlos%20S%C3%A1nchez's gravatar image

Carlos Sánchez ♦♦
32724

I rebooted, but the kernel doesn't seem to get updated at all.

uname -r

2.6.32-342-ec2

(02 Mar '12, 15:35) Antony Wu

Can you run the following command to check the exact kernels you have installed?

dpkg --list | grep linux-image

(04 Mar '12, 06:10) Carlos Sánchez ♦♦

Hi Carlos, after rebooting the box and running the command, the result shows that it is indeed running under 2.6.32

linux-image-ec2 2.6.32.343.24 Linux kernel image for ec2 machines

(08 Mar '12, 00:40) Antony Wu

All the kernels mentioned in the log you have pasted above are 2.6.32:

2.6.32-38 2.6.32-32 2.6.32-316-ec2 2.6.32-342-ec2

2.6.32-342 is the latest in that case. Can you run the command I mentioned to make sure you have a "2.6.38" kernel installed?

(08 Mar '12, 04:09) Carlos Sánchez ♦♦

Just in case, repled in answer section due to comment size limit

(08 Mar '12, 23:12) Antony Wu

Carlos, I would love to reply in the comment section except that it has a size limit, so I am posting here for reference. I just ran the dist-upgrade again yesterday for 2.6.39. From the log below, finally, I see the latest kernel listed (there was no reference of 2.6.38 before). However, the uname -a returns 2.6.32-342-ec2 still

bitnami@xxxx:~$ dpkg --list | grep linux-image
ii  linux-image-2.6.32-316-ec2        2.6.32-316.31                     Linux kernel image for version 2.6.32 on x86
ii  linux-image-2.6.32-32-virtual     2.6.32-32.62                      Linux kernel image for version 2.6.32 on x86
ii  linux-image-2.6.32-342-ec2        2.6.32-342.43                     Linux kernel image for version 2.6.32 on x86
ii  linux-image-2.6.32-343-ec2        2.6.32-343.45                     Linux kernel image for version 2.6.32 on x86
ii  linux-image-2.6.32-38-virtual     2.6.32-38.83                      Linux kernel image for version 2.6.32 on x86
ii  linux-image-2.6.32-39-virtual     2.6.32-39.86                      Linux kernel image for version 2.6.32 on x86
ii  linux-image-ec2                   2.6.32.343.24                     Linux kernel image for ec2 machines
ii  linux-image-virtual               2.6.32.39.46                      Linux kernel image for virtual machines
link

answered 08 Mar '12, 18:55

Antony%20Wu's gravatar image

Antony Wu
61469
accept rate: 33%

edited 08 Mar '12, 18:55

Please notice that all the kernels you have are "2.6.32". As you can see in your list there's no "2.6.38" or "2.6.39" installed but "2.6.32-38" and "2.6.32-39". The latest kernel you have installed is "2.6.32-343-ec2", which is the latest in the Ubuntu 10.04 repositories.

(09 Mar '12, 04:13) Carlos Sánchez ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×91
×1

Asked: 01 Mar '12, 10:36

Seen: 2,356 times

Last updated: 09 Mar '12, 04:13

powered by BitNami OSQA