Jump to content











Photo
- - - - -

Multiboot on USB key


  • Please log in to reply
46 replies to this topic

#1 ktp

ktp

    Silver Member

  • Advanced user
  • 773 posts

Posted 17 February 2007 - 04:39 PM

After many trials during weeks, finally by reading lot of posts from many forums I success to build
a multiboot USB key booting DOS, Linux and BartPE. This was very painful and time-consuming due to lot of information
and different tools available, some tools have bugs at some version (like Syslinux version 3.35!) causing a lot of time waste.

My recommendations:

- the USB key need to be formatted in FAT16/FAT16X (id 0x0e). The best is to use CodeBeetle (Rich Burnham) PeToUSB 3.0 tool.
The HP-USB formatter v2.0.6 could also be used, but with FAT (= FAT16X, id 0x0e).
Do not use the XP formatter.
Do not use NTFS (0x07), or FAT32 (0x0b CHS), FAT32X (LBA).
Edit September 22, 2007: you can try FAT32X though, it could work with your BIOS, and so could save disk space on big USB key
(> 2 GB) due to smalle cluster size.

- Use grub4dos 0.4.2 or later, but do not rename grldr to ntldr since it does NOT work for every cases.
Use plain ntldr/ntdetect.com (to support boot.ini) then add boot.ini with

[boot loader]

timeout=10

default=C:\grldr

[operating systems]

C:\grldr="Grub4Dos"

This allows to load GRUB4DOS.

- Syslinux is not recommended since its interface is not very good (no scrollable screen). Also it requires to change the
boot sector of the USB key, and its component memdisk when loaded by syslinux has problem loading DOS images
(using XMS memory in particular).

- You may want to use also the modified ntdetect.com from Dietmar to avoid blue screen of death code 0x7B.

- From then you can load DOS images using memdisk, Linux-like using kernel/ramdisk (initrd), DOS with chainloader /io.sys,
FreeDOS with chainloader /kernel.sys, IBM DOS with chainloader /ibmbio.com etc...

I have however other questions maybe someone could help.

1- How can I add another BartPE-like to Grub (menu.lst) without using ramdisk method (winnt.sif, ramdisk loading bartpe.iso image) ?
I would like to add for example ERD commander (in \ERDC\ directory), or XP recovery console (in \CMDC\ directory).
On multiboot CD/DVD, bcdw 2.01 patches dynamically e.g. \erdc\setupldr.bin for every instances of \i386, so OK.
But with USB boot, even if I patch \ERDC\setupldr.bin (changing i386\ to ERDC\), this does not work. At boot
it still refers to the \minint directory (I saw it since the message in txtsetup.sif is displayed) and so the same BartPE is loaded.
Do I need to patch \ERDC\txtsetup.sif too? And how?

2- Is winbom.ini needded on USB key for BartPE-like boot?

3- Are bootfont.bin/bootsect.bin needed on USB key for BartPE-like boot?

4- Are files like win51ic.sp2 etc... needed on USB key for BartPE-like boot?

Thanks in advance.

#2 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 17 February 2007 - 07:21 PM

At boot it still refers to the \minint directory (I saw it since the message in txtsetup.sif is displayed) and so the same BartPE is loaded.



See if this helps:
http://www.911cd.net...o...3784&st=249

2- Is winbom.ini needded on USB key for BartPE-like boot?

Try deleting it....

3- Are bootfont.bin/bootsect.bin needed on USB key for BartPE-like boot?

bootfont.bin is only used on some non-English languages
bootsect.bin is a bootsector, if you don't use it (direct SETUPLDR.BIN or IO.SYS chainloading) you can delete it

4- Are files like win51ic.sp2 etc... needed on USB key for BartPE-like boot?

Try deleting them....


jaclaz

#3 ktp

ktp

    Silver Member

  • Advanced user
  • 773 posts

Posted 17 February 2007 - 08:39 PM

Thanks jaclaz, follwing the indicated links I finally manage to boot CMDC (XP recovery console) and ERDC (ERD Commander).
1) For CMDC 2 minint occurrences need to be patched in \CMDC\setupldr.bin, but also \$WIN_NT$.~BT (2 occurrences, patched to CMDC).
Otherwise I got \$WIN_NT$.~BT\biosinfo.inf not found error code 18

2) For ERDC after patching \ERDC\setupldr.bin (3 occurrences) I got :
\ERDC\ntkrnlmp.exe could not be loaded. error code 14
In fact only 2 occurrences are to be patched, the other is the switch /minint on the command line, very important to load minint environment.
No need to patch $WIN_NT$.~BT occurrences.

To patch, just fill the changed string (shorter, so filled with binary zeros at the end). No need to shrink/collapse followed string
as in the original link.


For points 2) 3) and 4) above, I confirm that winbom.ini, bootfont.bin/bootsect.bin, and files like win51ic.sp2 etc...
are not needed on USB key for BartPE-like boot (I delete them all without any problem). Note that PeToUSB format utility
does create the winbom.ini automatically after formatting the key.

Thank you again for your help and your always helpful referenced links.

#4 ktp

ktp

    Silver Member

  • Advanced user
  • 773 posts

Posted 22 September 2007 - 04:01 PM

Sometimes it is better to have grub4dos as MBR. So you can use grubinst.exe (command line)
or grubinst_gui.exe (graphical interface) for this under Win32 environment, which is much easier then using bootlace.com
coming with grub4dos requiring DOS prompt.

Using grub4dos MBR has the advantage that it can load all kinds of boot sector, which is practical
otherwise there is only one boot sector on your key.

grub4dos and grubinst can be found on the project page:
https://sourceforge....ojects/grub4dos

#5 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 22 September 2007 - 04:33 PM

Some small clarifications.

For the reasons explained here:
http://www.boot-land...?...=3013&st=15

Using the grldr.mbr may cause conflicts in some setups.

the grub4dos "Whereto" is here:
http://www.boot-land...?...pic=14&st=1

If one wants to "bypass" loading NTLDR and BOOT.INI, can change the loader name in the bootsector:
http://www.boot-land...?...ic=2362&hl=

There is a newish improved version of grubinst available here:
http://www.disklessa...hp?name=product
(UNTESTED by me)

jaclaz

#6 ktp

ktp

    Silver Member

  • Advanced user
  • 773 posts

Posted 22 September 2007 - 04:57 PM

Thanks jaclaz.
The diskless angel site has a lot of new things for me to experiment! Including grub-0.4.3-2007-08-12.

Edit: from quick browsing of changelogs for both grub4dos 0.4.3 and grubinst 1.1 there are a lot of improvements, new
exe (hmload, grubmenu...), NTFS support, more bug fixes... I definitely have to try this.

#7 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 22 September 2007 - 05:07 PM

Thanks jaclaz.
The diskless angel site has a lot of new things for me to experiment! Including grub-0.4.3-2007-08-12.

Yep, but as said in the "whereto", latest is always here:
http://grub4dos.jot.com/WikiHome

right now grub4dos-0.4.3-2007-08-27.zip

jaclaz

#8 ktp

ktp

    Silver Member

  • Advanced user
  • 773 posts

Posted 22 September 2007 - 06:53 PM

I just tested grub4dos-0.4.3 and grubinst 1.1 : no problem hit so far. Some visible minor improvements (e.g. default timer displayed...).
To test on more machines.

Question : some grub4dos messages at start are displayed too quickly on the screen so that I cannot read them. Then the menu.lst
content is displayed. Is there a way to pause or review back the grub4dos messages ? Some are error or warning messages.

#9 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 22 September 2007 - 07:28 PM

I just tested grub4dos-0.4.3 and grubinst 1.1 : no problem hit so far. Some visible minor improvements (e.g. default timer displayed...).
To test on more machines.


There is NO such thing (yet) as grub4dos-0.4.3, really :loleverybody: , it is not that difficult to read the linked post and refer to the proper version. :w00t:

At the moment there is
grub4dos-0.4.3pre2 - PRERELEASE VERSION
and a number of
grub4dos-0.4.3-YYYY-MM-DD - "Night Builds"

Question : some grub4dos messages at start are displayed too quickly on the screen so that I cannot read them. Then the menu.lst
content is displayed. Is there a way to pause or review back the grub4dos messages ? Some are error or warning messages.

Looky here:
http://www.boot-land...?...c=3086&st=5

jaclaz

#10 ktp

ktp

    Silver Member

  • Advanced user
  • 773 posts

Posted 22 September 2007 - 07:33 PM

OK I found one show-stopper bug with grub-0.4.3-2007-08-27: it can no longer boot DOS image!
I got the message "FAT12 BPB found with 0xEB(jmp) leading the boot sector" or other type of message
"Error 21: The BPB hidden_sectors shoudl not be zero for a hard-disk partition boot sector".
Previously those DOS image (.ima, 1.44MB or 2.88 MB) had no problem booting with grub-0.4.2.

I now return back to the better (in my opinion) grub-0.4.2.

With verbose option, I can see that the same key is seen differently in different BIOS, this could explain why the problem
of booting depending on BIOS.

Laptop L1 BIOS: my key is seen as C/H/S=1024/16/32 (hd0,0) (displayed by grub4dos)
Laptop L2 BIOS: my same key is seen as C/H/S=501/255/63 (hd0,0) (displayed by grub4dos). These data are the
same as pointed out by ptedit32.

On the laptop L2 I had always the problem booting VistaPE on the key, error 0xc000000e reading \boot\bcd.
L2 laptop has 2-year old, L1 has 6-year old.

Any thought?

#11 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 23 September 2007 - 09:20 AM

OK I found one show-stopper bug with grub-0.4.3-2007-08-27: it can no longer boot DOS image!
I got the message "FAT12 BPB found with 0xEB(jmp) leading the boot sector" or other type of message
"Error 21: The BPB hidden_sectors shoudl not be zero for a hard-disk partition boot sector".
Previously those DOS image (.ima, 1.44MB or 2.88 MB) had no problem booting with grub-0.4.2.

can you post the menu.lst entry that you use to boot that image?

These data are the same as pointed out by ptedit32.

Well, of course, any drive mounted under 2K/XP will have a geometry of Nx255x63.


Any thought?


Yes, you are back to square one, i.e. to my original page:
http://home.graffiti...B/USBstick.html

Which idea is to write unconventional values in the MBR to be able to boot on BOTH kind of BIOSes.

This might bear NO relationship whatsoever with your problem with Vista, though.

jaclaz

#12 ktp

ktp

    Silver Member

  • Advanced user
  • 773 posts

Posted 23 September 2007 - 10:17 AM

jaclaz
can you post the menu.lst entry that you use to boot that image?


Here it is (very classic).
title Partition magic 8.05

find --set-root /images/pmagic8.ima

map --mem /images/pmagic8.ima (fd0)

map --hook

chainloader (fd0)+1

The problem is 100% reproducible by just changing to the new grldr (0.4.3 pre2 or any night build).
Even with grub4dos 0.4.3pre2 in MBR, same problem. Reverse back to grldr (version 0.4.2) fixes
immediately the problem (i.e. no error message, and any DOS image boots OK).

#13 ktp

ktp

    Silver Member

  • Advanced user
  • 773 posts

Posted 23 September 2007 - 10:22 AM

Yes, you are back to square one, i.e. to my original page:
http://home.graffiti...B/USBstick.html

Which idea is to write unconventional values in the MBR to be able to boot on BOTH kind of BIOSes.

This might bear NO relationship whatsoever with your problem with Vista, though.

jaclaz


I agree. But how to find those magic values to satisfy both BIOSes? :-). I certainly need your help.
But is it sufficient? Seems bootmgr has problem with one BIOS to load \boot\bcd.
Note: Vista/bootmgr has no problem booting internal hard disk. The problem appears only with one BIOS
and with USB key or external USB HDD.

#14 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 23 September 2007 - 11:27 AM

I'll try to report the misbehaviour of 0.4.3xxxxx to the developers. :loleverybody:

About "magic" numbers:
the basic idea is simple:
If you have a stick that can be read by different BIOSes as:
C/H/S=1024/16/32
or
C/H/S=501/255/63

Which LBA sectors have the SAME CHS address with BOTH geometries?
LBA 1 -> 0/0/1
.....
LBA 31 -> 0/0/31
LBA 32 -> 0/0/32
LBA 33 -> 0/0/33 with Nx255x63 = 0/1/1 with Mx16x32
....

Now you have all the tools, needed to experiment what happens when you put in the MBR entry the partition starting from 0/0/32 and format accordingly the stick.

But as said, this might bear no consequence to the Vista booting problem.

jaclaz

#15 ktp

ktp

    Silver Member

  • Advanced user
  • 773 posts

Posted 23 September 2007 - 01:01 PM

@jaclaz
Wow, it seems very interesting your new suggestion, but please put more details about it.

Now you have all the tools, needed to experiment what happens when you put in the MBR entry the partition starting from 0/0/32 and format accordingly the stick.


For example, does it mean I use HDHacker, save sector 1 (MBR) of the key to a file, then use its content to write to sector 33 ?
Currently I do see that the sector 1 and sector 33 are different. Sector 1 is from grub4dos MBR, sector 2 apparently looks like boot sector with string
like MSWIN4.1, FAT32, the string Boot error and the ending 0xAA55.

#16 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 23 September 2007 - 01:07 PM

title Partition magic 8.05

find --set-root /images/pmagic8.ima

map --mem /images/pmagic8.ima (fd0)

map --hook

chainloader (fd0)+1
rootnoverify (fd0)

The last line must be added with the newer grub4dos versions.

root or rootnoverify will specify the BIOS drive number(in DL register, which will be passed to the boot record). If the image is "floppy"(i.e., no partition table present), and the current root is "hard drive"(a number greater than or equal to 0x80), then the "boot" command will issue the error message (Error 21). So you must specify (fd0) as the current working root device before the BOOT command.

Similarly if the boot image is for harddrive, you must specify "rootnoverify (hd0)" explicitly before the BOOT command.

#17 ktp

ktp

    Silver Member

  • Advanced user
  • 773 posts

Posted 23 September 2007 - 01:38 PM

@tinybit

Wow, thank you. I retested my boot entries with your indicated change and now all works flawlessly.
I think now I like the next grub4dos-0.4.3 a lot!

#18 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 23 September 2007 - 02:06 PM

@tinybit

Wow, thank you. I retested my boot entries with your indicated change and now all works flawlessly.
I think now I like the next grub4dos-0.4.3 a lot!


Good, and thank you for your attention to grub4dos.

#19 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 23 September 2007 - 02:21 PM

@jaclaz
Wow, it seems very interesting your new suggestion, but please put more details about it.
For example, does it mean I use HDHacker, save sector 1 (MBR) of the key to a file, then use its content to write to sector 33 ?
Currently I do see that the sector 1 and sector 33 are different. Sector 1 is from grub4dos MBR, sector 2 apparently looks like boot sector with string
like MSWIN4.1, FAT32, the string Boot error and the ending 0xAA55.


NO, can you for a moment forget about grldr.mbr?

As already said a number of times, grldr.mbr is not "standard", and may cause problems with Vista.

In other words,
DO NOT use grldr.mbr as MBR for booting Vista!

Let's go back to a normal MBR that fits entirely in the first 512 bytes, with following 62 sectors being filled with 00's.

You simply access the stick MBR with PTEDIT32 or Beeblebrox, write the appropriate value to the partition entry, close the app, disconnect the stick, re-connect it, use the FORMAT command to re-format it.

jaclaz

#20 ktp

ktp

    Silver Member

  • Advanced user
  • 773 posts

Posted 23 September 2007 - 04:56 PM

@jaclaz

I tried as you said, but I still have problem booting with Vista on laptop L2.
The problem seems then to be specific to that BIOS and not related to grub4dos MBR.
Otherwise I use grub4dos MBR because it is the only tool than can boot my keys formatted with
FAT32 (except booting Vista on laptop L2 mentioned above).

So I believe I have to wait for maybe a fix/upgrade in the future from MS bootmgr.

Thank you for your help and patience.

#21 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 23 September 2007 - 05:53 PM

Otherwise I use grub4dos MBR because it is the only tool than can boot my keys formatted with FAT32 (except booting Vista on laptop L2 mentioned above).


Yep, but there must be a reason WHY you cannot boot FAT32 without the grldr.mbr.

Since grldr.mbr works, and the data in partition entries are the same as another MBR code, the problem needs to be in a later stage, most probably the culprit is the bootsector.

By using grldr.mbr, and directly chainloading a loader in menu.lst, you are effectively bypassing the bootsector.

In other words, what happens if instead of
chainloader /ntldr

(or setupldr.bin, or vsldr, or whatever loader you use)
you try
chainloader (hd0,0) +1
(or whatever is your stick named in grub)

If the problem is in the bootsector, this way you should have exactly the same behaviours with grldr.mbr as the ones you have with other MBR code.

:loleverybody:

What came out of fat32format+bootsect /nt52 or /nt60 you were testing here:
http://www.boot-land...?...ic=2959&hl=

jaclaz

#22 ktp

ktp

    Silver Member

  • Advanced user
  • 773 posts

Posted 23 September 2007 - 06:40 PM

@jaclaz
With grub4dos-0.4.3, the command

chainloader (hd0,0) + 1

gives me the error:
Error 1: Filename must be either an absolute pathname or blocklist.

Syntax error in the command you suggested?


for the other question, fat32format+bootsect /nt52 (/nt60) did not do anything since I use grub4dos MBR, bypassing the boot sector.

#23 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 25 September 2007 - 03:22 AM

chainloader (hd0,0) + 1

Syntax error by mistake. There should not be any spaces around the plus sign. Try this:

chainloader	 (hd0,0)+1


#24 ktp

ktp

    Silver Member

  • Advanced user
  • 773 posts

Posted 25 September 2007 - 04:57 PM

@jaclaz
chainloader	 (hd0,0)+1

I confirm that with the above command, the result is the same. I got "disk error, press any to restart".
HDHacker shows that the boot sector is correct (ntldr-type).
This is why I have to (and very pleased to) use grub4dos to invoke bootsector.

I suspect (as you once suggested) a bug in localized version of XP format.
Since any fresh USB key or USB HDD formatted with XP format will not be bootable (got above message),
although ntdlr, ntdetect.com, boot.ini are present.

#25 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 25 September 2007 - 06:04 PM

This is why I have to (and very pleased to) use grub4dos to invoke bootsector.

NO, what you are actually doing is the opposite, this:
chainloader /ntldr
directly chainloads a loader and it works by-passing the bootsector.

This:
chainloader (hd0,0)+1
chainloads the bootsector, and it is NOT working for you because, evidently, your bootsector is somehow invalid.

The tricky part is understanding why this bootsector is incorrect.

I don't think that it could be due to a localized version of XP, otherwise we would have an enormous number of Frenchmen.

I guess we must re-start from the beginning.
I.e., though I understand it could be tiresome, you need to 00 out, say, first 100 sectors of the stick and then re-apply the way you use to format it, posting EXACTLY each step.
Maybe this way someone could spot where the error is (either in the procedure or in one of the tools used).
I am stressing the word EXACTLY because even a very minor thing could be the culprit.

However, in the meantime, please do post in a .zip file the MBR and bootsector of the stick, I'll see if I can find anything.

jaclaz




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users