Jump to content











Photo

Most Compatible USB Stick + Grub4Dos Method I have found


  • Please log in to reply
25 replies to this topic

#1 vmbray

vmbray

    Newbie

  • Members
  • 29 posts
  •  
    United States

Posted 23 February 2010 - 03:28 AM

After trying a number of things and even dipping a toe into the fbinst world (and being very confused and having limited success - I could stick out the confused but I often need to make usb sticks for technicians and it is too fiddly during normal work to deal with) I found the imho truly excellent utility RMPrepUSB

http://www.boot-land...?showtopic=9460
http://www.boot-land...?showtopic=7739

which quicly proved to be more compatible with older machines I have than what I had settled on previously which was two sticks - one hp util formatted and one Make_USB_2 formatted, then grldr installed with the grub4dos gui. Ususally one of these sticks was booting for me, although there are a lot of older machines that I deal with that were not working. Some would even load the grub4dos but fail to pull up the menu, and yet work fine with the new method.

The simplicity of the new method is another real attraction. It is a simple format, then copy files and it just works, I have in fact not been able to find a machine in three days of messing around here and there that won't boot it, including some real difficult ones like intel d865glc and hp d220mt. It also seems to skirt the wisdom of using 2gb flash drives (and this is great, since we can also boot portable hard drives with images on them using FAT32 hopefully), and sticking to FAT, and so far using double partition has not been necessary (and I have a machine that does not like double partition so this is good).

So here's the deal, hopefully it will help someone else...

The first major trick is that you will not install grub4dos mbr, you will use ntldr. This inspiration came from reading the Grub4Dos tutorial

http://www.boot-land...?showtopic=5187

(THANKS!!!) and thinking about the fact that the very first boot sticks I made with PE2usb seemed to be more bootable and thinking it might have to do with ntldr. This seems to be the real key to it being most compatible, and I think that it has to do with motherboards specifically looking for a bootable NT/XP install. All I know is that I had done all the other things and had some success, but when going to ntldr it made a world of difference.

1. In RMPrepUSB, tick the third boot option 'xp/winpev1/bartpe bootable (ntldr)', and UN-tick the 'boot as hdd (c: 2ptns) option.

2. Click 'prepare drive'

3. Copy in the base XP boot files (it is important to do this first as they need to be first on the disk - not copying first can lead to rapid beeping and/or failure to boot)

the 'base XP boot files' consist of (from a working xpsp3 (sp2 prob fine too) install):

ntldr mine 245kb / 4/14/2008
ntdetect.com mine 47kb / 4/13/2008

make boot.ini like this (thanks again Grub4Dos tutorial)

[boot loader]
timeout=10
default= C:\grldr
[operating systems]
C:\grldr="Grub4Dos"

copy grldr to the root of the stick (not to c:\grub4dos) (used 3/31/2009 4.4 grldr)

4. Copy in menu.lst for grub4dos
5. Copy in the rest of the files, iso, etc.

I place the menu.lst and the other iso's etc in a folder and just copy them all in, the key is copying the first four files right after formatting the drive. ISO booting most of my OSs makes this very clean, the only thing I copy in plain is the netbootdisk contents because it is so fast for booting up to do a quick ghosting that I still love it. You can copy a working netbootdisk contents right into the root of the boot stick (I'm sure there's a better way but...) and add a menu.lst entry like:

title Netboot via IO.SYS - the good old dos
fallback 3
find --set-root /io.sys
chainloader /io.sys
savedefault --wait=2

And boot. So this is very, very easy to set up, and I will be very interested to hear success/failure stories if anyone cares to share, I have been amazed at how it has just worked on every box I've tried. Also seems to help with kicking the mb into usb 2.0 although I'm still feeling that out.

So anyway THANKS a million to everyone contributing here, this forum is truly amazing and has been and is a huge help to me and my company! So where do I donate??? I'll find that next....

#2 Nuno Brito

Nuno Brito

    Platinum Member

  • Team Reboot
  • 10,156 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 23 February 2010 - 04:56 AM

Good resume of your experience, thanks for sharing! :lol:

So where do I donate??? I'll find that next...

Around here you can only donate time and experience.

Just hanging around the forums and helping other folks is what we really need around here.

Keep on the good work! :rolleyes:

#3 vmbray

vmbray

    Newbie

  • Members
  • 29 posts
  •  
    United States

Posted 23 February 2010 - 05:33 AM

Thanks, should have known - the best things are free :lol:

#4 steve6375

steve6375

    Platinum Member

  • Developer
  • 5,190 posts
  • Location:UK
  • Interests:computers (!), programming (masm,vb6,C,vbs), OSes, photography,TV,films,guitars
  •  
    United Kingdom

Posted 02 April 2010 - 10:39 AM

Glad you like RMPrepUSB :) So which override options are you using exactly? none - or 64/32 only, FAT16? What sizes of UFD are you using?

I would be interested to know of the 'difficult' systems which boot configs worked and which did not. You have obviously done a lot of experimenting using the boot.ini/ntldr approach. Could you give an example of where the boot.ini/ntdlr approach worked when the straight grub4dos installed as a bootloader did not? I cannot understand why loading through this indirect way would be any better and I think you may have discovered something very useful about the way some BIOSes read the UFDs so I would like to try to find out why it works better. The first step is to prove that it does by finding a specific system where it will not boot using the grldr bootloader config, but will boot using ntldr and keeping all other variables the same.

Thanks
Steve

#5 Sadeghi85

Sadeghi85

    Newbie

  • Members
  • 15 posts
  •  
    Iran

Posted 23 December 2010 - 01:06 PM

Hello,

This post will shed more light on the issue.

Workaround:

Using a hex editor to replace this:

EB 5E 80 00 20 39 FF FF 00 00 00

With this:

33 C0 80 00 20 39 FF FF 00 EB 55

In grldr.mbr seems to work fine.

#6 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 10,459 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 23 December 2010 - 01:26 PM

Hello,

This post will shed more light on the issue.

.....
In grldr.mbr seems to work fine.

Very nice find. :)

I am quoting the whole post (just in case it may disappear):

Hi

I have an Acer Travelmate and had the known “Unregistered Exception Handler” error at boot time.

Short Explanation:
The laptop starts up bios and when the bios whats to boot from any media(not even your harddisk) the exception is thrown.

Reason:
The Diskcryptor MBR starts with 0xeb(jmp). The original M$ mbr starts with 0x33(xor ax,ax).
Some bioses(like mine) try to detect if a drive has a MBR or if it is a removable drive without MBR.
Very simple here:
Sector0,Position0==0x33 => MBR => normal partitioned harddisk.
Sector0,Position0==0xeb => Boot Sector assumed => emulate a hard disk(this is what makes usb-sticks without mbr bootable as harddisks, and makes my acer crash)

Solution:
For Diskcryptor this is problematic, as the signature is in Sector0,Position 2. So you cannot put 0x33 as first byte. Probably ntldr has a good solution.

Partial solution and how to fix your (and my) laptop:
As you cannot boot from any media when the harddisk contains dc mbr you need to connect the laptop harddisk to a normal pc. Then you need to overwrite the mbr. You can use the bootsect.exe tool or any hex editor(winhex, hiew,…).
then create a small partition(7mb) at start(fat is ok). Create a DC PXE loader and put it to that drive. Get grub4dos bootloader and put it there too.
you can use this menu.lst:

hiddenmenu

default 0

timeout 0

title Booting...

  chainloader --force /dcldr

  boot

Configure dc to boot from the first partition with correct password or from a given partition.

Greetings

Md5Chap


The good news is that yet another mistery has been solved. :ph34r:

The bad ;) news is that there are apparently no limits to the stupidity of BIOS programmers.
Checking the MBR code (as opposed to the MBR data) to detect whether a drive is partitioned or not seems to me like being eligible for the "Most botched programming approach of year 2010" Award :)

:worship:
Wonko

#7 Sadeghi85

Sadeghi85

    Newbie

  • Members
  • 15 posts
  •  
    Iran

Posted 23 December 2010 - 01:55 PM

The bad :) news is that there are apparently no limits to the stupidity of BIOS programmers.
Checking the MBR code (as opposed to the MBR data) to detect whether a drive is partitioned or not seems to me like being eligible for the "Most botched programming approach of year 2010" Award :ph34r:

;)
Wonko


Yeah, this is what ntldr(the author of DiskCryptor) had to say in the code comments:

Posted Image

lol

#8 steve6375

steve6375

    Platinum Member

  • Developer
  • 5,190 posts
  • Location:UK
  • Interests:computers (!), programming (masm,vb6,C,vbs), OSes, photography,TV,films,guitars
  •  
    United Kingdom

Posted 23 December 2010 - 04:45 PM

Nice find! I have modified my version of grubinst.exe as used by RMPrepUSB so that it uses this boot code and also reported it to chenall issues list. I cannot test it on an Acer 'bad' notebook but it seems to boot OK as before on my Dell. :)

#9 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1,047 posts
  •  
    Belgium

Posted 23 December 2010 - 08:21 PM

"Fixed" ( :frusty: ) in git tree of Syslinux too.

#10 steve6375

steve6375

    Platinum Member

  • Developer
  • 5,190 posts
  • Location:UK
  • Interests:computers (!), programming (masm,vb6,C,vbs), OSes, photography,TV,films,guitars
  •  
    United Kingdom

Posted 24 December 2010 - 04:34 PM

I have made the new grubinst.exe version available in the Beta section as RMPrepUSB 2.1.606a. Maybe you no longer need to use NTLDR mechanism now, just straight grub4dos?

#11 steve6375

steve6375

    Platinum Member

  • Developer
  • 5,190 posts
  • Location:UK
  • Interests:computers (!), programming (masm,vb6,C,vbs), OSes, photography,TV,films,guitars
  •  
    United Kingdom

Posted 01 January 2011 - 08:39 PM

WARNING!

The suggested byte patch is not good! The patched code with 33 C0 at the beginning does not work on my Dell Inspiron 530 (flashing cursor). When I looked at the actual code that this patch does, it makes no sense

0000 33C0      XOR AX,AX

0002 802039    AND Byte ptr [BX+SI],39

0005 FFFF      ???? DI  (unknown instruction to x86)

0007 00EB      ADD BL,CH

0009 55        PUSH BP

000A 8e0608D3  MOV ES:[D308]

In the MBR code, the first two bytes should be a jump instruction and bytes 2-7 are used for storage - so this is not a good patch (even though it might appear to work on some systems!) as it runs the storage bytes as code!



	. = _start1 + 0x02

	.byte	0x80	/* bit0=1: disable GRLDR search on floppy */

			/* bit1=1: disable the boot of the previous MBR with

			 *	   invalid partition table */

			/* bit2=1: disable the feature of unconditional

			 *	   entrance to the command-line */

			/* bit7=1: disable the boot of the previous MBR prior

				   to the search for GRLDR */



	/* GRLDR.MBR uses offset 0x03 to indicate a timer counter. */

	/* 0xff indicates waiting forever,

	 * other value specifies the time in seconds to wait */



	. = _start1 + 0x03



	.byte	5

	/* a key press to wait. if AX returned from int16 equals this word,

	 * the desired action will occur. */



	. = _start1 + 0x04

	.word	0x3920		/* the space bar */



	. = _start1 + 0x06

	.byte	0xff	/* preferred boot drive number, 0xff for no-drive(i.e., drive not defined) */

	.byte	0xff	/* preferred partition number, 0xff for whole drive(a floppy that has no partition table) */




I am going to remove this version of grubinst.exe from RMPrepUSB in the next version!

#12 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 10,459 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 02 January 2011 - 10:12 AM

What the HECK of a disassembler did you use (or what input did you give it)? :whistling:

I have very different results:

BEFORE:

00000000: EB80                         jmps        0FFFFFF82  ---X

00000002: 0020                         add         [bx][si],ah

00000004: 39FF                         cmp         di,di

00000006: FF00                         inc         w,[bx][si]

00000008: 0000                         add         [bx][si],al









AFTER:

00000000: 33C0                         xor         ax,ax

00000002: 800020                       add         b,[bx][si],020 ;" "

00000005: 39FF                         cmp         di,di

00000007: FF00                         inc         w,[bx][si]

00000009: EB55                         jmps        000000060  ---X


Your view is for 802039 (and not 80002039) :thumbsup:

:ermm:
Wonko

#13 steve6375

steve6375

    Platinum Member

  • Developer
  • 5,190 posts
  • Location:UK
  • Interests:computers (!), programming (masm,vb6,C,vbs), OSes, photography,TV,films,guitars
  •  
    United Kingdom

Posted 02 January 2011 - 10:18 AM

I must have mistyped it! It is still rubbish code and runs pre-set data as code!
but you mistyped too? EB 5E 80 :thumbsup:


EB 5E 80 00 20 39 FF FF 00 00 00


With this:

33 C0 80 00 20 39 FF FF 00 EB 55



#14 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 10,459 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 02 January 2011 - 11:37 AM

I must have mistyped it! It is still rubbish code and runs pre-set data as code!
but you mistyped too? EB 5E 80 :whistling:

Yep, just checking if you were paying attention. :ermm: ;)


BEFORE:

00000000: EB5E                         jmps        000000060  ---X

00000002: 800020                       add         b,[bx][si],020 ;" "

00000005: 39FF                         cmp         di,di

00000007: FF00                         inc         w,[bx][si]

00000009: 0000                         add         [bx][si],al



AFTER:

00000000: 33C0                         xor         ax,ax

00000002: 800020                       add         b,[bx][si],020 ;" "

00000005: 39FF                         cmp         di,di

00000007: FF00                         inc         w,[bx][si]

00000009: EB55                         jmps        000000060  ---X


What about NOPping anything between 33C0 and EB55?

How would that affect the "special" values grub4dos stores in those bytes? :thumbsup:
00000000: 33C0                         xor         ax,ax

 00000002: 90                           nop

 00000003: 90                           nop

 00000004: 90                           nop

 00000005: 90                           nop

 00000006: 90                           nop

 00000007: 90                           nop

 00000008: 90                           nop

 00000009: EB55                         jmps        000000060  ---X

:)
Wonko

#15 Sadeghi85

Sadeghi85

    Newbie

  • Members
  • 15 posts
  •  
    Iran

Posted 02 January 2011 - 11:41 AM

One can't put jmp immediately after C033h because there are pre-set data there...

The Grub4DOS team could fix it by putting those data bytes a little bit further so the code would look like 33 C0 EB 5C .. .. :thumbsup:

This is just a workaround not the actual fix.

The patched code with 33 C0 at the beginning does not work on my Dell Inspiron 530 (flashing cursor)


You could try:

33 C0 80 00 20 39 FF 01 00 00 00 EB 53



Not a fix! :whistling:

Edited by Sadeghi85, 02 January 2011 - 11:50 AM.


#16 steve6375

steve6375

    Platinum Member

  • Developer
  • 5,190 posts
  • Location:UK
  • Interests:computers (!), programming (masm,vb6,C,vbs), OSes, photography,TV,films,guitars
  •  
    United Kingdom

Posted 02 January 2011 - 03:13 PM

I have changed the source code now. I needed to also change all references to the data storage locations too so there was quite a bit to do and check. I think it is working OK now. The new version is included in RMPrepUSB v2.1.608b beta if anyone wants to test it?
P.S. the -h usage text said that the default timeout delay before booting the old MBR was by default 5 seconds, however the code in v1.1 source sets 0 seconds, so I changed the help text to say the default is 0 seconds. The new version is called v1.2 - changes were made to grlrdstart.S and grubinst.c - the new source files are in Beta section of RMPrepUSB website.

#17 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 10,459 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 02 January 2011 - 03:51 PM

I have changed the source code now. I needed to also change all references to the data storage locations too so there was quite a bit to do and check. I think it is working OK now. The new version is included in RMPrepUSB v2.1.608b beta if anyone wants to test it?
P.S. the -h usage text said that the default timeout delay before booting the old MBR was by default 5 seconds, however the code in v1.1 source sets 0 seconds, so I changed the help text to say the default is 0 seconds. The new version is called v1.2 - changes were made to grlrdstart.S and grubinst.c - the new source files are in Beta section of RMPrepUSB website.


Would it be too much to post just the bunch of modified bytes, just to keep this thread "up to date" and "complete"?

:thumbsup:
Wonko

#18 steve6375

steve6375

    Platinum Member

  • Developer
  • 5,190 posts
  • Location:UK
  • Interests:computers (!), programming (masm,vb6,C,vbs), OSes, photography,TV,films,guitars
  •  
    United Kingdom

Posted 02 January 2011 - 04:12 PM

I changed and re-compiled the source code. There are quite a few changes in many different places. The changes are both in the final MBR and track 0 code sectors and also within grubinst.exe code itself so that parameters like -t=, --preferred-drive, --preferred-partition, etc. modify the correct locations. I have also changed the code to fix the MS-DOS PBR bug. I don't see how a list of modified bytes would help anyone? You can only use the list to patch v1.1 (current version) so why not just use the new version instead? :thumbsup:

#19 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 10,459 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 03 January 2011 - 11:28 AM

I changed and re-compiled the source code. There are quite a few changes in many different places. The changes are both in the final MBR and track 0 code sectors and also within grubinst.exe code itself so that parameters like -t=, --preferred-drive, --preferred-partition, etc. modify the correct locations. I have also changed the code to fix the MS-DOS PBR bug. I don't see how a list of modified bytes would help anyone? You can only use the list to patch v1.1 (current version) so why not just use the new version instead? :unsure:


Just to keep the info in this thread complete. :)

We have right now:
  • a bunch of bytes reported as causing troubles
  • a bunch of bytes that should represent a workaround
  • a report that the posted bunch of bytes do not work on all system with the same bunch of bytes analyzed
  • a presumed to be the solution of all problems NEW bunch of bytes (but without the actual buch of bytes :w00t:)

Is it just me ?
Probably. :cheers:

I would need to:
  • download new version of RMPREPUSB
  • run it on a stick (losing it's contents or needing to saving them before)
  • extract from it the MBR

all to get a bunch of bytes that you already have handy.

In other words, I asked you a favour, which shouldn't cost much time and trouble, you are very welcome to ignore this request, however. :)


BTW and OT, but not much, you are talking about grubinst, and what about bootlace.com? :dubbio:

:cheers:
Wonko

#20 Sadeghi85

Sadeghi85

    Newbie

  • Members
  • 15 posts
  •  
    Iran

Posted 03 January 2011 - 12:03 PM

I read Tinybit's explanation for not fixing this issue, here, and I think it was reasonable, therefore instead of patching grldr mbr I do something else: I use BOOTICE to format with USB-ZIP mode then install grub4dos to PBR and Windows NT 6.x to MBR, then in Utilities tab I edit grldr's internal menu to remove --ignore-floppies. It boots OK as floppy, ZIP drive and HDD and solves the Acer's BIOS issue. It's probably possible to do the same thing using RMPrepUSB but I don't think it can edit grldr's menu?

#21 steve6375

steve6375

    Platinum Member

  • Developer
  • 5,190 posts
  • Location:UK
  • Interests:computers (!), programming (masm,vb6,C,vbs), OSes, photography,TV,films,guitars
  •  
    United Kingdom

Posted 03 January 2011 - 12:49 PM

all to get a bunch of bytes that you already have handy.
In other words, I asked you a favour, which shouldn't cost much time and trouble, you are very welcome to ignore this request, however. :dubbio:

:unsure:
Wonko


Hi Wonko
It is not a simple as a bunch of bytes! The grub4dos code that is installed to the first track has also to be changed, because this code references the bytes at the start of the MBR which are now moved by inserting the xor ax,ax instruction. So there are many bytes changed in many different sectors.
You can simply run grubinst from RMPrepUSB (no need to format - just click on the install grub4dos button) or just run grubinst separately. The new grubinst is also available as a separate download in Beta section of my RMPrepUSB website.
I could print the list of changed bytes (which may involve 100s of bytes which are shifted by a few bytes) but I really don't see how a large list of bytes will help anyone?

#22 entorun

entorun
  • Members
  • 5 posts
  •  
    Turkey

Posted 28 September 2012 - 03:45 PM

I guess and hope that this is the best topic to ask my question although it seems quite outdated:

What is the best (most compatible) way to chainload grldr properly in a UFD to use the capabilities of grub4dos, like ISO booting, OS loading etc.?
My ultimate goal is preparing a UFD which is bootable on most machines and capable of chainloading grub4dos.

I already prepared 2 UFDs (a 4GB A-Data including USBest controller and a 16GB Bigboy including SMI controller) and i can
* load HBCD
* install Vista/Win7/Win8
* load .iso images such as Ubuntu/Linux Mint/BT5/Porteus and install if required (with Grub4Dos ISO booting option)
* install PLOP Bootmanager to a HDD
* ... etc. (all of which are achieved with Grub4Dos!)

... but i'm not sure if they are good enough, i couldn't test them on a wide variety of machines yet! Probably they can be made more compatible / more bootable.

I learned from the forum that changing the UFDs from "Removable Disk" to "Fixed Disk" by altering "The Removable Media Bit" increases the chance of bootability. So i searched and found the appropriate Mass Storage Tools for these UFDs.

Now i can turn them into fixed drives and also use an "Autorun Area" to load an ISO image (i.e. WinXP) by creating a USB-CDROM, via these factory tools.

So i can say that i succeeded to meet the initial requirement for a better bootability: a UFD which is seen as a Fixed USB Drive.

But what about the rest? I have the same concerns mentioned in this topic here:
"USB booting: how to create a UFD that will boot on most machines."
http://reboot.pro/13675/

This discussion is an attempt to understand the different formats that can be applied to UFDs.
Most people concern themselves with booting their UFDs on the machine that they have, but others such as small mom and pop repair shops need a UFD that would boot as many different brands and models as possible.
This is an attempt to help reason through the process of UFD preparation to achieve the best possible compatibility across brands and models.

  • What format should I use on my UFD to achieve maximum bootability?
  • What utility would be the most appropriate to boot most computers?
  • What file system should I use?
  • What boot manager should I use?
  • How do the above compare and how do they differ in methods?
Please share your experience, and provide information that will enable newcomers to make intelligent decisions based on their specific needs.

Thank you.


I also learned that a specialized tool such as RMPREPUSB or FBINST should preferably be used to partition/format the UFD. I generally use RMPREPUSB (and BOOTICE sometimes), thanks to Steve and other contributors.

Let me give the details of the 2 UFDs which I currently use and are reasonably bootable already (tried on 7-8 machines until now):

A-DATA 4GB USBest:
RMPREPUSB Options used: XP/BartPE bootable, FAT32
MBR: Windows NT6.x MBR
PBR: NTLDR boot record

Directory Tree:
\HBCD (includes its own menu.lst which can be loaded by the main menu.lst at the root of the UFD)
\ISOs
\Porteus
ntldr
NTDETECT.com
boot.ini (chainloads grldr)
grldr
menu.lst


BIGBOY 16GB Smi:
RMPREPUSB Options used: SYSLINUX bootable, FAT32,and grub4dos is installed to Mbr
MBR: GRUB4DOS 0.4.5c
PBR: SYSLINUX 4.04

Directory Tree:
\HBCD (includes its own menu.lst which can be loaded by the main menu.lst at the root of the UFD)
\ISOs
\boot (Win7 folder)
\sources (Win7 folder)
\casper
ldlinux
syslinux.cfg (chainloads grldr)
grldr
menu.lst
bootmgr (just to install Win7)


For A-Data I know that the boot routine is like that:
BIOS->MBR->PBR->NTLDR->BOOT.INI->grldr->menu.lst-> My Choice from the list

For Bigboy I guess that the boot routine is like below; but I'm NOT SURE:
BIOS->MBR->grldr->menu.lst-> My Choice from the list
or maybe sometimes like this:
BIOS->MBR->PBR->ldlinux->syslinux.cfg->grldr->menu.lst-> My Choice from the list

I'm quite aware that i don't need to install Syslinux to the PBR of Bigboy, because Grub4Dos is already installed to the MBR and it can directly load grldr. But i'm not sure this will always be the case in some other PC. I believe that i'm increasing the chance of proper booting by installing Syslinux also.

Let me explain the reason of this:
A couple of years ago, when i just wanted to use HBCD from a UFD, i followed the procedure given on the HBCD webpage and booted it succesfully with my own PC as far as i remember. But when i tried it on another PC it didn't boot proper enough to show the HBCD menu. The machine just showed me a blinking cursor or gave some kind of error (grldr is missing?), i can't remember exactly. So i checked the homepage again and used syslinux to boot grub4dos as advised (required files were ready and installed with a batch file). Since syslinux is only loaded to PBR then i guess that the same MBR code passed to the PBR and loaded syslinux, after it failed in direct loading of grldr, but i'm not sure.

What do you think about my situation, please share your opinions:

1) Is A-Data UFD more bootable/compatible than Bigboy, just because MS Windows boot routine is used to chainload G4D?
(Assume that the "Fixed Disk" option is same for both A-Data and Bigboy)

2) Did I really increase the bootability/compatibility of Bigboy by installing Syslinux to PBR, in addition to the G4D installed to the Mbr?

3) LASTLY, what do you recommend to install to the MBR/PBR to increase the chance of proper booting apart from the other variables. Which individuals or combinations should be preferred?

Thanks in advance :good:

#23 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 10,459 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 28 September 2012 - 05:12 PM

What do you think about my situation, please share your opinions:

1) Is A-Data UFD more bootable/compatible than Bigboy, just because MS Windows boot routine is used to chainload G4D?
(Assume that the "Fixed Disk" option is same for both A-Data and Bigboy)

2) Did I really increase the bootability/compatibility of Bigboy by installing Syslinux to PBR, in addition to the G4D installed to the Mbr?

3) LASTLY, what do you recommend to install to the MBR/PBR to increase the chance of proper booting apart from the other variables. Which individuals or combinations should be preferred?

Thanks in advance :good:


My personal take on this issue is this one:
  • Any BIOS programmer with more than 2 neurons (but not exceeding the limit of 10 ;)) will test botability of the USB stack he/she wrote.
  • Even if he/she doesn't the company that actually pays for the code will.
  • Which is the most common MBR code around (substantially the same since NT 4.00)? Yes, the 2K/XP one, or, nowadays more rare, the DOS one.
So, if any testing has been made, it will likely have been done with the 2K/XP MBR code and in my experience it is the "most compatible" one.
Of course, if - for any reason - an Active partition cannot be set, this isn't a valid solution.

An intermediate solution, if you really wish to have the grub4dos installed to your MBR is to install the "standard" MBR to second sector. (but it is not guaranteed to work).

And I can confirm that on some BIOSes the Syslinux PBR is "needed".


:cheers:
Wonko

#24 entorun

entorun
  • Members
  • 5 posts
  •  
    Turkey

Posted 01 October 2012 - 01:07 AM

My personal take on this issue is this one:

  • Any BIOS programmer with more than 2 neurons (but not exceeding the limit of 10 ;)) will test botability of the USB stack he/she wrote.
  • Even if he/she doesn't the company that actually pays for the code will.
  • Which is the most common MBR code around (substantially the same since NT 4.00)? Yes, the 2K/XP one, or, nowadays more rare, the DOS one.
So, if any testing has been made, it will likely have been done with the 2K/XP MBR code and in my experience it is the "most compatible" one.

Of course, if - for any reason - an Active partition cannot be set, this isn't a valid solution.


Yep, i definitely agree with you, ain't sure about the required neuron quantity BIOS programmers must have, though :D

The 2K/XP MBR code is the so-called "Win NT 5.x MBR" , right? But i checked RmprepUsb -which you also advise to use- , and saw that it loads the Win7 MBR code as default, which is "Win NT 6.x MBR" . Next, to see the difference, i loaded both of them separately with Bootice. And saw that they seem to be different when i checked both MBR sectors visually. Of course i unfortunately can't understand the difference in functionality. So;

1) Which MBR code should be preferred if a common (more bootable/compatible) Win NT MBR is decided to be used?
the "Win NT 5.x MBR" code via Bootice (since it's most common), or
the "Win NT 6.x MBR" code via RmPrepUsb?

2) You wrote; "if - for any reason - an Active partition cannot be set, this isn't a valid solution."
Could you please explain in detail? Additionally, is there any possibility that after some time my UFD may become UN-bootable, because the partition changed to IN-active somehow (maybe with a virus/malware) ?

3) (Related with the above 2. question) Although the NT Mbr code has an advantage of compatibility, does it also have the disadvantage of being common? Because the windows boot routine needs the 3 ntldr,ntdetect.com,boot.ini files as well, and these files may be more vulnerable to viruses/malwares compared to the other boot routines ( i.e the syslinux process using ldlinux.sys and syslinux.cfg files)

I have serious concerns, because my UFDs don't have hardware write-protect switches, and it seems impossible to find a UFD with a switch nowadays. :angry:
I know it's off-topic, but i will be grateful if someone advises a solution to make the UFD write-protected. I can use the related Mass Production Tools to make the UFD partitions read-only, but it's not a good solution, as you may justify.


An intermediate solution, if you really wish to have the grub4dos installed to your MBR is to install the "standard" MBR to second sector. (but it is not guaranteed to work).

After i read your above solution, i made some experiments with RmPrepUsb and Bootice. And I surprisingly saw that loading Grub4Dos to MBR seems to backup the previous MBR code to the 2. sector automatically! No need to copy manually if my previous MBR is the "standard" one, right? Is this the solution you recommended?


And I can confirm that on some BIOSes the Syslinux PBR is "needed".

It's good to know that my assumption is true. But it also increases the PBR alternatives :dubbio: .
And another bottleneck, it will be impossible to use Syslinux if i choose the windows boot routine to chainload grldr, since it needs a NTLDR boot record to PBR :confused1:

It became more complicated to me, than i ever could imagine...

Anyway, thanks a lot :thumbsup:

#25 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 10,459 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 01 October 2012 - 09:04 AM

Lot of questions.
To follow the "they MUST have it tested approach", the 2K/XP MBR is the "most tested" one, but the Windows Vista :ph34r: /7 may have now a greater popularity.
I guess that it is a good idea to use the "new" one, but for a different reason, not because the BIOS programmers have necessarily tested it (at least they cannot have done it for anything manufactured before, say, 2006) but because the good MS guys (the good guys of "Embedded") have given to the other guys (of the "normal" MS OS's) some of their code, that has been designed to "better" boot from USB.

About the number of neurons BIOS programmer have, of course I haven't measured them directly, I only assume that from the result of their work. ;)

BTW I lied :w00t:, since a number of motherboards had issues with the actual 2K/XP (yes, it's OK to call it "Win NT 5.x MBR") the good guys from HP (another lie, they must have been the good guys from A-Data or M-Systems, cannot remember, but the so called "HP USB format tool" was NOT created originally by HP) still with a limited number of neurons, introduced a patch to it, see here:
http://reboot.pro/2246/
http://reboot.pro/2246/#entry14607
that has often worked "better".
See also:
http://reboot.pro/3191/

grub4dos grldr.mbr has been designed to store the "previous" MBR on second sector (in the sense that second sector is "empty" and ready to be filled with a MBR) , BUT, depending on the way it is installed it may be actually copied to it and/or prompt for a "hot-key" to boot it or not.
(if it is actually copied, but a hot-key for it is not set, then it is pretty much unuseful during booting)

Some bootmanagers (including grub4dos) exit the "traditional" scheme of booting.
Traditionally the MBR have one (and one only) goal:
  • find among the 4 partition table entries the (ONLY) active one and chainload the bootsector or PBR of that partition.
Grub4dos (but it is not the only one, GRUB legacy and GRUB2, as an example can do the same) grldr.mbr does not "care" at all about an active partition, it simply "scans" the device to find grldr (whcih can even be in a "hidden" partition).
If, once the grldr is loaded, it chainloads a bootsector of a given volume and/or directly a bootloader or - as in the case of Linux - directly a kernel and initrd, there is NO need of any partition marked active in the partition table (unless the specific OS, for any reason, needs one).
So though not common-common, and expecially in the Linux world, there are distro's images that you can dd to a device and use not any active partition.

Both the"Win NT 5.x MBR" and "Win NT 6.x MBR" are instead "traditional" and do "need" a partition marked as active.

About safety, instead of making the partition read only, you could use (not on all USB sticks, only on those that support it) the "simulated" CDROM device, but again there is no guarantee that it will be "universal".

To lessen the risk of viruses "attacking NTLDR, NTDETECT.COM, etc", you can do another thing.
While keeping the NT 5 or 6 MBR, keep also the NT 5 or 6 PBR on the active partition BUT change the name of the invoked loader.
On NT 5 PBR this creates NO problems, as NTLDR=5 chars and grldr=5 chars, on the NT 6 PBR since BOOTMGR=7 char, you need to rename grldr to something like grldrNT (or find a way to modify the bootsector in such a way that a 5 character file is invoked, if I recall correctly this was never finalized/experimented with fully AND some versions of grub4dos may create issues if renamed :unsure:
If you want to experiment, this may be of use:
http://reboot.pro/2362/
This way you can keep your precious NTLDR/NTDETECT.COM/BOOT.INI/BOOTMGR/\boot\BCD in a floppy image (addtiionally and optionally gzipped) that you mount "on the fly" through grldr.
See "how to make a NT boot floppy":
http://www.xxcopy.com/xxcopy33.htm
http://www.multiboot....uk/floppy.html


:cheers:
Wonko




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users