Jump to content











Photo
- - - - -

help creating the triple MBR with grub4dos


  • Please log in to reply
12 replies to this topic

#1 mr_

mr_

    Frequent Member

  • Members
  • 355 posts
  •  
    Germany

Posted 24 March 2009 - 11:04 AM

From readme_grub4dos.txt:

******************************************************************************
*** Use bootlace to create a triple MBR ***
******************************************************************************

This is typically used for USB drives, though it also works with hard drives.

Steps to create triple MBR:

1. Do a fresh FDISK to create a FAT12/16/32 partition starting at sector 95
(in LBA, that is, the begginning sector(MBR) is sector 0).

2. Install grldr boot sector onto the boot sector of this partition. See
section "Use bootlace.com to install partition boot record" above.

3. Get 96 sectors of the drive starting at sector 0(MBR), and save to file
MYMBR96.TMP.

4. Run bootlace.com:
bootlace.com MYMBR96.TMP

5. Put MYMBR96.TMP back onto the drive starting at MBR(sector 0).

Note: If the drive already has a triple MBR, then bootlace will cancel it
and restore the original partition layout.

For what is this good for? Is it to comply with USB-HDD, USB-ZIP and USB-FDD BIOS booting "standards" at the same time? Like makebootfat?

I do not understand how to create it and need some better instructions.

1. Do a fresh FDISK to create a FAT12/16/32 partition starting at sector 95
(in LBA, that is, the begginning sector(MBR) is sector 0).

How can I specify to create the partition starting from sector 95?

Is fdisk needed or does any more actual tool like windows device management console or linux fdisk also work?

If fdisk is needed, extracted from which DOS or Windows version?

(in LBA, that is, the begginning sector(MBR) is sector 0)

This confuses me. In CHS it's 95 and in LBA 0? This means creating a partition with fdisk like usual?

2. Install grldr boot sector onto the boot sector of this partition. See
section "Use bootlace.com to install partition boot record" above.

That's clear, it's in diddy's guide.

3. Get 96 sectors of the drive starting at sector 0(MBR), and save to file
MYMBR96.TMP.

Unfortunately hd hacker can only read 16 sectors starting from sector 0. Any other tool to do this?

4. Run bootlace.com:
bootlace.com MYMBR96.TMP

Not sure what this does with the 96 sectors. Probable it converts the single MBR into a triple MBR. But from one to three. Seams "only" double MBR, where comes the third one?

5. Put MYMBR96.TMP back onto the drive starting at MBR(sector 0).

It's clear after I got the tool for 3.

#2 tinybit

tinybit

    Silver Member

  • Developer
  • 932 posts
  •  
    China

Posted 24 March 2009 - 07:44 PM

From readme_grub4dos.txt:
..................
For what is this good for? Is it to comply with USB-HDD, USB-ZIP and USB-FDD BIOS booting "standards" at the same time? Like makebootfat?


Probably yes. But I don't know about makebootfat, sorry.

I do not understand how to create it and need some better instructions.

How can I specify to create the partition starting from sector 95?

Sorry again, It seems you have to do this work manually at this moment, until somebody would kindly write a tool for it.

Is fdisk needed or does any more actual tool like windows device management console or linux fdisk also work?

Oh, I almost forgot it: Linux fdisk can do it.

If fdisk is needed, extracted from which DOS or Windows version?


I am not sure if FreeFDISK could do it.

This confuses me. In CHS it's 95 and in LBA 0? This means creating a partition with fdisk like usual?


95 is the absolute sector number, both in CHS and in LBA. The sector 0 is always for MBR(and partition table).

Unfortunately hd hacker can only read 16 sectors starting from sector 0. Any other tool to do this?


dd for windows. Not to mention the Linux dd.

Not sure what this does with the 96 sectors. Probable it converts the single MBR into a triple MBR. But from one to three. Seams "only" double MBR, where comes the third one?


Here is a sample image with triple MBR:

http://nufans.net/gr...mbrgrldr.img.gz

It can act as both a floppy and a harddisk. You may use it as a bootable floppy, or as a bootable harddrive. It will boot to grub4dos in any case. You may try it first in your virtual machine.

#3 mr_

mr_

    Frequent Member

  • Members
  • 355 posts
  •  
    Germany

Posted 24 March 2009 - 08:25 PM

Here is a sample image with triple MBR:

It can act as both a floppy and a harddisk. You may use it as a bootable floppy, or as a bootable harddrive. It will boot to grub4dos in any case. You may try it first in your virtual machine.

Very cool, thanks for detailed answer. :good:

But triple has for me the sense "3". (For example USB-FDD + USB-HDD + USB-ZIP)

HD + floppy booting is "only" "2". I still do not understand where is the third?

^_^

#4 was_jaclaz

was_jaclaz

    Finder

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

Posted 24 March 2009 - 09:40 PM

NO, something is not "kosher" in terms:
  • Cylinders start with 0
  • Heads start with 0
  • Sectors start with 1 (in CHS) or with 0 (in LBA)

MBR is first sector of hard disk, i.e. CHS 0/0/1 or LBA 0.

First track is (normally) 63*512=32,256

There are (normally) 63 sectors before bootsector, i.e bootsector of first partition is (normally) CHS 0/1/1 or LBA 63.

LBA 95 is (normally) CHS 0/1/33.



See also my original USB page:
http://home.graffiti...B/USBstick.html

And peruse the small spreadsheet here:
http://www.boot-land...?showtopic=2959

:good:

jaclaz

Attached Thumbnails

  • Typical_addresses.PNG
  • Special_addresses.PNG


#5 tinybit

tinybit

    Silver Member

  • Developer
  • 932 posts
  •  
    China

Posted 25 March 2009 - 02:16 AM

But triple has for me the sense "3". (For example USB-FDD + USB-HDD + USB-ZIP)

HD + floppy booting is "only" "2". I still do not understand where is the third?

:good:


Triple means MBR(and its related boot sectors) appears in three places: One is on sector 0~17, one is on sector 32~49, and the other is on sector 63~80. Different BIOSes will use different boot sectors at different locations.

#6 was_jaclaz

was_jaclaz

    Finder

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

Posted 25 March 2009 - 08:07 AM

Triple means MBR(and its related boot sectors) appears in three places: One is on sector 0~17, one is on sector 32~49, and the other is on sector 63~80. Different BIOSes will use different boot sectors at different locations.


Yep :good:, most probably there is another small "term misunderstanding:
"double use MBR" or "triple use MBR"
is a term often used in conjunction with makebootfat, which has a "special" MBR code (always on sector 0/0/1 LBA 0) that behaves:
1) as a MBR on BIOS that look for a MBR on the stick
2) as a FAT (16 or 32) bootsector on BIOS that look for a bootsector on the stick
3) if partition entry is written to 4th "slot" in partition table try to emulate a ZIP disk (though there may be further size/geometry costraints)

The compatibility with various motherboard BIOS of this approach has not been tested/reported extensively, I personally consider this approach as a "last resort" attempt when everything else fails.

jaclaz

#7 tinybit

tinybit

    Silver Member

  • Developer
  • 932 posts
  •  
    China

Posted 25 March 2009 - 09:06 AM

@jaclaz

By your description, the grub4dos "triple mbr" naming should be corrected to "double triple mbr", because each mbr of the three is a "double mbr", I mean, each mbr has a partition table and a BPB of FAT in the same MBR sector.

#8 was_jaclaz

was_jaclaz

    Finder

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

Posted 25 March 2009 - 08:46 PM

@jaclaz

By your description, the grub4dos "triple mbr" naming should be corrected to "double triple mbr", because each mbr of the three is a "double mbr", I mean, each mbr has a partition table and a BPB of FAT in the same MBR sector.


Can we settle for "three places double use", shortened to "3x2 MBR"? ^_^ ( subtitle: unlike common 3x2, this is 6x0, you pay ZERO and you get SIX! ^_^)

^_^

:good:

jaclaz

#9 tompl

tompl
  • Members
  • 5 posts
  •  
    Poland

Posted 15 January 2010 - 09:18 AM

Is there any change to make it on ntfs ? i'm trying to do it with bootlance but without success. It always changes drive geometry that the first sector of partition is 63 not 95 like it was before.

#10 tinybit

tinybit

    Silver Member

  • Developer
  • 932 posts
  •  
    China

Posted 15 January 2010 - 12:10 PM

Is there any change to make it on ntfs ? i'm trying to do it with bootlance but without success. It always changes drive geometry that the first sector of partition is 63 not 95 like it was before.


It only applies to FAT12/16/32. For other file systems, it is not applicable.

#11 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 15 January 2010 - 12:34 PM

It only applies to FAT12/16/32. For other file systems, it is not applicable.

Yep. :rolleyes:


Is there any change to make it on ntfs ? i'm trying to do it with bootlance but without success. It always changes drive geometry that the first sector of partition is 63 not 95 like it was before.


BUT if instead of wanting to use this exact technique, you post about the problem you have, there may be a different solution, like fbinst:
http://www.boot-land...?showtopic=7932

:confused1:

Wonko

#12 tompl

tompl
  • Members
  • 5 posts
  •  
    Poland

Posted 16 January 2010 - 10:38 AM

I have successful made a hidden FAT12 parition about ~100kb. And it worked, but bios has some geometry issues, the c/h/s i used was:
Heads=32 Sectors per track = 63, but bios passed h=255 and sectors per track=63. Only the first fat partiton was correctly seen by grub(wired that the geometry c/h/s was else that bios set sectors per track=63, heads=2). On newer computer its ok.

I've set a new fat16, but it always changes my first partition as i was starting on 32 sector. i'm going to try with fat32(lba) right now.

/edited
now i cant even make it like it was before... bootlace always changes my chs, and i lose my partitions....

I have successful made a hidden FAT12 parition about ~100kb. And it worked, but bios has some geometry issues, the c/h/s i used was:
Heads=32 Sectors per track = 63, but bios passed h=255 and sectors per track=63. Only the first fat partiton was correctly seen by grub(wired that the geometry c/h/s was else that bios set sectors per track=63, heads=2). On newer computer its ok.

I've set a new fat16, but it always changes my first partition as i was starting on 32 sector. i'm going to try with fat32(lba) right now.

/edited
now i cant even make it like it was before... bootlace always changes my chs, and i lose my partitions....
/edited 2
it's very wired. I set up triple mbr, with c/h/s=7799/255/63. I can boot from it, but only one partition is recognized:

grub> geometry
drive 0x80(CHS): C/H/S=1024/255/63, Sector Count/Size=16450560/512
Partition num0. active, Filesystem type unkown, partition type 0x11
Partition num1. active, Filesystem type ntfs, partition type 0x07
Partition num2., Filesystem type unkown, partition type 0x07

On the other motherboard, drive is accessable by lba, and i have no problems with other partitions.
Can any1 help me? maybe ma geometry is bad?

#13 tinybit

tinybit

    Silver Member

  • Developer
  • 932 posts
  •  
    China

Posted 17 January 2010 - 01:52 PM

I don't think your geometry has any problem. But the BIOS may have problems.

You may try to figure out the problem. But I suggest you trying the fbinst tool.

The fbinst works on a vast majority of BIOSes, even the buggy ones.