About the Post

Author Information

Chris is a Software Engineering Master's student at Tartu University, with a Enterprise specialization. He has industry experience developing and operating massively scaled web applications.

Kernel 32 vs 64 discovery

We were recently given a VirtualBox image configured to run the HPCC benchmark suite. The code to determine the OS architecture is pretty naive, and we paid for it. The code simply checked for the presence of the substring ‘amd64′ in the kernel name. The image didn’t have it, so it was migrated to EC2 as a 32 bit architecture.
After the migration, I ran a test boot, and was unable to the new host. The host’s console log retrieved from the EC2 web console gave this a the last line:

[1.078052] request_module: runaway loop modprobe binfmt-464c

which led me to this very helpful blog post, which explains that this failure to boot is cause by a mismatched in kernel and OS word size.

I checked a canonical binary on the source image:

file `realpath /bin/sh`
/bin/dash: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

which confirmed the source of the problem. I’ll be adding a programmatic check such as this into our tool.


2 Responses to “Kernel 32 vs 64 discovery”

  1. Ilja #

    uname -i ?

    May 11, 2011 at 15:22 Reply
    • uname -i only works some of the time. For instance, running it on my Debian 6 VM returns “unknown.” This also assumes that the OS under question is running. In my case, I’m modifying an image file.
      I’m moving the whole VM image to EC2 AMI process use guestfs (which I’ll blog about later). Using guestfs, I’ll probe a file or two using guestfs_file_architecture.

      May 15, 2011 at 18:10 Reply

Leave a Reply