Topic: Can you boot a Crunchbang linux ISO image from hard disk using grub 2

Can you do it? Here's how to do it for Sidux: http://mgerards.net/blog/?p=16. Do you have to launch a linux image (install or live) straight or can you get the initial menu as when using a dedicated cd-r?

Re: Can you boot a Crunchbang linux ISO image from hard disk using grub 2

Give it a try and let us know how it goes! smile

Re: Can you boot a Crunchbang linux ISO image from hard disk using grub 2

Well I tried. The result was kernel panic (my first time.) Any better suggestions?

Last edited by jis (2010-05-08 17:46:27)

Re: Can you boot a Crunchbang linux ISO image from hard disk using grub 2

How would you boot the iso file so that the initial menu would be shown? I don't know how to try that.

Re: Can you boot a Crunchbang linux ISO image from hard disk using grub 2

Basically it should be

menuentry "enter fancy name" {
 loopback loop /path/to/image.iso
 linux (loop)/path/to/kernel your fancy options
 initrd (loop)/path/to/initrd
}

To boot into the boot menu, you'd need to chainload it. In theory, this should be done by doing one of the following:

loopback loop /path/to/image.iso
set root=(loop)
chainloader +1
loopback loop /path/to/image.iso
chainloader (loop)+1

But for some reason it doesn't. I did some research, but it seems like grub2 isn't working with the boot sector of the cdfs.

I'm so meta, even this acronym

Re: Can you boot a Crunchbang linux ISO image from hard disk using grub 2

Maybe, if you would make a partition of the ISO file to hard drive somehow, you could chainload the partition using grub?

Re: Can you boot a Crunchbang linux ISO image from hard disk using grub 2

You still had to install the bootloader of the cd to an MBR. I'd rather reconfigure the first grub2 with the boot options of the CD bootloader.

I'm so meta, even this acronym

Re: Can you boot a Crunchbang linux ISO image from hard disk using grub 2

Awebb wrote:

Basically it should be

menuentry "enter fancy name" {
 loopback loop /path/to/image.iso
 linux (loop)/path/to/kernel your fancy options
 initrd (loop)/path/to/initrd
}

I suppose kernel needs the "fromiso=" parameter or equivalent, but I don't know what the kernel used supports.

Re: Can you boot a Crunchbang linux ISO image from hard disk using grub 2

This works for Ubuntu, so I guess there is a solution for CB, too: http://ubuntuforums.org/showpost.php?p= … stcount=11

Re: Can you boot a Crunchbang linux ISO image from hard disk using grub 2

Maybe easier to purchase an inexpensive flash drive and: http://crunchbanglinux.org/wiki/statler … stallation

Re: Can you boot a Crunchbang linux ISO image from hard disk using grub 2

I have an 8gb usb-multiboot, It uses DOS as the menu not grub.
I use it for booting Live-CD images(.iso) of various Linux distros for installation, and some other useful stuff.

Here is the tutorial I followed
http://www.userbytes.com/roll-your-own- … ash-drive/

Re: Can you boot a Crunchbang linux ISO image from hard disk using grub 2

I didn't manage to get the boot from mounted ISO working (I've done it with many other distros) but booting from mounted squashfs works. On with the show:

Grub needs 3 things: kernel, initial RAM image and root filesystem. I found those in /live directory of the Live CD. Copied them to harddisk (/boot/crunch on /dev/sda2 which is the root partition of my Ubuntu - sda1 is swap) and added the entry to Grub2.

First mount the ISO:

sudo mkdir -p /mnt/iso
sudo mount -o loop /path/to/crunchbang-10-alpha-02-openbox-i686.iso /mnt/iso

Create directory for kernel, initial RAM image and root file system, copy files, unmount ISO:

sudo mkdir -p /boot/crunch
sudo cp -v /mnt/iso/live/vmlinuz /mnt/iso/live/initrd.img /mnt/iso/live/filesystem.squashfs /boot/crunch/
sudo umount /mnt/iso

Create Grub2 entry (In Ubuntu I added this to /etc/grub.d/40_custom):

menuentry "CrunchBang Statler squashfs" {
set root=(hd0,2)
linux  /boot/crunch/vmlinuz boot=live live-config live-config.hostname=crunchbang live-config.username=crunchbang live-media-path=/boot/crunch quiet splash
initrd /boot/crunch/initrd.img
}

Update Grub and you're ready to reboot and test:

sudo update-grub

Last edited by nomalab (2010-10-26 01:41:54)