I had this same problem. Here is a patch for BT4's 'bootloader', casper. This solution is a little long winded.
The only alternative seems to be to extract the CD to the root of your NTFS drive, which sucks.
Booting BackTrack 4 Final Release ISO from an NTFS partition with GRUB4DOS.
-----------------
Booting from the BackTrack 4 ISO from NTFS is tricky. GRUB4DOS can be used to provide ISO mapping or emulation, but BT4's casper bootloader gets stuck during booting if you do this.
(For me I could get GRUB4DOS to boot the kernel+rd, but when it went to mount the root filesystem it printed out "NTFS volume version 3.1" endlessly whilst searching all my disks for the ISO).
This method uses the casper bootloader scripts to mount the ISO file directly from its physical location on the partition.
The casper scripts in BT4 are missing some options and have some bugs, so we'll have to patch the initrd image. So you'll end up having the kernel and ramdisk image alongside the ISO file.
Instructions
-------------
Install GRUB4DOS
Put bt4-final.iso in a permanent location.
Ensure the file is contiguous (has no fragments). You can use Mark Russinovich's contig.exe on the file to do this.
Extract boot/vmlinuz and boot/initrd.gz from the ISO.
Apply the casper.patch to initrd.gz.
Put vmlinuz and the new initrd.new.gz somewhere on the NTFS partition (e.g. C:\Share\ISO\BT4\)
Add a new grub4dos menu.lst entry for BT4. Heres mine:
Code:
title BT4
kernel /share/iso/bt4/vmlinuz BOOT=casper boot=casper nopersistent live-media=/dev/sda2 live-media-offset=35450585088 textonly rw
initrd /share/iso/bt4/initrd.gz
where:
live-media is the NTFS partition containing your ISO file (could be a /dev/hd* either) Note this the partition device (e.g. /dev/sda2), not the whole drive (/dev/sda).
live-media-offset is the offset in bytes from the start of the partition to the first byte of the ISO file. I used WinHex to find this (Open partition, find ISO file, Right-click first byte, "Add Bookmark", offset is shown).
The ISO should now boot.
You'll have to take a look at its own grub menu.lst to change bootup options. If you want to just have one ISO file, you can rebuild it with the new initrd.gz in place of the old one.
casper.patch:
Code:
--- casper.old 2010-05-14 18:55:45.887493444 +0100
+++ casper 2010-05-14 19:03:51.517929507 +0100
@@ -36,6 +36,10 @@
export PERSISTENT="" ;;
union=*)
export UNIONFS="${x#union=}";;
+ live-media=*)
+ export LIVEMEDIA=${x#live-media=} ;;
+ live-media-offset=*)
+ export LIVEMEDIA_OFFSET="${x#live-media-offset=}";;
ip*)
STATICIP=${x#ip=}
if [ "${STATICIP}" = "" ]; then
@@ -544,7 +548,24 @@
set_usplash_timeout
- if [ ! -z "${NETBOOT}" ]; then
+ if [ -n "${LIVEMEDIA}" ] && [ -n "${LIVEMEDIA_OFFSET}" ]; then
+ # Regular casper code should work when using LIVEMEDIA_OFFSET, but is
+ # broken in mount_images_in_directory() due to a bug in
+ # busybox's 'losetup -f' which always return '/dev/loop0' even when
+ # /dev/loop0 is in use. Do things by hand here instead.
+ i=0
+ while [ ! -b "${LIVEMEDIA}" ] && [ "$i" -lt 20 ]; do
+ sleep 1 # Wait on udev for devices to appear
+ i="$(($i + 1))"
+ done
+ losetup -o "${LIVEMEDIA_OFFSET}" /dev/loop1 "${LIVEMEDIA}"
+ mount -t iso9660 /dev/loop1 "${mountpoint}"
+ if is_casper_path $mountpoint; then
+ livefs_root="${mountpoint}"
+ else
+ panic "Unable to find a live file system on iso9660 image at ${LIVEMEDIA}:${LIVEMEDIA_OFFSET}"
+ fi
+ elif [ ! -z "${NETBOOT}" ]; then
if do_netmount ; then
livefs_root="${mountpoint}"
else
apply_patch.sh:
Code:
#!/bin/sh
# Ensure casper.patch and original BT4 initrd.gz are in this directory
mkdir initrd
cd initrd
gzip -dc ../initrd.gz | cpio -id
cd scripts
patch -p0 < ../../casper.patch
cd ..
find ./ | cpio -H newc -o > ../initrd.new
cd ..
gzip -f initrd.new