[CentOS-virt] root device for CentOS AMI would be /dev/sda1?

Tue Dec 25 17:09:26 UTC 2012
Miida Makoto <miidumb at gmail.com>

Hi guys,

first of all, thanks a lot for all guys preparing for official CentOS AMIs on Amazon Marketplace!

However, I have noticed a problem on a swap device 
when I launch a m1.small instance with the official AMI.

AWS prepares two local storages for m1.small and c1.medium;
one is for 160GB instance store storage, and the other is for a storage for the swap space,
described in:

http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/InstanceStorage.html#InstanceStoreDeviceNames



I assume that the root device name of the officail CentOS AMI is /dev/sda prevents to recognize
/dev/sda3 prepared by AWS.

How about to think to switch the root device from /dev/sda to /dev/sda1
on the official CentOS AMI, it is the default value for the root device?

in the mean time, I can launch an instance of m1.small with /dev/sda3 visible
in the following steps.

=====
1) launch an instance from 'CentOS 6.3 i386 Release Media' AMI
    (actually ami-2a44fa2b in Tokyo Region)

2) edit the following two files.

 2-1) /etc/fstab

--- /etc/fstab.orig	2012-10-31 15:55:46.635530167 +0000
+++ /etc/fstab	2012-12-25 16:38:20.533626775 +0000
@@ -1,4 +1,4 @@
-/dev/xvde		/        ext4      defaults         0 0
+/dev/xvde1		/        ext4      defaults         0 0
 devpts     /dev/pts  devpts  gid=5,mode=620   0 0
 tmpfs      /dev/shm  tmpfs   defaults         0 0
 proc       /proc     proc    defaults         0 0

 2-2) /boot/grub/grub.conf

--- /boot/grub/grub.conf.orig	2012-10-31 15:55:46.638530499 +0000
+++ /boot/grub/grub.conf	2012-12-25 16:39:24.477627807 +0000
@@ -3,5 +3,5 @@
 
 title CentOS-6.3-i386-GA-s3 2.6.32-279.el6.i686
         root (hd0)
-        kernel /boot/vmlinuz-2.6.32-279.el6.i686 root=/dev/xvde ro 
+        kernel /boot/vmlinuz-2.6.32-279.el6.i686 root=/dev/xvde1 ro 
         initrd /boot/initramfs-2.6.32-279.el6.i686.img

3) take a snapshot of the root EBS volume

4) register an AMI image with the snapshot with the following command

ec2-register --region XX-XXXXXXXX-X -n 'ZZZZ' -d 'ZZZZ --root-device-name /dev/sda1 -b /dev/sda1=snap-237fe703 -a i386 --kernel aki-42992843

 * the kernel ID is for i 386 on ap-northeast-1 (Tokyo) region.

===

furthermore, i suggest to prepare the fstab with the following line for i386 image:

/dev/xvde3 swap swap defaults 0 0

it would be nice for people using the AMI on m1.small and c1.medium.



Best regards,

Mak