Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to make my own EC2 AMI. I used debootstrap to install the packages onto a partition, copied the kernel modules from the running AMI (Amazon linux) and rebooted. This is what the console output is:

    Xen Minimal OS!
  start_info: 0xb10000(VA)
    nr_pages: 0x6a400
  shared_inf: 0xbef32000(MA)
     pt_base: 0xb13000(VA)
nr_pt_frames: 0x9
    mfn_list: 0x967000(VA)
   mod_start: 0x0(VA)
     mod_len: 0
       flags: 0x0
    cmd_line: root=/dev/sda1 ro 4
  stack:      0x946780-0x966780
MM: Init
      _text: 0x0(VA)
     _etext: 0x621f5(VA)
   _erodata: 0x76000(VA)
     _edata: 0x7b6d4(VA)
stack start: 0x946780(VA)
       _end: 0x966d34(VA)
  start_pfn: b1f
    max_pfn: 6a400
Mapping memory range 0xc00000 - 0x6a400000
setting 0x0-0x76000 readonly
skipped 0x1000
MM: Initialise page allocator for e6c000(e6c000)-0(6a400000)
MM: done
Demand map pfns at 6a401000-7a401000.
Heap resides at 7a402000-ba402000.
Initialising timer interface
Initialising console ... done.
gnttab_table mapped at 0x6a401000.
Initialising scheduler
Thread "Idle": pointer: 0x7a402008, stack: 0x6a030000
Initialising xenbus
Thread "xenstore": pointer: 0x7a402478, stack: 0x6a040000
Dummy main: start_info=0x966880
Thread "main": pointer: 0x7a4028e8, stack: 0x6a050000
"main" "root=/dev/sda1" "ro" "4" 
vbd 2049 is hd0
******************* BLKFRONT for device/vbd/2049 **********


backend at /local/domain/0/backend/vbd/571/2049
Failed to read /local/domain/0/backend/vbd/571/2049/feature-barrier.
Failed to read /local/domain/0/backend/vbd/571/2049/feature-flush-cache.
10485760 sectors of 0 bytes
**************************
vbd 2051 is hd1
******************* BLKFRONT for device/vbd/2051 **********


backend at /local/domain/0/backend/vbd/571/2051
Failed to read /local/domain/0/backend/vbd/571/2051/feature-barrier.
Failed to read /local/domain/0/backend/vbd/571/2051/feature-flush-cache.
1835008 sectors of 0 bytes
**************************

    [H
    [J

    GNU GRUB  version 0.97  (1740800K lower / 0K upper memory)



       [ Minimal BASH-like line editing is supported.   For

         the   first   word,  TAB  lists  possible  command

         completions.  Anywhere else TAB lists the possible

         completions of a device/filename. ]




grubdom>                                                                       
    [9;10H

I don't really understand what's failing.


More info:

So here's what I do: I create a GB volume, boot an Amazon Linux AMI, mount the volume as say /dev/sdf, create a partition /dev/sdf1, mkfs.ext3 a filesystem on sdf1, debootstrap Debian to it, install a kernel image, create the menu.lst file:

Default 0 Timeout 3 Fallback 1

title Debian root (hd0,0) kernel /boot/vmlinuz-2.6.32-5-686 root=/dev/sda1 initrd /boot/initrd.img-2.6.32-5-686

Then I shutdown the Amazon Linux AMI, create a snapshot of the EBS volume, create an AMI from it (using either hd0 or hd00, setting the root device to /dev/sda1 - I set the root partition to be mounted from /dev/sda1 in fstab) and try to boot it. And it fails. This is the console output I can see:

Xen Minimal OS! start_info: 0xb10000(VA) nr_pages: 0x6a400 shared_inf: 0x00ba8000(MA) pt_base: 0xb13000(VA) nr_pt_frames: 0x9 mfn_list: 0x967000(VA) mod_start: 0x0(VA) mod_len: 0 flags: 0x0 cmd_line: root=/dev/sda1 ro 4 stack: 0x946780-0x966780 MM: Init _text: 0x0(VA) _etext: 0x61e65(VA) _erodata: 0x76000(VA) _edata: 0x7b6d4(VA) stack start: 0x946780(VA) _end: 0x966d34(VA) start_pfn: b1f max_pfn: 6a400 Mapping memory range 0xc00000 - 0x6a400000 setting 0x0-0x76000 readonly skipped 0x1000 MM: Initialise page allocator for e6c000(e6c000)-0(6a400000) MM: done Demand map pfns at 6a401000-7a401000. Heap resides at 7a402000-ba402000. Initialising timer interface Initialising console ... done. gnttab_table mapped at 0x6a401000. Initialising scheduler Thread "Idle": pointer: 0x7a402008, stack: 0x6a030000 Initialising xenbus Thread "xenstore": pointer: 0x7a402478, stack: 0x6a040000 Dummy main: start_info=0x966880 Thread "main": pointer: 0x7a4028e8, stack: 0x6a050000 "main" "root=/dev/sda1" "ro" "4" vbd 2049 is hd0

                                                                        BLKFRONT for device/vbd/2049 **********

backend at /local/domain/0/backend/vbd/1784/2049 Failed to read /local/domain/0/backend/vbd/1784/2049/feature-barrier. Failed to read /local/domain/0/backend/vbd/1784/2049/feature-flush-cache. 10485760 sectors of 0 bytes


vbd 2051 is hd1

                                                                        BLKFRONT for device/vbd/2051 **********

backend at /local/domain/0/backend/vbd/1784/2051 Failed to read /local/domain/0/backend/vbd/1784/2051/feature-barrier. Failed to read /local/domain/0/backend/vbd/1784/2051/feature-flush-cache. 1835008 sectors of 0 bytes


[H [J

GNU GRUB version 0.97 (1740800K lower / 0K upper memory)

[m [4;2H+-------------------------------------------------------------------------+ [5;2H| [5;76H| [6;2H| [6;76H| [7;2H| [7;76H| [8;2H| [8;76H| [9;2H| [9;76H| [10;2H| [10;76H| [11;2H| [11;76H| [12;2H| [12;76H| [13;2H| [13;76H| [14;2H| [14;76H| [15;2H| [15;76H| [16;2H| [16;76H| [17;2H+-------------------------------------------------------------------------+ [m

Use the ^ and v keys to select which entry is highlighted.

Press enter to boot the selected OS, 'e' to edit the

commands before booting, or 'c' for a command-line. [5;78H [m [7m [5;3H Debian [5;75H [m [m [6;3H [6;75H [m [m [7;3H [7;75H [m [m [8;3H [8;75H [m [m [9;3H [9;75H [m [m [10;3H [10;75H [m [m [11;3H [11;75H [m [m [12;3H [12;75H [m [m [13;3H [13;75H [m [m [14;3H [14;75H [m [m [15;3H [15;75H [m [m [16;3H [16;75H [m [16;78H [5;75H

share|improve this question
1  
Building a working AMI for EC2 takes much more work than what you've done. You are also not providing enough details about the exact steps you took so far. You don't even mention what distro you're trying to build (debootstrap is for debian, ubuntu; Amazon Linux is CentOS based). I recommend you find reputable instructions for building a working AMI and follow them. Or create private AMIs using ec2-create-image against a running instance. –  Eric Hammond Sep 19 '11 at 6:14
    
Now I also installed a kernel, created a /boot/grub/menu.lst or whatever that file has to be called (the filename correct as you will see) and tried both hd0 and hd00 kernels. Now I see this output: pastebin.com/Efam617d –  backstabber2000 Sep 19 '11 at 15:39
    
What EC2 AMI building guide are you following? It's pretty much a waste of your time to try to figure out on your own how to build an AMI from scratch by adding random files to the image. Others have solved the issues and published instructions based on years of best practices from the community and hard lessons learned. –  Eric Hammond Sep 20 '11 at 1:03
    
I was following this guide before: gista.blog.root.cz/2010/10/18/… –  backstabber2000 Sep 21 '11 at 17:25
    
When you followed the guide exactly did it work? –  Eric Hammond Sep 21 '11 at 20:43

1 Answer 1

up vote 2 down vote accepted

According to this write-up:

  • You may have selected the wrong kernel and it is trying to boot from a non-existant partition. Make sure you are using the correct pv-grub kernel hd0 vs hd00.

  • You forgot to install grub or installed grub in the wrong place. Make sure you have either /boot/grub/menu.lst or /boot/boot/grub/menu.lst

  • You have a bad menu.lst file. One mistake I made was giving a boot item a title with a space in it. Make the menu.lst as simple as you can until you get it to boot.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.