[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Grub2 does not detect any devices

From: Maxim Blinov
Subject: Grub2 does not detect any devices
Date: Wed, 10 Aug 2016 13:18:58 +0100

Hi, I'm having some trouble with (what I suspect) a custom core.img binary
to work.

I have a 1Gb HDD image (created using bximage for Bochs), onto which I wish
to install Grub 2. There is no OS present.

I understand that a Grub installation consists of 3 parts:

 - The boot.img image, which occupies the first sector
 - The core.img image, which occupies space following the first sector up
until the start of the next track
 - And the /boot/grub/ directory, in which the grub.cfg and other modules
are located.


First I use a boot.img image that from within my own Linux /boot/grub/

Following this, I generate my core.img image using the following command:

sudo grub-mkimage -v --format=i386-pc -o core.img
-p\(hd0,msdos1\)/boot/grub ls ext2 part_msdos

And to install them onto the final disk image, I use the following commands:

 - sudo dd if=boot.img of=/dev/loop0 bs=446 count=1
 - sudo dd if=core.img of=/dev/loop0 bs=512 seek=1


The disk, starting from sector 2048 until the last, is formatted with an
ext2 partition, and contains a boot/grub/ directory containing a grub.cfg
(with a single bogus menuentry which doesn't load anything), and modules in
the /boot/grub/i386-pc/ directory.

Bochs successfully boots this installation of grub all the way to the grub>
prompt. I understand that this behaviour indicates that grub.cfg was not

Upon invoking `ls`, I apparently have no devices connected at all.

I also observed that when booting a `grub-mkrescue` image from a slave
drive, invoking `ls` displayed its own rescue drive, *and* the previously
'non-existant' primary disk drive, along with the ext2 partition. I
verified that /boot/grub.cfg could indeed be accessed.

>From this observation I would assume that my own core.img is missing some
fundamental module or functionality. But which, and how would I amend this?


I also conducted this exercise on a physical machine using a USB stick, and
the exact same thing happened, so I can confirm that the problem is not
with Bochs.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]