SystemRescueCD boot iso from within grub2

Post in this forum for problems at boot time, if there was no problem for burning the disc. For example can't find the CD, or strange errors when you press enter at the very first prompt.
MinasMorgul
Posts: 2
Joined: 05 Jan 2011, 15:13

Re: SystemRescueCD boot iso from within grub2

Postby MinasMorgul » 05 Jan 2011, 17:11

So ... has anyone put together a manual on how to install SystemRescue on a usb device to boot from its iso file?
All I've seen is bits and pieces of the process


Here's my routine (still buggy):

1) fdisk my usb into partitions

Code: Select all

   Device  Boot      Start        End      Blocks   Id  System
/dev/sdb1   *           1         132     1060258+   b  W95 FAT32
/dev/sdb2             133       60801   487323742+   7  HPFS/NTFS


2) format these partitions

Code: Select all

mkfs -t vfat -F 32 -n RESCUE /dev/sdb1
mkfs -t ntfs -L CLIENTDATA /dev/sdb2


3) mount the first partition

Code: Select all

mount /dev/sdb1 /mnt/usbstick


4) copy systemrescuecd-x86-x.y.z.iso to the root usb device directory

Code: Select all

cp -a /home/guest-usr/Downloads/systemrescuecd-x86-2.0.0.iso /mnt/usbstick/


5) copy GrUB2 staging files from an existing GrUB2 installation (I'm currently going through a Ubuntu (maverick) phase)

Code: Select all

mkdir -p /mnt/usbstick/boot/grub
cp -a /boot/grub/* /mnt/usbstick/boot/grub/


6) install GrUB2

Code: Select all

grub-install --no-floppy --root-directory=/mnt/usbstick/ /dev/sdb


7) create a grub.cfg file within /mnt/usbstick/boot/grub
Here's mine:

Code: Select all

#
# grub.cfg
#
set default="0"
set timeout=10

set root='(hd0,1)'
set latest='systemrescuecd-x86-2.0.0.iso'

menuentry "SystemRescueCD 32bit" {
   loopback loop (hd0,1)/$latest
   echo   'Loading SystemRescue CD 32 bit ...'
   linux   (loop)/isolinux/rescuecd usbstick setkmap=us docache isoloop=$latest
   echo   'Loading initial ramdisk ...'
   initrd   (loop)/isolinux/initram.igz
}

menuentry "SystemRescueCD 64bit" {
   loopback loop (hd0,1)/$latest
   echo   'Loading SystemRescue CD 64 bit ...'
   linux   (loop)/isolinux/rescue64 usbstick setkmap=us docache isoloop=$latest
   echo   'Loading initial ramdisk ...'
   initrd   (loop)/isolinux/initram.igz
}

menuentry "SystemRescueCD 32bit (alternate kernel)" {
   loopback loop (hd0,1)/$latest
   echo   'Loading SystemRescueCD 32bit alternate kernel...'
   linux   (loop)/isolinux/altker32 usbstick setkmap=us docache isoloop=$latest
   echo   'Loading initial ramdisk ...'
   initrd   (loop)/isolinux/initram.igz
}

menuentry "SystemRescueCD 64bit (alternate kernel)" {
   loopback loop (hd0,1)/$latest
   echo   'Loading SystemRescueCD 64bit alternate kernel...'
   linux   (loop)/isolinux/altker64 usbstick setkmap=us docache isoloop=$latest
   echo   'Loading initial ramdisk ...'
   initrd   (loop)/isolinux/initram.igz
}

menuentry "MemTest+" {
    loopback loop (hd0,1)/$latest
    linux  (loop)/isolinux/memtestp
    initrd (loop)/bootdisk/initrd.cgz
}

menueentry "NT Password Editor" {
    loopback loop (hd0,1)/$latest
    linux  (loop)/ntpasswd/vmlinuz
    initrd (loop)/ntpasswd/initrd.cgz
}

menuentry "GAG -- Graphical Boot Manager" {
    loopback loop (hd0,1)/$latest
    linux  (loop)/isolinux/memdisk
    initrd (loop)/bootdisk/gag.img
}

menuentry "MHDD -- Low-Level HDD Diagnostics" {
    loopback loop (hd0,1)/$latest
    linux  (loop)/isolinux/memdisk
    initrd (loop)/bootdisk/mhdd.img
}

menuentry "Hardware Detection Tool" {
    loopback loop (hd0,1)/$latest
    linux  (loop)/isolinux/memdisk
    initrd (loop)/bootdisk/hdt.img
}

menuentry "Aida -- System Info & Diagnostics" {
    loopback loop (hd0,1)/$latest
    linux  (loop)/isolinux/memdisk
    initrd (loop)/bootdisk/aida.img
}

menuentry "Ranish Partition Manager" {
    loopback loop (hd0,1)/$latest
    linux  (loop)/isolinux/memdisk
    initrd (loop)/bootdisk/ranish.img
}

menuentry "FreeDOS" {
    loopback loop (hd0,1)/$latest
    linux  (loop)/isolinux/memdisk
    initrd (loop)/bootdisk/freedos.img
}


When trying to boot from the usb device, I get an "This is not a bootable disk. please insert a bootable ..." error

Anyone got some advice on what I'm missing?

LazyKent
Posts: 29
Joined: 12 Dec 2009, 09:30
Location: Moscow, Russia

Re: SystemRescueCD boot iso from within grub2

Postby LazyKent » 06 Jan 2011, 18:46

I think, you should correct (hd0,1) to (hd0,0).

MinasMorgul
Posts: 2
Joined: 05 Jan 2011, 15:13

Re: SystemRescueCD boot iso from within grub2

Postby MinasMorgul » 06 Jan 2011, 21:02

It was my understanding that partition addressing in grub2 was changed to "1" based addressing rather the the old grub-legacy format of "0" based addressing
i.e. hd0,1 - first device, first partition

Anyways, I have my usb device somewhat booting (though with non-fatal error) by changing the Fat32 partition to linux (ext4) partition
But I will give your suggestion a try.

Thx

w2vy
Posts: 4
Joined: 14 Sep 2011, 20:59

Re: SystemRescueCD boot iso from within grub2

Postby w2vy » 14 Sep 2011, 21:06

Booting from an ISO sounds like what I need to do, but...

Once grub2 loads and runs the system what state will the partition
the ISO image is on be in?

Can it be loaded Read-Only? Read-Write?

This will help be decide which partition to put the iso image on.

tom

w2vy
Posts: 4
Joined: 14 Sep 2011, 20:59

Re: SystemRescueCD boot iso from within grub2

Postby w2vy » 15 Sep 2011, 03:02

I decided to try it myself and am having a hard time to get an entry to show up in the grub menu!

This whole thread talks about editing grub.cfg, but that is not typical

Code: Select all

# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#


So I decided to try adding a menu entry in /etc/grub.d/40_custom

Code: Select all

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
mennuentry "SystemResuceCD (isoloop)" --class os {
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos5)'
        search --no-floppy --fs-uuid --set b19523bb-4f3e-4014-b30d-2e1879146d15
        loopback loop /boot/systemrescuecd-x86.2.3.1.iso
        linux (loop)/isolinux/rescuecd isoloop=systemrescuecd-x86-2.3.1.iso
        initrd (loop)/isolinux/initram.igz
}


But nothing shows up!
(Not even errors)

I have looked and the entries are in the grub.cfg (after running update-grub)

tom

gernot
Posts: 1127
Joined: 07 Apr 2010, 16:19

Re: SystemRescueCD boot iso from within grub2

Postby gernot » 15 Sep 2011, 04:26

I don't know how your distribution handle grub.
Tried you to change in /etc/default/grub

Gernot

w2vy
Posts: 4
Joined: 14 Sep 2011, 20:59

Re: SystemRescueCD boot iso from within grub2

Postby w2vy » 15 Sep 2011, 12:52

(blush)

Code: Select all

mennuentry "SystemResuceCD (isoloop)" --class os {

There is only ONE N in MenuEntry

oops - I was surprised that no warning for unknown commands... Live and Learn

tom

w2vy
Posts: 4
Joined: 14 Sep 2011, 20:59

Re: SystemRescueCD boot iso from within grub2

Postby w2vy » 15 Sep 2011, 15:40

Does SystemRescueCD have a RAM Disk option like described here: http://www.fsarchiver.org/forums/viewtopic.php?f=16&t=1232

With the ISO image only 360MB could the whole image be loaded into the ramdisk?

That would be very cool. (maybe this is a new topic :) )

tom

rbeede
Posts: 48
Joined: 16 May 2008, 21:10
Location: U.S.A.
Contact:

Re: SystemRescueCD boot iso from within grub2

Postby rbeede » 23 Oct 2011, 02:27

For grub2 on a usb booting iso's this is the config I've found that works:

2GB USB formatted FAT32
Used Linux to write MBR with Grub2
/boot/grub has all the grub files including /boot/grub/grub.cfg
/boot/isos has all of my isos (notice the sub-directory versus isos in the root of the device)
System Rescue CD version systemrescuecd-x86-2.3.1

/boot/grub/grub.cfg

Code: Select all

menuentry "Ubuntu 11.04 Desktop x86 (toram)" {
   set isofile="/boot/isos/ubuntu-11.04-desktop-i386.iso"

   loopback loop $isofile
   linux (loop)/casper/vmlinuz boot=casper toram iso-scan/filename=$isofile quiet splash noprompt --
   initrd (loop)/casper/initrd.lz
}

menuentry "Ubuntu 11.04 Desktop AMD64" {
   set isofile="/boot/isos/ubuntu-11.04-desktop-amd64.iso"

   loopback loop $isofile
   linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile quiet splash noprompt --
   initrd (loop)/casper/initrd.lz
}



set isofilename="systemrescuecd-x86-2.3.1.iso"
# Because System Rescue CD's boot loader adds a / when searching as it really likes it in the root of the drive
set isorelativepath="boot/isos/$isofilename"
set isofullpathname="/$isorelativepath"

menuentry "systemrescuecd-x86-2.3.1 (isoloop)" {
   loopback loop $isofullpathname
   
   linux (loop)/isolinux/rescuecd isoloop=$isorelativepath
   initrd (loop)/isolinux/initram.igz
}

menuentry "System Rescue CD MemTest86+" {
    loopback loop $isofullpathname
   
    linux16  (loop)/bootdisk/memtestp

}


I also happen to have entries for Ubuntu. Note that you can use the docache param with System Rescue CD versus using grub2's --mem option for the iso.

taa
Posts: 5
Joined: 05 Dec 2007, 16:06

Re: SystemRescueCD boot iso from within grub2

Postby taa » 27 Nov 2014, 10:12

quiller wrote:
And if I understand well, there is no way to get the blue isolinux menu from an iso boot with grub2? It would be nice to see the same menu as when booting from USB or CD.

admin wrote:It's a completely different configuration file. We can try to do something similar with Grub.
But I want to keep isolinux for the official version, just because I don't think we can show different menus (when you press F2, F3, ...) with Grub, and it's quite important to provide documentation for various boot options.

I have no idea of the technical challenges to do this (other than "it's a completely different configuration file") but I would like to do what quiller is describing because of the convenience of simply replacing the .iso in grub2 to get all of the boot options (isolinux.cfg), particularly the ones available on the floppy image menu. The quotes above are four years old so I'm wondering if during that time there have been changes to SystemRescueCD that would make this possible or at least easier?

mmokrejs
Posts: 2
Joined: 27 Dec 2016, 21:08

Re: SystemRescueCD boot iso from within grub2

Postby mmokrejs » 27 Dec 2016, 21:27

For me the following entries work under grub2.

Code: Select all

menuentry "SystemRescueCD" {
        set iso=/systemrescuecd-x86-4.8.1.iso
        loopback loop ${iso}
        linux  (loop)/isolinux/rescue64 nomodeset docache setkmap=us isoloop=${iso}
        initrd (loop)/isolinux/initram.igz
}

menuentry "Clonezilla live" {
        set isofile="/clonezilla-live-2.4.7-8-amd64.iso"
        loopback loop ${isofile}
        linux (loop)/live/vmlinuz boot=live union=overlay username=user config components quiet noswap nolocales edd=on nomodeset nodmraid ocs_live_run=\"ocs-live-general\" ocs_live_extra_param=\"\" keyboard-layouts= ocs_live_batch=\"no\" locales= vga=788 ip=frommedia nosplash toram=filesystem.squashfs findiso=$isofile
        initrd (loop)/live/initrd.img
}

taa
Posts: 5
Joined: 05 Dec 2007, 16:06

Re: SystemRescueCD boot iso from within grub2

Postby taa » 29 Dec 2016, 22:42

admin wrote:It's a completely different configuration file. We can try to do something similar with Grub.


It's been a couple of years since my post above and booting into the "blue menu" is something I want very much to do for reasons stated above. I see from the change log that 4.9.0 has a new version of grub2.

So what will it take to be able to have a single grub2 menu entry that boots from the iso to the "blue menu"? What exactly is the difficulty with having "a completely different configuration file"? Can you elaborate on what "try to do something similar with Grub" means?

The following screen capture shows what I'm referring to; I realize the version in the screen capture is old.
Image

fmansito
Posts: 3
Joined: 04 Jun 2010, 19:10

Re: SystemRescueCD boot iso from within grub2

Postby fmansito » 11 Feb 2017, 19:29

In Linux Mint 4.4.0.53 I have modified grub.cfg to include the admin's 17-07-2003 code to boot systemrescuecd from within grub2. update-grub2 has supresssed the code. I have included the code anew as well as "exec tail" as suggested by grub.cfg itself. updadte-grub2 has suppressed both the code and "exec tail".


Return to “Boot problems”

Who is online

Users browsing this forum: No registered users and 2 guests