Uefi and porteus 3.0

Post tutorials, HOWTO's and other useful resources here.
User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Uefi and porteus 3.0

Post#16 by Ed_P » 13 Jun 2014, 17:42

brokenman wrote:You clearly don't comprehend the implications yet continue to argue them. I showed you empirical evidence of what can happen (my screenshot) which you ignored.
I did not ignore your screen shot. I said it was a bug in the protective MBR. While I understand the protective MBR doesn't contain any boot code and wasn't designed to thus why you got what you got I think it should at least display an error msg should someone try to boot it indicating No Boot Code Found or something like that rather than let the machine error out.
You clearly mentioned in your original post that it boots the operating system from the HD did you not?
Yes, the boot code your script creates in rEFInd

Code: Select all

menuentry "Windows" {
	volume $UUID
    icon /EFI/BOOT/icons/os_win.png
    loader /$WINEFI
works. :good: And I doubt the MBR on the USB drive had anything to do with it so I fail to see the concern.
I won't be creating this, feel free to release it yourself. I'm done. :wall:
I'm sorry you feel that way. I've proven the thing can be done, a functional MBR and GPT on a USB drive, with a shared Porteus system even. It would probably even work with the Porteus OS on a separate partition like you want. Try doing what I did, I'm pretty sure you will like it. Reading is good, doing is even better. :)
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Uefi and porteus 3.0

Post#17 by brokenman » 13 Jun 2014, 18:58

I said it was a bug in the protective MBR.
It is not a bug in the MBR. The MBR is just 512 bytes of very simple code that a BIOS firmware (and certain other software) know how to use. If there is a bug it is in what reads it.
Try doing what I did, I'm pretty sure you will like it. Reading is good, doing is even better.
I thought you said reading was for girls? You assume too much. I spend approximately 3-4 hours per day (usually more) working on Porteus (yes actually DOING stuff) and not just reading about it. Indeed I have already DONE what you suggested on both fixed drives and removable media. The first has hosed my system more than once. The second resulted (albeit once only) in the screenshot I showed you. This is what 'empirical' means. I tried it, got burned and decided putting others in the same situation is not a good idea. I will quote once more from the article that you read (or didn't) so you hopefully don't follow the same path.

I really can’t recommend strongly enough that you do not attempt to mix UEFI-native and BIOS-compatible booting of permanently-installed operating systems on the same computer, and especially not on the same disk. It is a terrible terrible idea and will cause you heartache and pain. If you decide to do it, don’t come crying to me.
This seems pretty clear to me. It (the same disk) applies to both internal 'disks' and removable 'disks'. This is the point i feel you are missing,and the whole point of your post. You want the best of both worlds (UEFI and BIOS) and that's fine ... but I hope you can understand that I can NOT release something containing this potentially destructive code. Feel free to take the gamble. I won't.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Uefi and porteus 3.0

Post#18 by Ed_P » 13 Jun 2014, 20:41

brokenman wrote:
I said it was a bug in the protective MBR.
It is not a bug in the MBR. The MBR is just 512 bytes of very simple code that a BIOS firmware (and certain other software) know how to use. If there is a bug it is in what reads it.
Yup, that's what it is. Have you looked at the "protective MBR" that GDisk created? Do you see code? IF the "protective MBR" is suppose to support booting obviously it's broken based on your experience and should be reported as a bug. IF the "protective MBR" is suppose to simply support non-UEFI system access to the drive with 0x00s for boot code than I think code should be added to it to display No Boot Code and exit. And this again should be reported to GDisk's creator.
Indeed I have already DONE what you suggested on both fixed drives and removable media. The first has hosed my system more than once. The second resulted (albeit once only) in the screenshot I showed you. This is what 'empirical' means. I tried it, got burned and decided putting others in the same situation is not a good idea.
I do NOT suggest, or recommend, my approach on machines hard drives. USB drives, independent from the machine's hard drive OS, are a different situation. How did you create the MBR on the USB drive that you tried? Did you use GDisk to do it? Can you use the code from the Porteus-install-Linux program to create the MBR?
I will quote once more from the article that you read (or didn't) so you hopefully don't follow the same path.

I really can’t recommend strongly enough that you do not attempt to mix UEFI-native and BIOS-compatible booting of permanently-installed operating systems on the same computer, and especially not on the same disk. It is a terrible terrible idea and will cause you heartache and pain. If you decide to do it, don’t come crying to me.
This seems pretty clear to me. It (the same disk) applies to both internal 'disks' and removable 'disks'.
Actually this is the key to our disagreement. The statement states "permanently-installed operating systems", USB drives are NOT permanent.
This is the point i feel you are missing,and the whole point of your post. You want the best of both worlds (UEFI and BIOS)
On a USB flash drive.

Kinda off topic, have you figured out the fix for the 2nd partition ntfs error in your script? I noticed in my testing of it for this project that it wasn't picking up the UUID for the flash drive. The rEFInd menu entries had the "UUID" characters in them but nothing followed them.
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Uefi and porteus 3.0

Post#19 by brokenman » 14 Jun 2014, 01:00

IF the "protective MBR" is suppose to support booting obviously it's broken
One more time. It's not. That's why it is called a 'protective mbr.' Why do you keep insisting? Why would a GPT want a usable MBR?
USB drives, independent from the machine's hard drive OS, are a different situation.
Please explain how they are different. An operating is an operating system no matter where you boot it from. Most people prefer not to have them hosed. Wherever they may be.
How did you create the MBR on the USB drive that you tried?
I tried various scenarios. fdisk then gdisk. gdisk alone. cfdisk then gdisk.
Actually this is the key to our disagreement. The statement states "permanently-installed operating systems", USB drives are NOT permanent.
Yes. It refers to 'operating systems' not USB's. It refers to the 'operating system' and not the place where it is installed. My USB install is permanent. I don't plan on removing it until it needs updating. In any case, nobody likes having there OS hosed whether permanent or whatever your idea of non permanent is.

Maybe this guy can convince you. I would listen to this guy. What you are talking about is a hybrid MBR. He writes in big letters. Dangers and Problems of a Hybrid MBR.

http://www.rodsbooks.com/gdisk/hybrid.html
Kinda off topic, have you figured out the fix for the 2nd partition ntfs error in your script?
Until someone else can confirm it, I don't consider it an error of the script. I can't reproduce it.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Uefi and porteus 3.0

Post#20 by Ed_P » 14 Jun 2014, 04:36

brokenman wrote:Why would a GPT want a usable MBR?
Why would a GPT care if there was a usable MBR or not? Based on my experience it doesn't care. What does care are Non-UEFI based systems. Windows 7 can not read a USB drive created by your UEFI script. Transferring files from a Non-UEFI system to a UEFI system can not be done with a USB drive created by your UEFI script.
Please explain how they are different. An operating is an operating system no matter where you boot it from. Most people prefer not to have them hosed. Wherever they may be.
An operating on a hard drive is the basis for booting the machine, and it is usually it is covered by manufacturer warrantee. An operating system on a USB drive is something the user has created, is not covered by a warrantee, and will not stop the machine from booting it's hard drive OS if it gets hosed.
How did you create the MBR on the USB drive that you tried?
I tried various scenarios. fdisk then gdisk. gdisk alone. cfdisk then gdisk.
How does Porteus-installer-for-Linux create it's MBR?
Kinda off topic, have you figured out the fix for the 2nd partition ntfs error in your script?
Until someone else can confirm it, I don't consider it an error of the script. I can't reproduce it.
The fact that 50% of the people who have tried it have the error doesn't make it important to you!! :) Try running it on a non-UEFI machine.
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Uefi and porteus 3.0

Post#21 by brokenman » 14 Jun 2014, 14:18

Why would a GPT care if there was a usable MBR or not?
Already explained MULTIPLE times. You just don't want to listen.
An operating on a hard drive is the basis for booting the machine
Huh? Now an OS boots the machine? My USB is the basis for booting my machine. Handy when the bootloader on the HD is hosed because of using a hybrid MBR.
How does Porteus-installer-for-Linux create it's MBR?
It uses dd and then sfdisk ... but it depends on .. oh hell. Go read it yourself.
The fact that 50% of the people who have tried it have the error doesn't make it important to you!!
Strange logic. In this case the 50% is you. Do you think norton races out to fix there latest updates when one person reports a false positive? Do you think a car company begins making a new model when it has one client, and that client doesn't know how to drive and insists on using the pavement for driving after being warned against it.

Look as I said. Continue to use your system, it works for you and that's great. I'm dropping this until further interest is shown. Peace out.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Uefi and porteus 3.0

Post#22 by Ed_P » 15 Jul 2014, 04:01

Thought you might find this link interesting reading:

http://danieladeniji.wordpress.com/2013 ... scripting/

Especially the Partition Style: steps.
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Uefi and porteus 3.0

Post#23 by brokenman » 16 Jul 2014, 01:47

Thanks. Some inconsistencies though. Not a very trustoworthy souce of info:
Depending on the Version of Windows (OS Version) , Partition Style, and your LUN size, your gold standard for “Starting offset” appears to vary a bit.
Hooray for standards!
If your disk is more than 2 TB, then it has to be more than 2 TB
Really. That sounds logical. Unless it is Schrodinger's 2TB drive (joke).

The good news is that with my latest MBR/UEFI together on the same USB I have unable to kill anything for a while. When there is more interest in UEFI I will pick the project back up.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Uefi and porteus 3.0

Post#24 by Ed_P » 17 Jul 2014, 03:52

I found the section on determining partition styles useful and the results of testing them on several of my USB drives interesting. Try DiskPart on your UEFI USB drive.
There a couple of ways to determine your partition style:

GUI – Disk Management
DiskPart / list disk
Ed

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Uefi and porteus 3.0

Post#25 by francois » 13 Sep 2014, 20:30

@Ed_P and brokenman:

I read this thread entirely. Here is what I understand:
A - UEFI or bios with porteus installation, but not both on the same key.
B - If you put UEFI and bios on the same key, you may endanger the hdd content of the computer. Be warned!
C - From my readings and very shallow experience, the partitioning is peculiar in EFI. (the structure of my toshiba satellite z930 sdd partitions, which would be EFI, and the job that evolution linux (archlinux new distribution) with its installer was trying to do on my hdd, and the reading of a very few threads on EFI). And one should use or BIOS or EFI on one comptuter.

1.0 I imagine that after all these discussions, your conclusions might be a little more subtle. If it is the case, is it possible in point form to have a summary of these conclusions on having a porteus install on usb of the EFI type?

2.0 In addition, as this is a howto, is it possible to have a clear enunciation step by step of the procedure to build a EFI compatible usb key to EFI computers
2.1 with porteus on it, without bios (brokenman's state of the art) on the same key and to have an abstract about its usefulness in the first post.
2.2 with porteus on it, with bios (Ed_P's proposition) on the same key and to have an abstract about its usefulness in the first post. And the limitations of that type of installation.

Meanwhile, I will reread that thread. ;)
Prendre son temps, profiter de celui qui passe.

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Uefi and porteus 3.0

Post#26 by Ed_P » 14 Sep 2014, 00:52

francois wrote:A - UEFI or bios with porteus installation, but not both on the same key.
It is possible to have both on the same key. I have one.
B - If you put UEFI and bios on the same key, you may endanger the hdd content of the computer. Be warned!
No!! The key's structure will not impact the hdd.

The concern is the partition table in the MBR is separate from the partition in the GPT and the softwares that maintain/update change each one do not change the table entries in the other thus the concern that they will get out of sync and files created by one OS can overwrite files created by the other OS. Certainly a valid concern but how often are partitions changed on a USB drive? And how hard is it to backup the files on the USB drive, reformat it and change it's partition layouts in both the MBR and GPT and restore the files? It's an extra step to do but it's not hard or impossible to do.
C - From my readings and very shallow experience, the partitioning is peculiar in EFI.
Ok. :)
And one should use or BIOS or EFI on one comptuter.
On a computer's hdd, sure. A computer's hdd is used on only one computer. But a USB drive can be used on multiple computers. If all your computers are EFI then your USB drive can be too. And if all you computers are non-EFI, Legacy mode then your USB drive can be also. But what about the evolving multi-computer environments that have both types of computers? Multiple USB drives required? And to be maintained? Or one that works on both?

I'm not forgetting your other questions, just taking a break.
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Uefi and porteus 3.0

Post#27 by brokenman » 14 Sep 2014, 14:59

Ed_P explains it well in letter B above. This is exactly the concern with some exceptions. (see below for other concerns)
And how hard is it to backup the files on the USB drive, reformat it and change it's partition layouts in both the MBR and GPT and restore the files? It's an extra step to do but it's not hard or impossible to do.
If you are publicly releasing something then you must try to be prepared for ALL users. We have seen ALL sorts of questions on this forum and two things are clear. Many people don't read documentation and many people have little to no linux experience and are not even aware that they must run a script to make Porteus bootable. These users can hardly be expected to backup, reformat, change partitions and perhaps play with EFI firmware. I can point out specific responses to such technical requests if needed.

I was going to make a thread explaining EFI implementations, explaining the pros and cons and comparing against the BIOS setup but decided against it. The forum already has multiple UEFI threads, and the sheer variation in implementations means there is no one answer for all people. The hybrid machines EFI/BIOS will not last forever. They are just a transition into EFI which will become the industry standard (and this has nothing to do with M$).


To answer your questions:
A - UEFI or bios with porteus installation, but not both on the same key.
Correct

B - If you put UEFI and bios on the same key, you may endanger the hdd content of the computer. Be warned!
It's not that you may damage the actual data. You just may not be able to access it.

1.0 - is it possible in point form to have a summary of these conclusions on having a porteus install on usb of the EFI type?
I released a video with the steps. I can write a HOWTO no problem. I won't release a HOWTO about creating a hybrid MBR (works on both UEFI and CMS).

EDIT:
Other concerns with a hybrid and why I would never recommend having a hybrid MBR/GPT media.

1. Intels EFI standard does not include hybrid MBRs. There is no telling how different boot tools, boot managers or OS's will interpret them. Even gparted changes a hybrid MBR into a 'protective MBR'.
2. MBR and GPT partitions numbers could mismatch
3. GPT and MBR sets could contradict each other
4. Name one utility that creates a hybrid MBR that includes logical partitions.
5. Logical partitions place data structures in a linked-list fashion outside of the partitions they define. Partitioning tools could damage these entries resulting in no access to logical partition/s.
6. A hybrid MBR doesn't work around the 2 TiB limit for MBR partitions
7. The protective EFI GPT (type 0xEE) MBR partition must normally begin on the second sector of the disk, in order to protect the primary GPT data structures. An unwary user might try to create MBR partitions that re-use some disk space that's already in use by GPT-only partitions.

http://www.rodsbooks.com/gdisk/hybrid.html
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Uefi and porteus 3.0

Post#28 by Ed_P » 14 Sep 2014, 22:42

brokenman wrote:Many people don't read documentation and many people have little to no linux experience and are not even aware that they must run a script to make Porteus bootable. These users can hardly be expected to backup, reformat, change partitions and perhaps play with EFI firmware.
I agree but I was referring to people changing partitions after an install to a USB flash drive. And if they know how to change a drive' partitions they know how to backup and restore etc.
B - If you put UEFI and bios on the same key, you may endanger the hdd content of the computer. Be warned!
It's not that you may damage the actual data. You just may not be able to access it.
A USB key is a portable device and most people use the same key in multiple devices. They want, like, need the flexibility to use the key in their UEFI machine and their work machine and their TV and their car stereo. A EFI only flash drive able maybe to boot Porteus on a UEFI machine and download movies and music and create documents unfortunately these files will not be accessible in Windows 7 and Vista machines, their TV, their car stereo or their work machine.
2. MBR and GPT partitions numbers could mismatch
3. GPT and MBR sets could contradict each other
And USB flash drives could fall into the toilet. "Could" is not the same as "will". A Porteus install should, could, create the system files correctly. And if a client on his own changes something on his flash drive it is his responsibility to do it properly not Porteus'.
4. Name one utility that creates a hybrid MBR that includes logical partitions.
Logical partitions would not work with a UEFI system but why would a portable USB flash drive need more than 4 Primary partitions? And why would a UEFI Porteus install need to create Logical partitions?
5. Logical partitions place data structures in a linked-list fashion out side of the partitions they define. Partitioning tools could damage these entries resulting in no access to logical partition/s.
Yes, so a limitation of a UEFI Porteus install would be no Logical partitions used. If a client wants to put 10 partitions on his 32 GB Porteus UEFI flash drive he will need to find a utility that supports that, not Porteus.
6. A hybrid MBR doesn't work around the 2 TiB limit for MBR partitions
Probably why there are no 2 TiB flash drives.
7. The protective EFI GPT (type 0xEE) MBR partition must normally begin on the second sector of the disk, in order to protect the primary GPT data structures. An unwary user might try to create MBR partitions that re-use some disk space that's already in use by GPT-only partitions.
Shame on them for doing that. But that is not a Porteus problem.

I think a distinction should be made that what I'm speaking of is USB flash drives not hard drives. 8 GB, 16 GB, 32 GB, 64 GB and no TiBs. The install of Porteus to a USB drive should support different capabilities than to a hard drive.

And if Microsoft can create UEFI bootable USB flash drives that are readable on non-UEFI machines so to should Porteus.
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Uefi and porteus 3.0

Post#29 by brokenman » 15 Sep 2014, 12:02

Two words. External drives. Your whole premise disintegrates after these two words.

The above come in more than 2TB and with exponential (moores law) improvements do you think it will be long before solid state memory exceeds 2TB? Large capacity external drives have existed for a long time and I have been asked to rescue more than one that contained more than 4 partitions (nothing to do with UEFI).

I am not going to volley back and forth with you again Ed_P. You know my stance on this. You say it's fine. The experts say there are huge risks. I know where I would put my money.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Uefi and porteus 3.0

Post#30 by Ed_P » 15 Sep 2014, 16:39

brokenman wrote:Two words. External drives. Your whole premise disintegrates after these two words.
But I am not talking about "External drives", I am speaking of "Flash drives". 8 GB, 16 GB, etc.
I am not going to volley back and forth with you again Ed_P. You know my stance on this.
Fair enough and I agree with you, and the experts, concerning large hard drives, both internal and external. My point is about small Flash drives, portability and using Microsoft's example with their Windows 8 Rescue flash drive. If Microsoft can do it it would seem that others should be able to also.

And wouldn't it be nice if a Porteus user who wanted to use Microsoft's example for their Porteus flash drive could use your Porteus EFI script to add EFI support to it? :wink: (Basically add my hacks to it to make the format step optional.)
Ed

Post Reply