Skip to main content
Tweeted twitter.com/#!/StackUnix/status/642351953662595072
deleted 76 characters in body
Source Link
user877329
  • 741
  • 9
  • 24

To learn about Linux startup process I placed grub in a disk image file and tried to boot using qemu. I currently has not put any kernel image into the drive just grub. I installed grub using

kpartx -av mydrive.img
losetup /dev/loop1 /dev/mapper/loop0p1
mount /dev/loop1 mnt/mydrive/
cd mnt/mydrive/boot
grub-install --no-floppy --boot-directory=. -v /dev/loop0

I wanted to go through the boot sequence step by step, so I expected grub to claim that the kernel is missing, then I want to fix that by installing the kernel, and continue adding stuff all the way up to X.

Now I get

error: no such device

But expected

error: no configuration file

form rescue prompt, ls gives

(hd0) (fd0)

Questions:

  • Why is the /boot/grub directory empty [SOLVED, I needed to remap /boot so grub-install installs grub in the guest system]
  • What device is grub looking for? Is that something that refers to the host system? [Partially solved, the UUID is the same as the UUID for the virtual file system]
  • Why cannot Grub find the device?
  • What is the minimal to put in grub.cfg after putting the kernel in place

Chrooting to the guest system will not work,All works fine if I install grub (and nothing but grub) from a live-cd (I chose Bodhi-linux since therethis is nothing there yeta small binary distro) inside the VM. Will qemu give the boot partition a different uuid, not used outside?

Here is the partition table for the virtual drive:

Disk mydrive.img: 264 MB, 264241152 byte
32 huvuden, 63 sektorer/spår, 256 cylindrar, totalt 516096 sektorer
Enheter = sektorer av 1 · 512 = 512 byte
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Diskidentifierare: 0xebe6ebdb

       Enhet Start     Början        Slut     Block    Id  System
mydrive.img1            2048      516095      257024   83  Linux

After remapping the host /boot directory, files are copied to the guest /boot directory. But now I only see (hd0) in QEMU.

To learn about Linux startup process I placed grub in a disk image file and tried to boot using qemu. I currently has not put any kernel image into the drive just grub. I installed grub using

kpartx -av mydrive.img
grub-install --no-floppy /dev/loop0

I wanted to go through the boot sequence step by step, so I expected grub to claim that the kernel is missing, then I want to fix that by installing the kernel, and continue adding stuff all the way up to X.

Now I get

error: no such device

But expected

error: no configuration file

form rescue prompt, ls gives

(hd0) (fd0)

Questions:

  • Why is the /boot/grub directory empty [SOLVED, I needed to remap /boot so grub-install installs grub in the guest system]
  • What device is grub looking for? Is that something that refers to the host system? [Partially solved, the UUID is the same as the UUID for the virtual file system]
  • Why cannot Grub find the device?
  • What is the minimal to put in grub.cfg after putting the kernel in place

Chrooting to the guest system will not work, since there is nothing there yet.

Here is the partition table for the virtual drive:

Disk mydrive.img: 264 MB, 264241152 byte
32 huvuden, 63 sektorer/spår, 256 cylindrar, totalt 516096 sektorer
Enheter = sektorer av 1 · 512 = 512 byte
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Diskidentifierare: 0xebe6ebdb

       Enhet Start     Början        Slut     Block    Id  System
mydrive.img1            2048      516095      257024   83  Linux

After remapping the host /boot directory, files are copied to the guest /boot directory. But now I only see (hd0) in QEMU.

To learn about Linux startup process I placed grub in a disk image file and tried to boot using qemu. I currently has not put any kernel image into the drive just grub. I installed grub using

kpartx -av mydrive.img
losetup /dev/loop1 /dev/mapper/loop0p1
mount /dev/loop1 mnt/mydrive/
cd mnt/mydrive/boot
grub-install --no-floppy --boot-directory=. -v /dev/loop0

I wanted to go through the boot sequence step by step, so I expected grub to claim that the kernel is missing, then I want to fix that by installing the kernel, and continue adding stuff all the way up to X.

Now I get

error: no such device

But expected

error: no configuration file

form rescue prompt, ls gives

(hd0) (fd0)

Questions:

  • What device is grub looking for? Is that something that refers to the host system? [Partially solved, the UUID is the same as the UUID for the virtual file system]
  • Why cannot Grub find the device?

All works fine if I install grub (and nothing but grub) from a live-cd (I chose Bodhi-linux since this is a small binary distro) inside the VM. Will qemu give the boot partition a different uuid, not used outside?

Here is the partition table for the virtual drive:

Disk mydrive.img: 264 MB, 264241152 byte
32 huvuden, 63 sektorer/spår, 256 cylindrar, totalt 516096 sektorer
Enheter = sektorer av 1 · 512 = 512 byte
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Diskidentifierare: 0xebe6ebdb

       Enhet Start     Början        Slut     Block    Id  System
mydrive.img1            2048      516095      257024   83  Linux
added 118 characters in body
Source Link
user877329
  • 741
  • 9
  • 24

To learn about Linux startup process I placed grub in a disk image file and tried to boot using qemu. I currently has not put any kernel image into the drive just grub. I installed grub using

kpartx -av mydrive.img
grub-install --no-floppy /dev/loop0

I wanted to go through the boot sequence step by step, so I expected grub to claim that the kernel is missing, then I want to fix that by installing the kernel, and continue adding stuff all the way up to X.

Now I get

error: no such device

But expected

error: no configuration file

form rescue prompt, ls gives

(hd0) (fd0)

Questions:

  • Why is the /boot/grub directory empty [SOLVED, I needed to remap /boot so grub-install installs grub in the guest system]
  • What device is grub looking for? Is that something that refers to the host system? [Partially solved, the UUID is the same as the UUID for the virtual file system]
  • Why cannot Grub find the device?
  • What is the minimal to put in grub.cfg after putting the kernel in place

Chrooting to the guest system will not work, since there is nothing there yet.

Here is the partition table for the virtual drive:

Disk mydrive.img: 264 MB, 264241152 byte
32 huvuden, 63 sektorer/spår, 256 cylindrar, totalt 516096 sektorer
Enheter = sektorer av 1 · 512 = 512 byte
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Diskidentifierare: 0xebe6ebdb

       Enhet Start     Början        Slut     Block    Id  System
mydrive.img1            2048      516095      257024   83  Linux

After remapping the host /boot directory, files are copied to the guest /boot directory. But now I only see (hd0) in QEMU.

To learn about Linux startup process I placed grub in a disk image file and tried to boot using qemu. I currently has not put any kernel image into the drive just grub. I installed grub using

kpartx -av mydrive.img
grub-install --no-floppy /dev/loop0

I wanted to go through the boot sequence step by step, so I expected grub to claim that the kernel is missing, then I want to fix that by installing the kernel, and continue adding stuff all the way up to X.

Now I get

error: no such device

But expected

error: no configuration file

form rescue prompt, ls gives

(hd0) (fd0)

Questions:

  • Why is the /boot/grub directory empty [SOLVED, I needed to remap /boot so grub-install installs grub in the guest system]
  • What device is grub looking for? Is that something that refers to the host system?
  • What is the minimal to put in grub.cfg after putting the kernel in place

Chrooting to the guest system will not work, since there is nothing there yet.

Here is the partition table for the virtual drive:

Disk mydrive.img: 264 MB, 264241152 byte
32 huvuden, 63 sektorer/spår, 256 cylindrar, totalt 516096 sektorer
Enheter = sektorer av 1 · 512 = 512 byte
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Diskidentifierare: 0xebe6ebdb

       Enhet Start     Början        Slut     Block    Id  System
mydrive.img1            2048      516095      257024   83  Linux

After remapping the host /boot directory, files are copied to the guest /boot directory. But now I only see (hd0) in QEMU.

To learn about Linux startup process I placed grub in a disk image file and tried to boot using qemu. I currently has not put any kernel image into the drive just grub. I installed grub using

kpartx -av mydrive.img
grub-install --no-floppy /dev/loop0

I wanted to go through the boot sequence step by step, so I expected grub to claim that the kernel is missing, then I want to fix that by installing the kernel, and continue adding stuff all the way up to X.

Now I get

error: no such device

But expected

error: no configuration file

form rescue prompt, ls gives

(hd0) (fd0)

Questions:

  • Why is the /boot/grub directory empty [SOLVED, I needed to remap /boot so grub-install installs grub in the guest system]
  • What device is grub looking for? Is that something that refers to the host system? [Partially solved, the UUID is the same as the UUID for the virtual file system]
  • Why cannot Grub find the device?
  • What is the minimal to put in grub.cfg after putting the kernel in place

Chrooting to the guest system will not work, since there is nothing there yet.

Here is the partition table for the virtual drive:

Disk mydrive.img: 264 MB, 264241152 byte
32 huvuden, 63 sektorer/spår, 256 cylindrar, totalt 516096 sektorer
Enheter = sektorer av 1 · 512 = 512 byte
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Diskidentifierare: 0xebe6ebdb

       Enhet Start     Början        Slut     Block    Id  System
mydrive.img1            2048      516095      257024   83  Linux

After remapping the host /boot directory, files are copied to the guest /boot directory. But now I only see (hd0) in QEMU.

added 265 characters in body
Source Link
user877329
  • 741
  • 9
  • 24

To learn about Linux startup process I placed grub in a disk image file and tried to boot using qemu. I currently has not put any kernel image into the drive just grub. I installed grub using

kpartx -av mydrive.img
grub-install --no-floppy /dev/loop0

AfterI wanted to go through the boot sequence step by step, so I expected grub to claim that the kernel is missing, then I want to fix that by installing the virtual machine boots grubkernel, and continue adding stuff all the way up to X. There are no files in /boot/grub

Grub gives errorNow I get

error: no such device

But expected

error: no configuration file

form rescue prompt, ls gives

(hd0) (hd0,msdos1) (fd0)

Questions:

  • Why is the /boot/grub directory empty [SOLVED, I needed to remap /boot so grub-install installs grub in the guest system]
  • What device is grub looking for (the id doesn't tell me anything)? Is that something that refers to the host system?
  • What is the minimal to put in grub.cfg after putting the kernel in place

Chrooting to the guest system will not work, since there is nothing there yet.

Here is the partition table for the virtual drive:

Disk mydrive.img: 264 MB, 264241152 byte
32 huvuden, 63 sektorer/spår, 256 cylindrar, totalt 516096 sektorer
Enheter = sektorer av 1 · 512 = 512 byte
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Diskidentifierare: 0xebe6ebdb

       Enhet Start     Början        Slut     Block    Id  System
mydrive.img1            2048      516095      257024   83  Linux

After remapping the host /boot directory, files are copied to the guest /boot directory. But now I only see (hd0) in QEMU.

To learn about Linux startup process I placed grub in a disk image file and tried to boot using qemu. I currently has not put any kernel image into the drive just grub. I installed grub using

kpartx -av mydrive.img
grub-install --no-floppy /dev/loop0

After that, the virtual machine boots grub. There are no files in /boot/grub

Grub gives error

error: no such device

form rescue prompt, ls gives

(hd0) (hd0,msdos1) (fd0)

Questions:

  • Why is the /boot/grub directory empty
  • What device is grub looking for (the id doesn't tell me anything)
  • What is the minimal to put in grub.cfg after putting the kernel in place

Chrooting to the guest system will not work, since there is nothing there yet.

Here is the partition table for the virtual drive:

Disk mydrive.img: 264 MB, 264241152 byte
32 huvuden, 63 sektorer/spår, 256 cylindrar, totalt 516096 sektorer
Enheter = sektorer av 1 · 512 = 512 byte
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Diskidentifierare: 0xebe6ebdb

       Enhet Start     Början        Slut     Block    Id  System
mydrive.img1            2048      516095      257024   83  Linux

After remapping the host /boot directory, files are copied to the guest /boot directory. But now I only see (hd0) in QEMU.

To learn about Linux startup process I placed grub in a disk image file and tried to boot using qemu. I currently has not put any kernel image into the drive just grub. I installed grub using

kpartx -av mydrive.img
grub-install --no-floppy /dev/loop0

I wanted to go through the boot sequence step by step, so I expected grub to claim that the kernel is missing, then I want to fix that by installing the kernel, and continue adding stuff all the way up to X.

Now I get

error: no such device

But expected

error: no configuration file

form rescue prompt, ls gives

(hd0) (fd0)

Questions:

  • Why is the /boot/grub directory empty [SOLVED, I needed to remap /boot so grub-install installs grub in the guest system]
  • What device is grub looking for? Is that something that refers to the host system?
  • What is the minimal to put in grub.cfg after putting the kernel in place

Chrooting to the guest system will not work, since there is nothing there yet.

Here is the partition table for the virtual drive:

Disk mydrive.img: 264 MB, 264241152 byte
32 huvuden, 63 sektorer/spår, 256 cylindrar, totalt 516096 sektorer
Enheter = sektorer av 1 · 512 = 512 byte
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Diskidentifierare: 0xebe6ebdb

       Enhet Start     Början        Slut     Block    Id  System
mydrive.img1            2048      516095      257024   83  Linux

After remapping the host /boot directory, files are copied to the guest /boot directory. But now I only see (hd0) in QEMU.

added 128 characters in body; edited tags
Source Link
user877329
  • 741
  • 9
  • 24
Loading
added 515 characters in body
Source Link
user877329
  • 741
  • 9
  • 24
Loading
Source Link
user877329
  • 741
  • 9
  • 24
Loading