You are not logged in.

#1 2021-02-09 07:45:32

SayantanRC
Member
Registered: 2020-05-18
Posts: 9

Boot from an arch linux .img file

So I have made a clone of my arch linux setup using dd
I would like to boot this on a different PC.

I have made the following entry on my /etc/grub.d/40_custom:

menuentry "Test" {
  img_path="/os/bootables/arch.img"
  search --no-floppy --set=root --file $img_path
  loopback loop $img_path
  linux (loop)/boot/vmlinuz-linux root=$img_path
  initrd (loop)/boot/initramfs-linux.img
}

During booting, it says that the root is not found. I have also tried giving the UUID of the image file as root=UUID=*uuid_from_blkid* but that also does not work as the img file is not mounted.

Can anyone help me what to put in the root argument?
Thank you.

Offline

#2 2021-02-10 18:00:35

demaio
Member
From: Germany
Registered: 2012-09-02
Posts: 102
Website

Re: Boot from an arch linux .img file

I wanted to do something similar but never got it finished. But I bookmarked an old thread about this topic: https://bbs.archlinux.org/viewtopic.php?id=95663

Maybe the hints there are still relevant...

Offline

#3 2021-02-10 18:45:19

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Boot from an arch linux .img file

I think you need to define the partition which contains the image file.

Something like this (replace actual_uuid with the actual UUID of the partition containing the image file):

menuentry "Test" {
  img_path="/os/bootables/arch.img"
  search --no-floppy --set=root --fs-uuid actual_uuid
  loopback loop $img_path
  linux (loop)/boot/vmlinuz-linux root=UUID=actual_uuid loop=$img_path rw
  initrd (loop)/boot/initramfs-linux.img
}

(Untested.)


Jin, Jîyan, Azadî

Offline

Board footer

Powered by FluxBB