Friday, August 10, 2007

running iso image from hardisk using grub

sometimes you just wanna try a new linux, but you don't wanna burn it to a cd first, grub can be used to do that. [you need to run these command as root or use sudo in ubuntu]

1. mount the iso:
% mkdir /mnt/iso
% mount -o loop /path-to your-iso/youriso.iso /mnt/iso

2. copy vmlinuz and initrd to the /boot
% cd /mnt/iso/boot
% cp vmlinuz /boot/vmlinuz-yourdistro
% cp initrd.img /boot/initrd-YourDistro.img

3. modify /boot/grub/grub.conf (linked to by /etc/grub.conf)

This assumes that /boot is in the first partition of the first hard drive, usually /dev/hda1

title YourDistro
root(hd0,0)
kernel /vmlinuz-YourDistro
initrd /initrd-YourDistro.img

Now you can reboot your pc and run the live cd.

1 comment:

Anonymous said...

All this does is boot the kernel and initrd that's on the iso. You'll need to copy out all the data from the iso.

The instructions are woefully incomplete.