Know your ISP.

User #111491   1565 posts
Whirlpool Enthusiast

edit: I've figured out exactly what to do, and I've got it working flawlessly. Read my post a bit further down for more info. :D

Title might be slightly confusing but I'll explain my situation:

I have BackTrack2 installed on my USB flash drive. My method of installation was just to copy the ISO contents to the stick, and run the syslinux utility from Windows to make it bootable. I've tested this on 3 different computers and it works fine (BIOS supports USB boot etc etc).

My current wish is to be able to boot to this stick, from a bootloader which is situated on the HDD (let's just say the HDD is IDE, but it can be SATA I don't really care). I'd have figured a Linux bootloader would be more adept at something like this than the Windows NT-style loader.

I have searched on this for the last 3 or so days now. What I want to do is different to everything that's shown up in searches, where people are running GRUB on their USB sticks. I want to run GRUB on my HDD and boot to my USB stick. This way I don't need to keep selecting and changing stuff in the BIOS every time I want to boot my USB stick.

In the end I want to be able to chainload Windows' boot.ini to boot GRUB, which can in turn boot my USB stick. But I'll figure that out later.
(btw, it doesn't have to be GRUB. If there's something better for this situation, I'm all ears.)

Thanks heaps guys.

posted 2007-Oct-19, 7pm AEST
edited 2007-Oct-20, 8pm AEST
User #111491   1565 posts
Whirlpool Enthusiast

Done a bit more googling (got about 30 tabs open right now).

Would GRUB4DOS be what I'm looking for to utilise boot.ini to chainload into grub4dos? I've just skimmed over a bit of info about it and it looks promising.

Also, once I've got grub(4dos) going, would the best option be to load an image into RAM which contains USB drivers, and use something like loadlin.exe to continue the booting from my USB stick? It's only a rough idea...

posted 2007-Oct-19, 9pm AEST
User #95489   5384 posts
Whirlpool Forums Addict

Have you tried using boot.ini to boot backtrack2 from the USB key directly? ie no grub?

posted 2007-Oct-20, 10am AEST
User #111491   1565 posts
Whirlpool Enthusiast

What kind of entry would I use? ARC path or boot sector? (I am under the impression that ARC path entries are only for WinNT-based OSs though).

I have briefly tested both anyway and neither was successful. This was on a machine that did not support USB booting from the BIOS however, so I'm not sure how much of a difference that would've made. I will test it on a machine that does support it in the near future.

edit:
I've just discovered a floppy bootdisk for Wolvix (SLAX-based distro, just like BackTrack2).
wolvix.org/node/343
wolvix.org/filebrowser/files/bootdisk
It's a modified version of WakePup v1.1c

edit 2:
With some further tweaking I got it working with BackTrack2 on USB!
All that needs to be done by the end user is to create a blank file named LiveCD.sgn on BackTrack2's root drive. That will allow the floppy to identify the drive.
Also, the file \boot\dos\config needs editing, the ramdisk_size=value is default to 4444, which works sometimes but not always (very weird). I recommend setting I higher value, I have mine set to 40000.

Then only the autoexec.bat file on the floppy needs to be edited to reflect the proper files, ie under boot\dos the file 'wolvix' doesn't exist, so it needs to be changed to point to BT.bat, which loads BackTrack2's supported loader, Loadlin. :D

I just tested this with a real floppy drive, a USB stick with BackTrack2 and a laptop that DOES NOT support USB booting in it's BIOS- and it works! Perfectly!

Now all I need to do is get GRUB4DOS working nicely with Windows' boot.ini, then find out the config to make GRUB4DOS load a floppy .img and everything will work smoothly :)

posted 2007-Oct-20, 12pm AEST
edited 2007-Oct-20, 7pm AEST
User #111491   1565 posts
Whirlpool Enthusiast

I've got it all working flawlessly. :D

This method is fantastic, as it does NOT touch the MBR/bootsector of any disks.

First, make the necessary modifications to your BackTrack2 files. If you're using a USB stick, I'm assuming you've used something to make it bootable already (ie syslinux), this additional method is just to aid your computer in booting the stick. If you're using a BT2 CD, you'll need to do these edits in the ISO and burn it again.

The first, most important step here is to make a new, blank file simply called LiveCD.sgn Without this, the boot floppy will NOT be able to identify your USB/CD installation.

This next step assumes you have two directories on the root of your BT2 CD/USB - /boot and /BT. We are concerned with /boot. Navigate to /boot/dos and edit the config file. Specifically, edit ramdisk_size=value from 4444 to 40000. This is just to insure you against random freezes when you load your kernel later on.
That step is not -completely- necessary, I've had BT2 load sometimes when ramdisk_size=4444 and other times it has hung with the same setting.

Next, download GRUB4DOS 0.4.3, extract one file, grldr. Place this in the root of C:\. Make a new text file here too, call it menu.lst and put the following data in it:

color black/cyan yellow/cyan
timeout 30
default 0

# This finds and loads your Windows XP.
title Microsoft Windows XP (hd0,0)
find --set-root /ntldr
chainloader /ntldr
rootnoverify (hd0)

#This boots from a floppy disk image situated on the HDD
title Boot from BackTrack2 Floppy Image
map (hd0,0)/backtrack2-usbfloppy.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)


Add the following line to your boot.ini file:
C:\grldr="GRUB4DOS"

and last and most important of all, you need the modded Wolvix boot floppy (or more specifically, an image of it). I'll outline the modifications here;

Download the original Wolvix Boot Floppy v1.1.0 .img from here:
wolvix.org/node/343
Once downloaded, you'll have to access the files somehow... mount a virtual floppy drive, write the image to a real floppy disk etc etc Do what you like. A good virtual floppy drive for WinXP is here chitchat.at.infoseek.co.jp/vmware/vfd.html. Works great.

Anyway, once you can access the files, open autoexec.bat for editing (make sure you can view hidden and system files). Find where /boot/dos is mentioned, and directly under these lines it should say 'wolvix'. Change 'wolvix' to 'BT.bat' in both instances. Save the file.

Now save an image of this floppy, either with RawWriteWin.exe (for real floppy disks), or the virtual floppy drive program I linked to above has an option to save an image of the virtual floppy inbuilt. Place this newly created image file on the C:\ root also, with the name backtrack2-usbfloppy.img

Insert your USB or CD if you haven't already, and reboot. Have your BIOS set to boot from the HDD, choose 'GRUB4DOS' from the boot.ini menu, then the BackTrack2 option from the grub4dos menu. Hit enter when prompted, the rest of the boot process should load from your USB stick automagically :D :D

Have fun
Myrak

posted 2007-Oct-20, 9pm AEST
edited 2007-Oct-20, 9pm AEST
Hosted by
WebCentral Australia
Big numbers
976,129 threads
17,207,100 posts
2,008,862 whims sent
3,082 wiki topics
235 ISPs listed
8,129 broadband plans
824 modems & routers
40,609 features filled