john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

Grub boot an img image file

grub-boot-an-img-image-file

.img was used for Floppy Diskimages but has expanded to USB stick and really just a wrapper for a bunch of bootable files format...

What you need:

A working grub "legacy" installation (hopefully installed into the MBR)

memdisk (I got mine by extracting it from the systemrescuecd iso using uniextractor) Copy the memdisk file from /usr/lib/syslinux to the /boot directory.

Add an entry to /boot/grub/menu.lst that looks like:

title bootable image root (hd0,2) kernel /boot/memdisk initrd /boot/image.img


download the systemrescuecd.iso and somehow put it in your linux formatted partition (e.g. ext2/ext3 windows drivers)

OR use ntfs-3g from your linux partition to access it...

BOOT INTO LINUX (e.g. tinycore! =)

-create a mountpoint to mount the ISO with loopback: mkdir /mnt/livecd

-mount the image: mount -t iso9660 -o loop,ro /hda3/filename.iso /mnt/livecd

-create a directory on the device where you are going to boot from: mkdir /mnt/hda3/sysrcd

-copy the contents of the mounted image to that directory: cp -a /mnt/livecd/* /mnt/hda3/sysrcd

-copy kernel and initrd files to yor boot device:

Move sysrcd.dat, sysrcd.md5, initram.igz, rescuecd, rescue64, altker32, altker64 from /mnt/hda3/sysrcd/isolinux to /mnt/hda3/sysrcd

kernel: rescuecd initrd: initram.igz data: sysrcd.dat checksum: sysrcd.md5

/boot/grub/menu.lst

title SystemRescueCD from hard disk root (hd0,2) kernel /sysrcd/rescuecd subdir=sysrcd setkmap=uk initrd /sysrcd/initram.igz boot

Wow, that was easy (just note that hd0,2 aka hda3 will be locked and can't be updated by GPARTED)...


download the puppy-linux.iso

Note: using a similar system we can put puppy linux on our Windows machine First, again make a small partition (e.g. 300 MB) of type ext2/ext3

IN LINUX access a windows ntfs partition (where we saved the iso?) by mounting as file type "ntfs-3g driver" the first partition of drive "sda" which will be accessible using the /mnt/windows directory

mount -t ntfs-3g /dev/sda1 /mnt/windows

Mounting the iso image is easy with the "loop" parameter - all the files are accessible in the /mnt/custom directory!

mount -o loop /path-to-iso/cd-image-name.iso /mnt/custom

ls /mnt/custom

cp /mnt/custom/vmlinuz /mnt/sda3 cp /mnt/custom/initrd.gz /mnt/sda3


IN WINDOWS... use IsoBuster or UniExtractor to get the files out Use Ext2FSD or something like it to create a /boot/puppy directory copy over the initrd.gz and vmlinuz files to the /boot/puppy folder copy over the pup-431.sfs file to the root directory (can be elsewhere?)


update your grub menu.lst with

title puppylinux root (hd0,2) kernel /boot/puppy/vmlinuz initrd /boot/puppy/initrd.gz

REBOOT AND ENJOY PUPPY LINUX (unless like me you have an unrecognized linksys pci wireless card and have to use b43-fwcutter to load the firmware...)

-----------------------------------------------------------------------------

Apparently rehook is sometimes included in Grub (legacy), sometimes it isn't...

title dsl map(hd0,2)/boot/dsl.iso (hd32) map --rehook chainloader (hd32) rootnoverify (hd32) boot

grub> map (hd1,1)PATHtoISO.iso (hd4) grub> map --rehook grub> chainloader (hd4)+1 grub> rootnoverify (hd4) grub> boot

menu.lst title KNOPPIX root (hd0,0) kernel /linux26 ramdisk_size=100000 fromhd=/dev/hda4 initrd /minirt26.gz savedefault boot


  • « Menu.lst
  • Install grub boot reinstall grub systemrescue »

Published

Apr 27, 2010

Category

linux

~454 words

Tags

  • boot 11
  • file 92
  • grub 6
  • image 8
  • img 1
  • installs 41