Add entry to GRUB2 to boot G4L iso

If none of the more specific forums is the right place to ask

Add entry to GRUB2 to boot G4L iso

Postby graciano » 2017-04-09 16:03

Hi,

I dowloaded the g4l-v0.30.iso from https://sourceforge.net/projects/g4l/
I wish to add a GRUB entry to boot this iso.
I'm using Debian 8.
My fdisk -l:
Code: Select all
Disk /dev/sda: 149,1 GiB, 160041885696 bytes, 312581808 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x000db537

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1  *           63 209717247 209717185  100G  7 HPFS/NTFS/exFAT
/dev/sda2       209719294 312580095 102860802   49G  5 Extended
/dev/sda5       209719296 308314111  98594816   47G 83 Linux
/dev/sda6       308316160 312580095   4263936    2G 82 Linux swap / Solaris


Where to place the iso and how to boot from it?
Thanks
User avatar
graciano
 
Posts: 194
Joined: 2008-07-07 11:36
Location: Portugal

Re: Add entry to GRUB2 to boot G4L iso

Postby phenest » 2017-04-09 16:11

I did a Google search of "boot iso from grub" and got 419,000 hits. Any of those any good to you?
NEC Spirit 550 P4 3.8GHz HT - 2GB RAM - nVidia 7600GT - Pioneer BDR-209DBK
ASUS Sabertooth P67 i7 3770K - 32GB RAM - 2x nVidia 660GTX SLI'd
User avatar
phenest
 
Posts: 1571
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Add entry to GRUB2 to boot G4L iso

Postby graciano » 2017-04-09 16:59

I tried some of those but had no success ... so i hasked here.
Thanks for the !Help.
User avatar
graciano
 
Posts: 194
Joined: 2008-07-07 11:36
Location: Portugal

Re: Add entry to GRUB2 to boot G4L iso

Postby debiman » 2017-04-09 17:30

what did you try?
show us.
where is the iso, what did you add to grub.cfg, did you run update-grub afterwards (you shouldn't if you edit grub directly)... etc...
User avatar
debiman
 
Posts: 1619
Joined: 2013-03-12 07:18

Re: Add entry to GRUB2 to boot G4L iso

Postby phenest » 2017-04-09 17:59

This what I tried, taken from https://community.linuxmint.com/tutorial/view/1849

Edit /etc/grub.d/40_custom as root, and add this:
Code: Select all
menuentry "Mint 18.1 Mate Live ISO" {
set isofile=/steve/archive/iso/linux/linuxmint-18.1-mate-64bit.iso
loopback loop (hd0,3)${isofile}
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=${isofile}
initrd (loop)/casper/initrd.lz
}

Then run update-grub and reboot.

Any questions?
NEC Spirit 550 P4 3.8GHz HT - 2GB RAM - nVidia 7600GT - Pioneer BDR-209DBK
ASUS Sabertooth P67 i7 3770K - 32GB RAM - 2x nVidia 660GTX SLI'd
User avatar
phenest
 
Posts: 1571
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Add entry to GRUB2 to boot G4L iso

Postby sunrat » 2017-04-09 21:47

phenest wrote:Any questions?

Erm, yeah. What happened then? Did it show in the Grub menu? Did it start to boot and stop with an error? Post the error.

There are endless kinds of "didn't work". Tell us what your particular "didn't work" is and we may be able to help.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 2056
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Add entry to GRUB2 to boot G4L iso

Postby graciano » 2017-04-09 22:03

I managed to boot with this script:
Code: Select all
#!/bin/sh -e
echo "(G4L)Hard disk and partition imaging and cloning tool."
cat << EOF

### BEGIN /etc/grub.d/65_g4l ###
menuentry '(G4L)Hard disk and partition imaging and cloning tool.' --class debian --class gnu-linux --class gnu --class os {
   insmod part_msdos
        insmod ext2
        set root='(hd0,msdos5)'
        linux /g4l/bz29.3 ramdisk_size=65536 root=/dev/ram0
        initrd /g4l/ramdisk.gz
}
echo "..."
EOF


The only diference was that i extracted the files of the iso to the /g4l folder.
This is not "booting from iso" but saves me some time.
I will try it latter but i think my main mistake was using insmodext4 instead of insmodext2 !
User avatar
graciano
 
Posts: 194
Joined: 2008-07-07 11:36
Location: Portugal

Re: Add entry to GRUB2 to boot G4L iso

Postby phenest » 2017-04-11 13:35

sunrat wrote:
phenest wrote:Any questions?

Erm, yeah. What happened then? Did it show in the Grub menu? Did it start to boot and stop with an error? Post the error.

There are endless kinds of "didn't work". Tell us what your particular "didn't work" is and we may be able to help.

Who said it didn't work? It worked perfectly.
NEC Spirit 550 P4 3.8GHz HT - 2GB RAM - nVidia 7600GT - Pioneer BDR-209DBK
ASUS Sabertooth P67 i7 3770K - 32GB RAM - 2x nVidia 660GTX SLI'd
User avatar
phenest
 
Posts: 1571
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Add entry to GRUB2 to boot G4L iso

Postby sunrat » 2017-04-11 14:43

phenest wrote:
sunrat wrote:
phenest wrote:Any questions?

Erm, yeah. What happened then? Did it show in the Grub menu? Did it start to boot and stop with an error? Post the error.

There are endless kinds of "didn't work". Tell us what your particular "didn't work" is and we may be able to help.

Who said it didn't work? It worked perfectly.

Oops sorry, thought I was replying to OP. My bad.
Happy its working now.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 2056
Joined: 2006-08-29 09:12
Location: Melbourne, Australia


Return to General Questions

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable