View Full Version : Tripleboot Knoppix+UBCD4Win+UBCD from USB flashdrive

09-08-2008, 11:50 PM
MOAT - Mother Of All Thumbdrives
From a single USB flash drive (UFD) / thumbdrive, boot:
- UBCD4Win v3.20 (http://ubcd4win.com/)
- UBCD v4.11 (http://www.ultimatebootcd.com/)
- Knoppix v5.1.1 (http://knopper.net/knoppix/index-en.html)

Need fast thumbdrive, have tested with 2G OCZ Rally2 (need to remove some big modules from UBCD4Win) & 4G OCZ Rally2.
Start with UBCD4Win

Install & do updates as you would for building a CD.
i. Optionally - update spybot (http://www.safer-networking.org) from 1.5.2 by copying all files from the program directory of a working, installed copy to C:\UBCD4Win\plugin\AntiSpyware\Spybot\. You can edit the .inf file to reflect new version instead of 1.5.2.
Build - no ISO output necessary.
Replace all instances (it may not be necessary to replace every instance; I didn't test) of ntdetect.com, setupldr.bin, and ramdisk.sy_ / ramdisk.sys in the C:\UBCD4Win\ tree with the equivalent files from Windows Server 2003 SP1 or SP2 (or greater?)
I've heard SP1 files should work, I only tested with SP2.
W2K3SP1 or 2 files are older than the XPSP3 files, but they can handle USB booting.
Download from http://www.microsoft.com, and run <NameOfSPFile> -x to extract the entire service pack to a directory, then pick out the files you need.

The following is adapted from http://ubcd4win.com/forum/index.php?showtopic=9630, with corrections/notes made.
i. As admin, run PEtoUSB (http://gocoding.com/projects/petousb/4CO22/PeToUSB_3.0.0.7.zip). I've only tested using "Enable Disk Format" / "Quick format"; it may work some other way.
ii. This will get you to a booting system on the flash drive, but it boots the NT way, not the syslinux way (i.e. no menu to choose UBCD4Win/UBCD/Knoppix).
iii. Run syslinux.exe -s -d /syslinux X:, where X: is your flash drive. I used v3.71, later is probably OK/better. Download from http://www.kernel.org/pub/linux/utils/boot/syslinux/.
iv. Don't bother with downloading the "boot menu" files he lists. (But see note below***)
v. Copy cat.c32, chain.c32, menu.c32, reboot.c32, and vesamenu.c32 from the syslinux you downloaded to the thumdrive's /syslinux/. (The .c32 files are small utility programs that run when called from by syslinux)
Try booting the windows environment. If you get a BSOD, verify that all instances of ntdetect.com, setupldr.bin, and ramdrive.sy_ / ramdrive.sys on the thumbdrive are from the W2K3 service pack.
Use the CD or extract the files from the .ISO.
Copy all of the directories from the root of the CD / .ISO to the thumbdrive, except /isolinux/ and /syslinux/. /images/ will overlap with your existing /images/ directory, and that's fine. The filenames don't conflict, just the directory name.
Make backup copy of thumbdrive's /syslinux/syslinux.cfg. Edit /syslinux/syslinux.cfg
i. Add the following stanza:

MENU LABEL Launch "The Ultimate Boot CD (DOS)"
KERNEL menu.c32
APPEND /menus/main.cfg

ii. Optionally, for better compatibility, change DEFAULT vesamenu.c32 (graphic menu) to DEFAULT menu.c32 (text menu) and remove the line MENU BACKGROUND LOGO.PNG.
iii. Optionally customize MENU TABMSG & MENU TITLE.
iv. Optionally remove TIMEOUT 200.
Make a backup copy of the thumdrive's /menus/main.cfg. Edit /menus/main.cfg to include this stanza:

LABEL back
MENU LABEL Back to main menu
KERNEL menu.c32
APPEND /syslinux/syslinux.cfg

Add Knoppix

Copy the \KNOPPIX\ directory from the Knoppix CD to the root of the USB drive.
Copy the \boot\isolinux\ directory from the CD / .ISO to \KNOPPIX\isolinux\ on the thumbdrive. (This invalidates every entry in the knoppix menu, but that's easy to fix w/a global search & replace)
Edit the thumbdrive's /syslinux/syslinux.cfg to include the following stanza:

LABEL knoppix
MENU LABEL Launch Knoppix
KERNEL menu.c32
APPEND /KNOPPIX/isolinux/knoppix.cfg

Copy the thumbdrive's /KNOPPIX/isolinux/isolinux.cfg to /KNOPPIX/isolinux/knoppix.cfg
Edit /KNOPPIX/isolinux/knoppix.cfg
i. Global search for KERNEL linux & replace with KERNEL /KNOPPIX/isolinux/linux
ii. Global search for initrd=minirt.gz & replace with initrd=/KNOPPIX/isolinux/minirt.gz
iii. Insert the following stanza at the top of the stanza list

LABEL back
MENU LABEL Back to main menu
KERNEL menu.c32
APPEND /syslinux/syslinux.cfg

iv.Optionally delete the TIMEOUT 300 line.
v.Optionally customize MENU TABMSG & MENU TITLE.
vi.Optionally make at least some cheat codes available. (Probably better to add your favorite cheat codes as a new stanza)
Add the following stanza

LABEL cheat
MENU LABEL Cheatcodes (See note below)
KERNEL cat.c32
APPEND /KNOPPIX/mycheats.txt
This *EXITS* the menu system. Type 'menu.c32 syslinux.cfg' to return.

Copy the thumbdrive's /KNOPPIX/knoppix-cheatcodes.txt to /KNOPPIX/mycheats.txt, and edit /KNOPPIX/mycheats.txt so it's no more than 24 (prettier) or 25 (more info) lines.


From the UBCD4Win menu, "Memtest86" and "NTFS for DOS" don't work, but that's OK because UBCD (DOS) supplies them - either ignore those options, delete the stanzas, or edit the stanzas to point to the UBCD equivalent.
***The "Windows(tm) Recovery Console" doesn't work either, maybe that is fixed by the bootfiles from http://ubcd4win.com/forum/index.php?showtopic=9630? I'll let somebody else test that.

For those who care, UBCD4Win goes first because USB-booting Windows is flaky (if I hadn't found PEtoUSB I don't think I'd have ever got it). Once that's running, it's pretty easy to add non-Windows syslinux/isolinux apps.

There's a lot of work left to "pretty-fy" the menu system; maybe the next person can upload some of that work here. Here's my mycheats.txt: (those superscript "3"s are ascii vertical lines)

knoppix dma -- DMA access for all IDE ³ knoppix toram - CD->RAM & run from RAM
knoppix wheelmouse - - - - Use IMPS/2 ³ knoppix nowheelmouse -- Use plain PS/2
knoppix vga=normal - X, no framebuffer ³ knoppix 2 -- Runlevel 2, Textmode only
knoppix acpi=off -- Fully Disable ACPI ³ knoppix acpi=force - - FORCE ACPI Bios
knoppix pci=bios Workaround for bad PCI controllers
knoppix ide2=0x180 nopcmcia - - - - - Boot from PCMCIA-CD-Rom (some notebooks)
knoppix pci=irqmask=0x0e98 -- Try if PS/2 mouse doesn't work on a (esp. laptop)
knoppix mem=nnnM - - (ucase M) Maybe fix "Panic: cannot mount root file system"
knoppix no{apic,agp,apm,audio,ddc,dhcp,fstab,firewire,pcmc ia,scsi,swap,udev}
knoppix no{usb,usb2} Kill USB entirely, or just 2.x extension
knoppix noideraid - - - - - - - - - - - - - - - Disable IDE-Raiddisk detection
knoppix pnpbios=off No PnP Bios initialization
knoppix xmodule=ati|fbdev|i810|mga|nv|radeon|savage|s3|rad eon|svga|i810
knoppix desktop=fluxbox|gnome|icewm|lg3d|larswm|openbox|tw m|wmaker|xfce|xfce4
knoppix floppyconfig Run "knoppix.sh" from a floppy
knoppix myconf=/dev/sda1 - - - - - - - - - - Run "knoppix.sh" from a partition
knoppix myconf=scan (or config=scan) Try to find "knoppix.sh" automatically
knoppix home=/mnt/sda1/knoppix.img - - - - Mount loopback file as /home/knoppix
knoppix home=scan Automatic search for knoppix homedir
knoppix bootfrom=/dev/hda1/KNX.iso - - - - - Access image, boot from ISO-Image.
knoppix bootfrom=/dev/hda1 -- Access Image then boot from previously copied ISO
(enables booting from NTFS / ReiserFS)

Dan Stieneke