Jump to content











Photo
* * * * - 1 votes

Create universal flash boot disk with fbinst


  • Please log in to reply
107 replies to this topic

#1 Bean123

Bean123

    Member

  • Members
  • 30 posts

Posted 07 May 2009 - 08:18 AM

Hi,

Latest fbinst can be downloaded from gna:

http://download.gna.org/grubutil/

The tricky thing about flash boot disk is compatibility. There are three modes, HDD, ZIP and FDD, and different bios uses different disk parameter. Some bios support lba mode to access flash disk, some don't. Some of them even skips a certain number of sectors at the beginning of disk. It's difficult to create a flash disk that would work in all these circumstance.

This is what fbinst is for. I've come up with a special disk layout that works arond the various compatibility issue. Here are the steps to create an universal flash boot disk in Windows XP:

1. Insert the usb drive
fbinst would scratch the drive later, make sure to backup useful files.

2. List disk devices in system

Enter the following command in command prompt:

fbinst --list

The result may look something like this:
(hd0): 488392065 (233g)
(hd1): 3919860 (2g)

In this example, (hd1) is the flash disk

3. Format the usb drive

fbinst (hd1) format --force

WARNING: this step would destroy existing data in usb drive.

This would create the necessary disk layout, and add a single fat data partition. Remember to replace (hd1) with the actual device detected in step 2.

You can use the following options with format command:

--force
Without the --force option, fbinst only initializes the structure in mbr, leaving the data partition intact. However, this requires that the data partition is located at sector 0x3f00. Recommend to use --force once to create the necessary layout, then use format without --force when reinitialize is required.

--fat16
Format data partition as FAT16

--fat32
Format data partition as FAT32

--base NUM

Set base sector. In 1.2, the default value (63) works nicely, tt's not recommended to use other value.

--align
Optimize data storage in fat partition.

--size NUM
Set the size of fat partition, for example:

fbinst --size 500m (hd1) format

Without --size option, it uses all availble space in the flash disk.

--zip

Format flash as USB-ZIP. Please note that this option merely set some field in mbr to influence bios, however, different bios uses different algorithm to determine ZIP/HDD mode, so there is no guarantee which mode is detected by a certain bios.

I believe ZIP mode is more generic than HDD. Some bios can't boot from flash disk created with HDD mode. However, ZIP disk would be (fd0) at boot time, and the data partition is (fd0,0), some application can't handle this properly. To solve this, you can use grub4dos's map command to map (fd0) to (hd0).

Some bios use the MSWIN4.1 and FAT16 signature in the first data partition to determine ZIP mode. By reformatting the data partition as NTFS, you can change these two signatures and therefore trick the bios into using HDD mode.

4. Load grldr into mbr

fbinst (hd1) load c:/grldr

This commands store grldr to mbr, which would be loaded automatically on startup.

You can also use ntldr instead of grldr.

5. Other commands

You can use fbinst -h to display command usage.

* fbinst 1.3 update:

Support multiple boot entries and embedding data files in the 8m reserve area, you can also specify the size of reserve area.

To edit boot menu, use the following commands:

text TEXT
Add text item, it can be used to print header or footer information in the boot menu.

menu TEXT CSIP [KEY]
Add menu item, CSIP is the entry point. KEY is the hotkey, default value is the number key 1-9 for the first nine menu items. TEXT can be empty string "", which defines a hidden item. It's not showed in screen, but you can still boot in with the right hotkey.

load FILE ADDR
Add load item, load the content of FILE in memory address ADDR.The boot item must follow a menu item, and there can be more than one of them.

file FILE NAME
Add file item. It's used to add embedded file to the reserved area. The files can be access in grub4dos via the (ud) device.

clear
Clear all items.

For example, here is a steps to create a boot menu:
fbinst (hd1) text "Please select menu"
fbinst (hd1) menu "F1. grub4dos" 2000:0 F1
fbinst (hd1) load c:/grldr 0x20000
fbinst (hd1) menu "F2. grub2" 2000:0 F2
fbinst (hd1) load c:/g2ldr 0x20000
fbinst (hd1) text "---------"
fbinst (hd1) menu "F3. ntldr" 2000:0 F3
fbinst (hd1) load c:/ntldr 0x20000
fbinst (hd1) menu "" 2000:0 F4
fbinst (hd1) load c:/grldr_old 0x20000
fbinst (hd1) file c:/aa.img aa.img
fbinst (hd1) file c:/bb.img bb.img

There are two options that can be configured using config command:

default
The default menu item. The index starts with 0.

timeout
Timeout. If timeout is 0, it doesn't show the menu and boot default item directly. However, even with timeout=0, you can still force the menu to show by pressing ESC key at startup.

Here is the config samples:
fbinst (hd1) config --default 0
fbinst (hd1) config --timeout 5

fbinst 1.3 also allows you to customize the size of reserved area. The minimum size is 0x3f00, but you can set it higher. For example:

fbinst (hd1) format --reserve 10m --force

Without --force, format would try to create the necessary disk layout without scratching the partition table. But it requires that there is at least 0x3f00 sectors (about 8m) before the first partition. If reserved space is not enough, it just print an error message and quit. In this case, you don't need to use --reserve, as it would allocate all space before the first partition to reserve area by default.

And now there are two area for embedded data, one is sector 0-0x3f00, another is 0x3f00 to the end of reserved area. By default, it will fill the first area, when it's full, the file pointer is moved to the second area automatically, but you can also make the file pointer jump to second area with this:

fbinst (hd1) config --extended-data

One advantage of the second area is that it uses direct copy without inserting additional information, so you can use "map" instead of "map --mem" in grub4dos.

* grub4dos update
This version of grub4dos understands fb structure, it get disk geometry from fb instead of detect it again.

It also support virtual device (ud), which can be used to access the files embedded in reserved area using the file command in fbinst.

* grub4dos update
now support direct map on files in the extended area, find command can find files in (ud) device.

* fbinst 1.3 final
New command "restore", used to restore fb mbr scratched accidentally.

fbinst (hd1) restore

New command "export"
Export files

fbinst (hd1) export "aa.img" c:/aa.img

Download:
http://download.gna.org/grubutil/

Corresponding grub4dos:
http://nufans.net/gr...-2009-05-23.zip

#2 maanu

maanu

    Gold Member

  • Advanced user
  • 1,125 posts
  •  
    Pakistan

Posted 07 May 2009 - 09:03 AM

so what i could understand is , it is some sort of triple boot thing ? i mean thats the only way AFAIK by which u can make ur usb more compatible ,No ?

on how many systems u have checked it ? and how would a noob like me ll know that how many sectors it missed when it boots ( in ur case 193)

#3 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7,100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 07 May 2009 - 09:19 AM

so what i could understand is , it is some sort of triple boot thing ? i mean thats the only way AFAIK by which u can make ur usb more compatible ,No ?

See here:
http://www.boot-land...?showtopic=7507
http://www.boot-land...?...=5766&st=77

on how many systems u have checked it ?

That's reserved info, sorry. All it can be revealed is more than 1, less than 100. :D

and how would a noob like me ll know that how many sectors it missed when it boots ( in ur case 193)

by taking a leap forward, reading, trying to understand and learn and thus ceasing being a n00b? :D

;)

;)


jaclaz

#4 maanu

maanu

    Gold Member

  • Advanced user
  • 1,125 posts
  •  
    Pakistan

Posted 07 May 2009 - 09:28 AM

i understand u like to respond with " links " not words :D nvm

now , what i wanted to ask basically was , he said " universal " then how would a usb formatted with having 193 sectors in mind on that peticular bios will work UNIVERSALLY ?

and how is it differentiate with triple boot that tinybit suggested ? (although i already know about his post there "


and can i take ur recent defend as " universally bootable usb " is somehow possible now ? ;)

ps i would love to have reply from the original poster unless u'r using dupe account ;) :D

#5 tinybit

tinybit

    Silver Member

  • Developer
  • 888 posts
  •  
    China

Posted 07 May 2009 - 10:48 AM

@maanu

you does not seem to have tried it.

just try it before you post, please.

It has proved(in the Chinese forum) to be much better on bootability than the usual boot-installers.

Note that it is a work in progress, and bugs may resides.

#6 maanu

maanu

    Gold Member

  • Advanced user
  • 1,125 posts
  •  
    Pakistan

Posted 07 May 2009 - 11:04 AM

@maanu

you does not seem to have tried it.

just try it before you post, please.

It has proved(in the Chinese forum) to be much better in bootability than the usual boot-installers.

Note that it is a work in progress, and bugs may resides.



yes i have not tried it yet (which i ll now ) , but im confused ,i dont understand the difference for as long as i could read between this one and ur recommendations u recently did about use triple MBR if there is error " missing mbr helper " .

also i have been looking around on chinese forums to understand the different techinques . but sadly google translate does not give me full grasp to understand it . but i downloaded some read-to-use pe's just for testing purposes . and they all have one thing common , cab compresses images to boot , and .wim app packages . and grub4dos as boot loader.

can u give the links to some chinese forums where things like this discussed, and is it developed by grub4dos team or not ? what is its home ? (talking about fbinst )

thank u so much tinybit for replying . :D

edit :
it seems this is its home
http://translate.goo...h...ficial&sa=G

and i guess bean developed it...

edit 1 :

can somebody through some light on it (although bit off topic )

http://72.14.203.132...tMsWo3edQi0qSYg

all i can understand ,is .it somehow integrated ntldr and ntdetect.com in one file . i cant find the register button there , can any1 get that file .plz ?

#7 Bean123

Bean123

    Member

  • Members
  • 30 posts

Posted 07 May 2009 - 02:30 PM

@maanu

It's not the same as triple MBR, the disk layout is new, which aims to solve the geometry detection problem, although it also means more space is reserved at the beginning of disk (about 8m).

193 is not the number of sectors per track, it's the number of boot sectors. Some bios skip the first few sectors. I make multiple copies of mbr so that it can boot from either one of them. Using this option won't cause regression on normal system.

#8 maanu

maanu

    Gold Member

  • Advanced user
  • 1,125 posts
  •  
    Pakistan

Posted 07 May 2009 - 06:11 PM

@maanu

It's not the same as triple MBR, the disk layout is new, which aims to solve the geometry detection problem, although it also means more space is reserved at the beginning of disk (about 8m).

193 is not the number of sectors per track, it's the number of boot sectors. Some bios skip the first few sectors. I make multiple copies of mbr so that it can boot from either one of them. Using this option won't cause regression on normal system.


bean so nice of u for replying .

8 mb issue was all over the original chinese topic , i could not understand even with google translate . but now everything is clear .

i ll test it as soon as my friend returns me my usb . hopefully soon .

ps can u plzz get me (us) that integrated ntldr and ntdetect.com file ? it is in the last link i posted ?

there is no way else then someone who is registered can get it.. :D

#9 Bean123

Bean123

    Member

  • Members
  • 30 posts

Posted 07 May 2009 - 07:06 PM

bean so nice of u for replying .

8 mb issue was all over the original chinese topic , i could not understand even with google translate . but now everything is clear .

i ll test it as soon as my friend returns me my usb . hopefully soon .

ps can u plzz get me (us) that integrated ntldr and ntdetect.com file ? it is in the last link i posted ?

there is no way else then someone who is registered can get it.. :D


here it is.

Attached Files



#10 maanu

maanu

    Gold Member

  • Advanced user
  • 1,125 posts
  •  
    Pakistan

Posted 07 May 2009 - 07:14 PM

thank u so very much bean ,. much appreciated .

i ll disturb u again if i ll need any thing from there :D :D

#11 maanu

maanu

    Gold Member

  • Advanced user
  • 1,125 posts
  •  
    Pakistan

Posted 07 May 2009 - 09:17 PM

--base NUM
Set base boot sector. It's used to work with bios that skips sectors. The ones I encounter skips 193 sectors, so you can run the command like this:


193 is not the number of sectors per track, it's the number of boot sectors. Some bios skip the first few sectors. I make multiple copies of mbr so that it can boot from either one of them. Using this option won't cause regression on normal system.


i need to understand these 2 statements .

what i could understand so far is(plzz correct me if im wrong) , it is NOT necessery to be used as an option unless u know that ur bios skips 193 or whatever boot sectors .
i asked it above that how would i know that bios from computer A skips some sectors and bios from computer B does not and if misses then how many actually ?
i have been reading topic which u posted in chinese forums but could not find the answer for this .

> also isn't there any way that there is some highest limit by which a bios can skip boot sectors and we put the mark until that number ? i mean to make it MORE universally acceptable ? :D

#12 Bean123

Bean123

    Member

  • Members
  • 30 posts

Posted 08 May 2009 - 03:54 AM

i need to understand these 2 statements .

what i could understand so far is(plzz correct me if im wrong) , it is NOT necessery to be used as an option unless u know that ur bios skips 193 or whatever boot sectors .
i asked it above that how would i know that bios from computer A skips some sectors and bios from computer B does not and if misses then how many actually ?
i have been reading topic which u posted in chinese forums but could not find the answer for this .

> also isn't there any way that there is some highest limit by which a bios can skip boot sectors and we put the mark until that number ? i mean to make it MORE universally acceptable ? :D


The number 193 is not random, for all bios tested that skips sectors, the value is always 193. The sector per track is 63, if you add it to 193:

193 + 63 = 256

It appears bios has chosen this number so that cylinder 0, head 1, sector 1 is located at 0x100, for whatever reason.

Perhaps 256 would be a more suitable upper limit, assuming bios use the same method for skipping sectors.

#13 maanu

maanu

    Gold Member

  • Advanced user
  • 1,125 posts
  •  
    Pakistan

Posted 08 May 2009 - 08:53 AM

thanks a lot for ur explanation sir , it is understood now..

i ll test and let u know how it goes..

#14 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7,100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 08 May 2009 - 09:07 AM

The number 193 is not random, for all bios tested that skips sectors, the value is always 193. The sector per track is 63, if you add it to 193:

193 + 63 = 256

It appears bios has chosen this number so that cylinder 0, head 1, sector 1 is located at 0x100, for whatever reason.

Perhaps 256 would be a more suitable upper limit, assuming bios use the same method for skipping sectors.


It's a "strange" value.

IF CHS 0/1/1=LBA 256

It means that head 0 has 255 sectors.

I.e. these BIOS read the device as having a geometry of nxmx255. :D

It looks like a non-standard attempt to increase addressable space beyond the 8Gb CHS barrier.

1024x255x63x512=8,422,686,720

becomes:
1024x255x255x512=34,091,827,200

:D

jaclaz

#15 tinybit

tinybit

    Silver Member

  • Developer
  • 888 posts
  •  
    China

Posted 08 May 2009 - 11:57 AM

@jaclaz

No, it should be something like this:

CHS 0/0/1=LBA 0 as seen by bios =absolute sector number 193 seen by Windows/Linux
CHS 0/1/1=LBA 63 as seen by bios =absolute sector number 256 seen by Windows/Linux

The absolute sectors 0 - 192 might be unaccessible by BIOS.

#16 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7,100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 08 May 2009 - 12:08 PM

The absolute sectors 0 - 192 might be unaccessible by BIOS.


It is very possible. :D

But when windows loads, the device is re-scanned, through the NT driver, completely ignoring the BIOS and it's own mapping, AFAIK.

Then how would these sectors "behave"? :D

jaclaz

#17 maanu

maanu

    Gold Member

  • Advanced user
  • 1,125 posts
  •  
    Pakistan

Posted 08 May 2009 - 08:14 PM

just a test report ;

format using this tool , as fat32 . did not try to skip sectors yet . my pe is loading fine as well as other floppy images .

tomorrow ll try with skip sectors . i have seen that after format (i had not yet loaded grldr ) , it was showing 8 MB reserved /used space . is it by purpose ? i hope so .

Bean , plz guide me here. u mentioned usb-zip ,hdd ,FDD in ur first post . can we further explain it as , that in case computer A supports ONLY hdd mood (like online's Asus motherboard which would not boot unless partitioned which ofcourse show bios that it is booting from hdd*like ufd ) , and computer B only supports usb zip mood .

now if we have a usb prepared with fbinst (lets forget about skipping boot sectors issue) , now our usb ll boot fine from computer A as well as computer B ? as it supports both emulations ?

i guess i ll have to start visiting my friends from tomorrow to test my usb drive on their systems :D .
or may be find a reference in any local company to test usb over their systems..before i found any job . then things ll be different unless they dont have same systems :D

#18 vmbray

vmbray

    Newbie

  • Members
  • 29 posts
  •  
    United States

Posted 08 May 2009 - 08:18 PM

I am working with your cool program now thanks to jaclaz (thanks for pointing this out to me) and have a little feedback from my three test systems:

ECS problem child loves it, boot grub4dos fine.
Intel d865glc loves it too.
Intel d845gerg2 wants to love it, boots grldr, but apparently can't find menu.lst, since it comes up to the generic grub4dos screen in black and white, guessing it can't read the partition once it gets past mbr.

I tried once with the filter driver to format using fbinst leaving a small area and adding another partition the way make_usb_2 does (since d845 likes the make_usb_2 format) and see if it then works.

I'm doing this:
wipe first 400 sectors using dsfi
eject/insert
fbinst --fat16 --base 193 --size 900m (hd2) format
eject/insert
fbinst --base 193 (hd2) load f:\grldr (looks like I don't need to put --base here but it didn't seem to work until I did???)
eject/insert
add another partition using disk mgmt, don't format.

first try I got the same thing, black and white apparently can't see menu.lst. I'll try again, but it seems like the common thread is that the systems that really benefit from the two-partition approach like make_usb_2 don't like this type of format, also the intel d845gerg2 will not boot from the standard hp format while the ECS will.

Thanks again for the new toy!

#19 maanu

maanu

    Gold Member

  • Advanced user
  • 1,125 posts
  •  
    Pakistan

Posted 11 May 2009 - 06:49 PM

i have been visiting the chinese page of it , and there is v 1.2 available . bean can u plz share it here also ? i see u have " format as usb-zip " in new version , ?
here at post # 438

http://64.233.189.13...HrE6XnzNf5W5QSA

there are massive tests going on like , in last pages .,zxu and pt ,

climbing at page # 25 post # 361 saying that , using fbinst's latest version with G4D's latest version ( 07.05.09) solves about 95% usb booting problems (which means more universal i guess) , and he is saying remianing 5% are some strange bioses which are giving problems , and they have 2 users i mentioned above with bioses like that and they are working on it i guess ;

@ vmbray

use the latest grub4dos version from here

http://nufans.net/grub4dos

at post # 441 i think the user had same problem as u , he used latest g4d ,and it did found the menu.lst . may be he used latest fbinst , i dunno .

#20 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1,047 posts
  •  
    Belgium

Posted 14 May 2009 - 03:04 PM

Some bioses don't detect the correct booting drive, they see the internal hard drive and the USB stick, but when you try to boot the USB stick, it thinks that 0x81is the boot drive (USB stick), but in reality it is 0x80.

Syslinux has a MBR that will force drive_number = 0x80 when a Ctrl key is pressed at boot.
http://syslinux.zyto...rch/011912.html
http://syslinux.zyto...rch/011930.html

See more posts of TJ about the issue:
[url="http://"%20<a%20href="http://syslinux.zytor.com/archives/files/2009-March/""%20target="_blank">http://syslinux.zyto...les/2009-March/"</a>"]http://syslinux.zytor.com/archives/files/2009-March/[/url]

#21 Bean123

Bean123

    Member

  • Members
  • 30 posts

Posted 16 May 2009 - 06:19 PM

The latest fbinst has been uploaded to gna, I also update the usage information in #1.

#22 maanu

maanu

    Gold Member

  • Advanced user
  • 1,125 posts
  •  
    Pakistan

Posted 18 May 2009 - 06:56 PM

bean

i see u have released v 1.3 at chinese forum today , which seems great as u have introduced some great features there and what i could understand is , now we can load multiple boot loaders ?

will u plz update the first post with details ? it seems google is not good to translate chinese to eng :D . i hardly can understand on those forums..

#23 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5,013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 18 May 2009 - 08:17 PM

maanu

"take it easy" :D
give some time to Bean123 , he is kind enough to share this info in english on boot-land at firstplace and So far i see I believe Bean123 will be kind to update current boot-land topic in time. Understand that it is a bit hard to update infos in different places rapidly during development ;).
:D

#24 maanu

maanu

    Gold Member

  • Advanced user
  • 1,125 posts
  •  
    Pakistan

Posted 18 May 2009 - 08:58 PM

yeah u'r right lancelot :D , i guess im extra excited about this tool . it is first of its kind actually .

bean is a very sharp coder really , i have seen him releasing debug versions at a blazing speed ./ specially his moded grldr version which he releases for v 1.2 i guess . which was for those systems that were loading grd slow .
but now i guess it is not compatable with v1.3...

#25 Bean123

Bean123

    Member

  • Members
  • 30 posts

Posted 20 May 2009 - 06:48 AM

information updated on the latest fbinst 1.3 and fb enabled grub4dos.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users