1st Method:
1. Create a mountpoint to mount the ISO with loopback:
mkdir /mnt/LiveISO
2. mount the image:
mount -t iso9660 -o loop,ro /DOWNLOADS/debian-5.0-i386-en.iso /mnt/LiveISO
3. Create a directory on the device where you are going to boot from:
mkdir /mnt/hda4/Debian-Lenny
4. Copy the contents of the mounted image to that directory:
cp /mnt/LiveISO/Debian-Lenny/* /mnt/hda4/Debian-Lenny/
5. copy kernel and initrd files to your boot device:
cp /mnt/LiveISO/boot/* /boot
* Grub:
title Debian-Lenny
root (hd0,0)
kernel /linux26 ramdisk_size=100000 fromhd=/dev/hda4
initrd /minirt26.gz
savedefault
boot
* Lilo:
image=/boot/linux26
initrd=/boot/minirt26.gz
label=Debian-Lenny
append="ramdisk_size=100000 fromhd=/dev/hda4"
-------------------
The basic idea is that you copy the contents of the ISO to a partition. Then, in your current linux OS, you copy the kernel and initrd images from the ISO to your current boot directory. Last, you edit LILO so that it points to the kernel and initrd images you just copied, and make sure you append the "fromhd" line so that the "livecd" will know where the rest of the Debian-Lenny files are.
2nd Method:
It is possible to boot and install from an debian.iso/ubuntu.iso file on hard-disk. You will need a spare partition on your hard drive and an existing grub menu (on livecd, floppy or hd). This is sometimes known as fromiso or frugal install.
The basic steps are as follows.
* Create and format (if you don't already have one) a partition to boot fromiso.
* Download debian.iso file to a folder and extract to the same folder the vmlinuz and initrd.gz files.
* Add the correct entry to the existing grub menu.
Example: LinuxA grub on sdb1 (hdb1), LinuxB on sdb6 (hdb6)
* Make a directory/folder in sdb6 called Debian-Lenny.
* Download debain.iso ( from http://cdimage.debian.org/debian-cd/5.0.0/i386/iso-dvd/ ) and the available vmlinuz and initrd.gz files to /mnt/sdb6/Debian-Lenny
* Customize the boot/grub/menu.lst of LinuxA on sdb1 (hdb1). Add this entry to the end.
title Debian-Lenny GNU/Linux
kernel (hd1,5)/Debian-Lenny/vmlinuz vga=791 fromhd=/dev/sdb6 fromiso=/Debian-Lenny/debian.iso en xres=1024x768
initrd (hd1,5)/Debian-Lenny/initrd.gz
boot
Note:
You can get the vmlinuz (kernel binary) and initrd.gz (ramdisk image) files from here:
http://http.us.debian.org/debian/dists/lenny/main/installer-i386/current/images/hd-media/gtk/
http://ftp.de.debian.org/debian/dists/lenny/main/installer-i386/current/images/hd-media/gtk/
Note: Typically, FTP is faster, and therefore the preferred method. There is no difference in the quality or content of the HTTP download compared to the FTP option.
To extract the vmlinuz and initrd.gz files from the debian.iso
1. mkdir -p /mnt/sdb6/Debian-Lenny/test
2. mount -t iso9660 -o loop,ro /mnt/sdb6/Debian-Lenny/debian.iso /mnt/sdb6/Debian-Lenny/test
Now copy the vmlinuz and initrd.gz files from the mounted iso image to the directory
1. cp /mnt/sdb6/Debian-Lenny/test/boot/vmlinuz /mnt/sdb6/Debian-Lenny/
2. cp /mnt/sdb6/Debian/test/boot/initrd.gz /mnt/sdb6/Debian-Lenny/
Note: Please do not change download ISO file. In some cases it doesn't work.