Jump to content











Photo
- - - - -

I think I bit off more than I can Chew.....(and that's WITHOUT teeth, too!)

g4d 4k gpt legacy bios uefi mbr wtf?! grub2 external usb

  • Please log in to reply
15 replies to this topic

#1 Kapt Blasto

Kapt Blasto

    Newbie

  • Members
  • 11 posts
  •  
    United States

Posted 01 July 2020 - 04:39 PM

Hello all:

I gotten myself into a corner.

My "intermediate" plan to make a 5TiB "technician's" drive that has, maybe
5 flavors of Linux,
a Windows Installer system (with all the "chocloately?" goodies, plus other "sweets") from XP to 10-2004(20H1?)
and 5 different kinds of PE enviros.

Plus.... a "daily driver" of Win 10 pro on a VHD(X?) (or 2Tib IMG,(or 50GiB IMG w/ some other IMG's) IF, I can get that on an EXT4 or BTRFS(partitionless?)),

Plus... a portableapps (and/or competitor's) platform that serves up all the programs portable-style, to all the different PE's, and the "daily driver" (most importantly OFFICE and VMWARE, VIRTBOX, and QEMU)

That most importantly, can be booted from BIOS or UEFI, on any computer I want....32 or 64 (maybe MAYBE SBC's like PI's or competitiors...)

...that I was going to call "Augie's SUPERDUPERBOOTDISK...." (ok. so it's not that original of a name....but...)

...has hit the proverbial WALL (OF KRYPTONITE) .....and got stuck.

...and I need somebody with a magic SPATULA....to scrape me off the wall....because I'm STUCK, man....
=================================================================================

Ok, 

1st issue:
this 5 TB WD Easy Store. I got from Amazon. (Best Buy, through eBay...) 
It's basically a "Made for Best Buy" retread of a WD MyPassport, with on the fly Encryption chip,
and instead of a usb3 Micro B to Sata, like normal....it's USB3 Micro B interface the whole way, on the drive's board. (maybe that's not necessarily a problem....but with the controversial SMR, instead of standard CMR? ehhh..........ugh!)

Ok, next issue:

Legacy BIOS (be it "lazy" detect or "Strict", (32, or even 64 bit)) and 4Kn Sectors.... don't mix.(that's what I've read, should I believe it?)
512e sectors might work, at the cost of WRITE speeds. But there's gotta be a better way  than that....f'real!

Going hand in hand with that that issue, ISSUE 3....

Legacy and GPT....I have COMBED OVER at least three threads on here, concerning the different ways to boot GRUB or even G4D on a GPT Drive, from Legacy Boot.
I have read multiple mentions about Wonko's "Underfloppy" method, but I'm stumped on the DFSO/DFSI actions, and the procedures (BTW, why isn't the DFSO/DFSI files hosted HERE, in the downloads section?) 

(Hey! It took me over 20 YEARS to get the hang of designing crude VBA Class Objects....it was just GREEK to me, and that was from a self taught C++ background...but I digress...)

I even went over to Rod's GPT FDISK site concerning Hybrid MBR's and even though he (and maybe all of you) don't recommend using them.... he did say a "Printf 'o/o/o....o" | dd of=dev=sdx...." maneuver can put a SECOND entry into the protective MBR, that can be seen from Legacy Bios as "Active" that wouldn't break UEFI/GPT specs, but it does cause trouble with LBA counts, and GDISK doesn't like it.  (I can get the exact link up there if you like, if you haven't already seen it!)
And I was also reading about GPT partition type EF01 the MBR partition....and I can't find anything concrete on that.... what kind of partition IS that...and....would THAT work???

Also....of certain note.... Even if I configured this disk MBR style (with 512e) and put an active fat 32 boot partition onto it....My HP Pavillion 11 X360 (yeah....it was an ebay special, its what I'm working with....) with secure boot turned OFF and legacy boot turned ON ....
doesn't detect the drive when it's connected to the only USB3 port this computer has....
it only detects it when it's connected to USB2
(works....but such a bummer....could it be a POWER ISSUE 5v versus 12 V because of the size of the drive, that's the problem, HERE? or could it be because of "lazy" vs "strict" bios detection rules in this particular computer's Legacy Bios? Maybe "strict" when it's USB3 and "Lazy" when it's USB2?)

Anyway....I'm still trying to comb through the forum pages....If I can overcome THESE 3 or 4 main problems then I think I can overcome the rest, such as....

How to marry Steve6375's E2B Menu's and Screens with Ty Nguyen's AIO Boot Grub 2 Booting system, together...
maybe A1ive's UEFI boot system, or even Ventoy's (how long has Ventoy's page been down?) 

if any of you need a blow-by-blow sequence of what I did...(with logs and hex outputs) and other things.... I'll be more than happy to provide it...

Anyway, looking forward to reaction from you guys....

(not necessarily looking forward to reactions of
'EGADS MAN! What horrors have you Brought our humble board?! Kill that abomination! Kill it with FIRE, NOW!'....
but would be accepted as the humor as I hope it would be (intended?) to be...on what's turning out to be quite an abomination....)

(BTW. if I should decide to kill this damnable abomination with fire....what should I cook over the roaring flame? S'mores? Steak? Turkey? Venison? Hot Dogs? Marinated Salmon? Shishkabob?? And what kind of Beer should I serve? Or maybe Wine....Chianti? Pinot? PORT? MD2020? (Hey! With this Crazy Year... MAD DOG 2020 is probably the most prudent drink to serve with this potential BBQ I'm considering doing with this.......THING....)

I await your response.

Sincerely,

KAPT BLASTO.


Edited by Kapt Blasto, 01 July 2020 - 05:16 PM.


#2 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 01 July 2020 - 05:38 PM

Legacy and GPT....I have COMBED OVER at least three threads on here, concerning the different ways to boot GRUB or even G4D on a GPT Drive, from Legacy Boot.
I have read multiple mentions about Wonko's "Underfloppy" method, but I'm stumped on the DFSO/DFSI actions, and the procedures (BTW, why isn't the DFSO/DFSI files hosted HERE, in the downloads section?) 
 

What is the problem?

 

You can't find DSFOK? :unsure:

 

It is available via Wayback Machine:

https://web.archive....eware/dsfok.zip

 

Anyway, I am attaching it, just in case.

 

About your disk, if it is 4KN (i.e. 4096 bytes/sector Native) it won't boot. <- last character is a full stop or period, no buts, no ifs.

If it is AF (i.e. 4096 bytes/sector BUT exposing 512 bytes/sector) it may.

 

USB3 vs. USB2 detection is likely BIOS issue.

 

From the number of issues you have all together, you need not a SPATULA, but rather a de-atomizer (and of course a re-atomizer) ;), maybe you are wanting to do too much and too much all at the same time.

 

:duff:

Wonko

Attached Files


  • Kapt Blasto likes this

#3 Kapt Blasto

Kapt Blasto

    Newbie

  • Members
  • 11 posts
  •  
    United States

Posted 01 July 2020 - 06:00 PM

Hey Wonko:

Thanks for the reply:

I have a WD formatter that can format it either 4K(n?) or format it 512e Log /4K physcial. And I got it off WD's site. So...it might not be a problem there...

DFSOK through the Wayback machine may be nice. I think I will use that link, and go reread your Underfloppy procedure.
(EDIT: is it  permission issues with OZGrid/the author of DFSOK, that prevents the zip file from being hosted here? Just curious....)

BIOS issue when it comes to detection of USB2 / USB3 Well...seeing as this particular unit's Legacy Bios CAN detect an MBR style 2TB UEFI partition and Legacy Bios partition, but can't detect it when GPT w/Bios_Grub Part and a Part flagged Legacy Boot... makes be believe it can't see the "active" part in the protective MBR. so that makes me think of the Legacy Boot part of the BIOS being "Strict" like QEMU....have to run more tests.

And I was considering an Eludium Q-37 Explosive Space Modulator, to blast me off the kryptonite wall, rather than a de-atomizer/re-atomizer....but since I don't have an atomizer proggy....and some idiot martian bought up all the back-order of the Eludium's, and the stupid space store's always out of THAT...I figured a old Spatula would work....Oh well....

I'm a little letdown though... I was hoping you'd offer to bring marshmallows to my BBQ....but....that's OK.
(2nd EDIT: Hello, My name is Kapt....and... I'm a foodie. Oh wait! This isn't foodaholics anonymous, is it? Damn!)

Thanks for the response, Wonko.... and for the link.  I'll keep plugging along, until I get this.


Edited by Kapt Blasto, 01 July 2020 - 06:22 PM.


#4 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 01 July 2020 - 06:21 PM

Technically (at least that was the reason for the underfloppy approach) the idea was that a disk normally mountable/bootable accessible as GPT under UEFI (with not any kind of hybrid MBR partition entries) could be made bootable in BIOS without altering in any way its GPT structure.

 

The pre-requisite is that the BIOS actually does what it should do (BIOS in itself should know nothing and care nothing about the partition table and its contents).

 

A good BIOS would:
1) check that last two bytes of first absolute sector or LBA0 of the hard disk that will boot are 55AA
2) just §@ç#ing execute the assembly instructions starting from offset 0

 

then it is the MBR code (if any) that will use (or not use) the partition entries, that are then needed by the OS itself.

 

This does not exclude that some stupid BIOS (looking at you Insyde) checks other things and actually (in the past, now solved) wouldn't boot (example) the grub4dos gtldr.mbr code.

 

The underfloppy method uses modified code derived from Syslinux/makebootfat so it should be pretty much "compatible" with "normal" (unneeded) checks a BIOS might make on the code, and then there is still the good grub4dos umbr that is worth a try.

 

IF (random idea) the stupid BIOS checks each of the four partition entries Partition ID and doesn't boot if it finds a 0XEE, then we have a problem

 

:duff:

Wonko



#5 Kapt Blasto

Kapt Blasto

    Newbie

  • Members
  • 11 posts
  •  
    United States

Posted 01 July 2020 - 06:32 PM

Wonko: You wrote:
"This does not exclude that some stupid BIOS (looking at you Insyde) checks other things and actually (in the past, now solved) wouldn't boot (example) the grub4dos gtldr.mbr code."

 

YEP...That's exactly what this Unit I got, has....an INSYDE BIOS 

I guess we're both on the same wavelength....we HATE INSYDE BIOSes.....

I don't even know how to get into the UEFI shell on this stupid thing....  it's one of those "locked down/crippleware" UEFI's (gee...thanks Insyde!)


 


Edited by Kapt Blasto, 01 July 2020 - 06:34 PM.


#6 Kapt Blasto

Kapt Blasto

    Newbie

  • Members
  • 11 posts
  •  
    United States

Posted 11 July 2020 - 03:09 PM

Edit from OP

: the "Printf '0/0/0....'|dd if=..." came from ArchLinux's wiki's partioning page, near the bottom of that particular wiki page, Not Rod's GPTFDISK page...

https://wiki.archlin...hp/Partitioning

However, something that WAS kicked around here was...the idea of taking a GPT partition and making it type EF01 (a pseudo whole-MBR disk inside a partition), and I saw a post here about it...but based on what I had seen, it wasn't very promising as a supposed BIOS-Bootable-for-the-whole-drive idea...am I correct in that take-away?

Anyway....still trying to hash out the instructions, to make myself a "step-by-step" instructional on how to do this.... 



#7 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 11 July 2020 - 04:19 PM

However, something that WAS kicked around here was...the idea of taking a GPT partition and making it type EF01 (a pseudo whole-MBR disk inside a partition), and I saw a post here about it...but based on what I had seen, it wasn't very promising as a supposed BIOS-Bootable-for-the-whole-drive idea...am I correct in that take-away?

Noone ever saw an EF01, actually 024DEE41-33E7-11D3-9D69-0008C781F39F, in the wild and some believe that it is no more than a ghost story made up by bootmen to scare their kids ...

Though as seen here:
http://reboot.pro/to...-gpt-partition/
it can be (mis-)used for a couple tricks with grub4dos (of course ONCE grub4dos has ALREADY been booted with other methods/ways)

What happened was that someone(I seem to remember he was a good HP guy) made a (BTW smart) proposal that was included in the specs (which last time I checked were over 2200 pages) and that later was ignored by everyone and never implemented by anyone in any tool or OS, let alone BIOS or UEFI.

:duff:
Wonko



#8 Kapt Blasto

Kapt Blasto

    Newbie

  • Members
  • 11 posts
  •  
    United States

Posted 17 July 2020 - 10:33 AM

Wonko,

Looks like someone just lifted your words to promote CBD oil, here....(and I thought I was bad enough.....)

(And they weren't even decent enough to promote where to get the REAL McCOY!)
(But, but....He's Dead, Jim! Him and Elvis both bought it, trying to get the last Klingon off their a$$)
(Fascinating!....Totally Illogical....but Fascinating!)
(Wait! I thought Elvis died trying to eat a Boat!)
(..........?!?!?!?......)
(Well, isn't that what Nixon said: Elvis Eats Boats?!)
(.........Jim.......How Many fingers do you see, right now...?)
(....!!!....That's not Funny!)
(Neither are those fake eyebrows you got!)
(What do you mean FAKE....my eyebrows are not....uh....Damn! Yes they ARE FAKE! OH MY....! I'm A REPLICANT!)
(Yep...I told you. Completely normal REPLICANT reaction to realizing they're a replicant!)
(Doctor, would it be wise to put the patient down....)
(....???!!!!....)
(....for a NAP!)
(Well, go ahead, before he orders the ship to self-destruct again...)

.....
(those Klingon B*****ds....they Killed my Thread! Beam me up, Scotty! This planet SUCKS!)


Edited by Kapt Blasto, 17 July 2020 - 10:47 AM.


#9 Kapt Blasto

Kapt Blasto

    Newbie

  • Members
  • 11 posts
  •  
    United States

Posted 17 July 2020 - 11:07 AM

Ok, now where were we.....

I was going to head back to the idea of EF01, but...
Honestly I don't think my BIOS would be able to see that, as it won't even bring up the drive in the legacy BIOS options.... when I hook it USB3...

But in USB3 it CAN detect OTHER external drives and sticks. (Possibly because THEY are MBR, whereas the "protective" MBR won't let it get detected in GPT? I don't know...)

I'm still looking at the "Underfloppy" method....

 


Edited by Kapt Blasto, 17 July 2020 - 11:08 AM.


#10 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 17 July 2020 - 12:45 PM

That is the whole point.

 

A GPT disk has normally:

1) NO code
2) an entry in the MBR partition table with a "protective" ID of 0xEE spanning from LBA2 to the end of the device

 

A BIOS will attempt booting to the MBR code at offset 0 on sector 0, since there is none, it won't boot.

 

A UEFI will look for the EE partition, check the GPT header (sector 1) ,parse the GPT partition table (from sector 2) find a (FAT32) partition with GPT GUID C12A7328-F81F-11D2-BA4B-00A0C93EC93B (EFI system partition), look for an EFI bootloader, in the case of Windows, \EFI\MICROSOFT\BOOT\BOOTMGFW.EFI

 

The "underfloppy" approach adds to the MBR some code that chainloads the extents where the underfloppy is saved, thus allowing booting from a GPT disk without changing anything else and leaving the disk normally UEFI comparible and bootable.

 

 The UMBR does the same (adds to the MBR some code), though instead of chainloading an extent containing a filesystem, it directly chainloads the extents where grub4dos is.( a different approach with some advantages and some shortcomings).

 

:duff:

Wonko


  • Kapt Blasto likes this

#11 Kapt Blasto

Kapt Blasto

    Newbie

  • Members
  • 11 posts
  •  
    United States

Posted 18 July 2020 - 02:42 PM

Ok, so...we replace whatever's on LBA 0, with either "Underfloppy" or "UMBR" and it's supposed to point...

In "Underfloppy" case to the partition/fs where Grub4Dos is...

And in UMBR's case to the sectors....where the partition is?

And...neither case will cause it to be a hybrid MBR?

Am I getting this right?



#12 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 18 July 2020 - 04:32 PM

Am I getting this right?

Almost.

Ok, so...we replace whatever's on LBA 0, with either "Underfloppy" or "UMBR" and it's supposed to point...

In "Underfloppy" case to the partition/fs where Grub4Dos is...

Yes, almost.
In the case of the "GPT hack" technically it points to an extent where a fs (where grldr is) resides, it is not a partition as that extent is not addressed in either the MBR nor in the GPT partition table.
Since this extent address is "volatile" in the sense that ONLY the MBR code and the grldr use it initially, it can be the same as a GPT partition, regularly addressed in the GPT partition table, with a PBR booting to grldr.
The particular case for which the "underfloppy" method was developed was that the "base" GPT disk partitions/volumes would not be modified in any way (and changing the PBR to load grldr and writing the grldr file to it would represent a modification), in your case you have not such a limitation.

And in UMBR's case to the sectors....where the partition is?

No, to the sectors (extent) where grldr (the actual file, that needs to be contiguous) is.

And...neither case will cause it to be a hybrid MBR?

Sure, what is changed is outside the actual MBR partition table, a hybrid MBR/GPT is more properly one that has in the MBR partition table one or more partiton entries BESIDES the single 0xEE one that UEFI/GPT prescribe, while this approach leaves that single partition entry "as is" and the three following slots empty:

https://www.rodsbook...isk/hybrid.html

But yes, it is still a sort of hybrid because some MBR code is written to it, it is more similar to the "Other Hybrid MBR" on that page, that BTW references the proposal I was mentioning earlier:
http://reboot.pro/to...h-too/?p=215340
about the EF01/024DEE41-33E7-11D3-9D69-0008C781F39F:
http://www.t13.org/D..._code_annex.pdf

:duff:
Wonko
  • Kapt Blasto likes this

#13 Kapt Blasto

Kapt Blasto

    Newbie

  • Members
  • 11 posts
  •  
    United States

Posted 18 July 2020 - 06:32 PM

Thanks for the reply again, Wonko.

Ok, so, to reiterate (Just for my noggin, I guess) 

I have a 5TB (4.7TiB) USB3 Bus based WD Easystore Portable HD, that I want to make a Multibooter.

Has to be formatted 512e and not 4Kn because UEFI in LegacyMode won't be able to "see" it to bring it 

I HP Pavilion x360 Touchscreen Laptop, with a locked-down Insyde UEFI (that can ALSO boot Legacy Bios Style), that I want to boot this Multibooter From both UEFI, and from LEGACY/BIOS/CSM...to either GRUB2 or Grub4Dos. (which at this writing, the latest versions DO support GPT)

The UEFI appears easy enough, as with the right flag in a Fat32 partition (BOOT/EFI) and the right files, it can boot to GRUB2UEFI, no problem. (if it has the GPT "BIOSBOOT") partition because of core.img needing to be there.

It's the Legacy Part that requires the "Underfloppy" or "UMBR" doings...

So...

If I want to go "Underfloppy" Route:
   I use "dfso" to copy LBA0 out to a file, work on the file with a Hex Editor, and dfsi it back in.....? OR....
   just simply replace LBA0 with a Modified LBA0 from a file already made, that all it does is point to a fat12 IMG file on
     (I guess ANY? or A "BLANK" GPT partition with the BIOSBOOT flag?) partition that THEN
             goes to Grub4Dos GRLDR file on the intended GPT partition that MAYBE has all the Easy2Boot files....
             OR...if I want to go "Grub2" (AIO BOOT) 
              the img file has to be pointing to grub.cfg, on that supposed GPT partition?
              
And if I want to go the "UMBR" route:
    replace LBA0 with the UMBR --> UMBR points to extents that have the GRLDR /Grub.cfg?
    Legacy picks it up and all it is is just a pointer...
    But THIS would mess with GPT partitions...

Am I getting closer to the right track here?



#14 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 19 July 2020 - 09:24 AM

Yes and no.

Neither the "underfloppy" nor the UMBR mess with anything.

Both simply insert a new (virtual) address in the MBR (in an area that either already normally contains code in BIOS/MBR or that is unused in UEFI/GPT) and their code chainload that address.

 

This new address is:
1) in the case of the "underfloppy" a small filesystem written in an area of the disk that won't be used anyway in both BIOS/MBR and UEFI/GPT[1]
2) in the case of the UMBR the actual sectors where grldr resides (normally within a "normal" GPT partition, possibly the EFISystem volume, but not necessarily, these are absolute addresses) 

 

I am attaching a scheme, I hope it helps.

 

It makes no sense to "format" either 512e or 4Kn, the disk IS either 512, 512e or 4Kn, you CANNOT change it, if the disk exposes 512 bytes sectors it may be bootable, if it exposes 4096 bytes sectors it won't.

 

:duff:

Wonko

 

[1] again, this is specific to the original approach that had the limitation of being "invisible", in your specific case you can use instead of the "underfloppy" a GPT partition (again possibly the EFISystem one)

Attached Thumbnails

  • booting_scheme.jpg


#15 Kapt Blasto

Kapt Blasto

    Newbie

  • Members
  • 11 posts
  •  
    United States

Posted 19 July 2020 - 09:53 AM

Wow... Thanks Wonko...

That helped me to visualize it.

Looks like I will need a Hex Editor....

Maybe...maybe...maybe....I can pull myself off the kryptonite wall.....YAY!

:punk:  :santa:  :thumbsup: 
 


Edited by Kapt Blasto, 19 July 2020 - 09:57 AM.


#16 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 19 July 2020 - 12:26 PM

Wow... Thanks Wonko...

That helped me to visualize it.

Looks like I will need a Hex Editor....

Maybe...maybe...maybe....I can pull myself off the kryptonite wall.....YAY!

:punk:  :santa:  :thumbsup: 
 

Good. :)

 

Just in case:

http://reboot.pro/to...xer-mbr-backup/

http://reboot.pro/to...-hexer-scripts/

 

:duff:

Wonko







Also tagged with one or more of these keywords: g4d, 4k, gpt, legacy bios, uefi, mbr, wtf?!, grub2, external, usb

2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users