Re: Crypto softraid is supported on GPT/UEFI boot and not just on BIOS/MBR boot, right?

2017-09-29 Thread Janne Johansson
2017-09-29 3:31 GMT+02:00 Nick Holland :

>
> By that logic, we should have quit using cheap disks when they went over
> 32MB.  Or 120MB.  Or 504MB.  Or 128GB.  Or ...
> I have MBRs on 4TB SoftRaid volumes, works fine.
>
> fdisk, make the "entire" disk (welllthe first 2TB) OpenBSD.
> disklabel, change the boundaries of the OpenBSD part to be the entire
> disk.  Done.
>
>
I seem to recall that "trick" on the 2G boundary, or if it was the 8G IDE
limit, or the 33G.
disklabel being "better" than fdisk at accepting
larger-than-some-artificial-limit seems to
be a tradition. ;)


-- 
May the most significant bit of your life be positive.


Re: Crypto softraid is supported on GPT/UEFI boot and not just on BIOS/MBR boot, right?

2017-09-28 Thread Nick Holland
On 09/28/17 05:58, ti...@openmailbox.org wrote:
>> On Wed, Sep 27, 2017 at 05:02:06PM -, ti...@openmailbox.org
>> wrote:
> ..
>>> What am I doing wrong, are there actually any installboot
>>> arguments that could help me make it work?
>> 
>> It looks like you're using GPT on both the physical and the 
>> softraid disk, correct?
>> 
>> In my setup, I have GPT on the physical disk (sd0) but an MBR on
>> the softraid volume. So perhaps try using an MBR on sd1 and see if
>> that helps? I am poking in the dark here. No idea if that will work
>> for you.
> 
> An MBR has a max of 2TB so over time the whole MBR thing needs to be
> discontinued, right, however this is a smaller disk so having MBR
> inside the softraid would work indeed.

By that logic, we should have quit using cheap disks when they went over
32MB.  Or 120MB.  Or 504MB.  Or 128GB.  Or ...
I have MBRs on 4TB SoftRaid volumes, works fine.

fdisk, make the "entire" disk (welllthe first 2TB) OpenBSD.
disklabel, change the boundaries of the OpenBSD part to be the entire
disk.  Done.

Nick.



Re: Crypto softraid is supported on GPT/UEFI boot and not just on BIOS/MBR boot, right?

2017-09-28 Thread tinkr
> On Wed, Sep 27, 2017 at 05:02:06PM -, ti...@openmailbox.org wrote:
..
>> What am I doing wrong, are there actually any installboot arguments that 
>> could help me make it work?
> 
> It looks like you're using GPT on both the physical and the
> softraid disk, correct?
> 
> In my setup, I have GPT on the physical disk (sd0) but an MBR
> on the softraid volume. So perhaps try using an MBR on sd1 and
> see if that helps?
> I am poking in the dark here. No idea if that will work for you.

An MBR has a max of 2TB so over time the whole MBR thing needs to be 
discontinued, right, however this is a smaller disk so having MBR inside the 
softraid would work indeed.

I mostly chose softraid in the first place for symmetry.

I'll try make the softraid contain an MBR and let you know.


Indeed I'm on 6.1, so I see that's why I run BOOTX64 3.32 rather than the 
newest BOOTX64 3.33 of -current. As soon as I try -current (or 6.2) I'll retry 
the whole installation and let you know too.

Thanks again,
Tinker

Re: Crypto softraid is supported on GPT/UEFI boot and not just on BIOS/MBR boot, right?

2017-09-28 Thread Stefan Sperling
On Wed, Sep 27, 2017 at 05:02:06PM -, ti...@openmailbox.org wrote:
> > On Wed, Sep 27, 2017 at 10:31:22AM -, ti...@openmailbox.org wrote:
> >>  >> OpenBSD/amd64 BOOTX64 3.32

Are you running -current?
(We would already know that if you had included a dmesg -- tsk tsk).

In -current, boot is version "3.33", not "3.32".

> I then booted the machine (by typing "boot sr0a:/bsd" in the boot console 
> again of course) and did "installboot -v sd1", and it gave:
> 
>  Using / as root
>  installing bootstrap on /dev/rsd0c
>  using first-stage /usr/mdec/biosboot, second-stage /usr/mdec/boot
>  sd1: softraid volume with 1 disk(s)
>  sd1: installing boot loader on softraid volume
>  /usr/mdec/boot is 6 blocks x 16384 bytes
>  copying /usr/mdec/BOOTIA32.EFI to 
> /tmp/installboot.1lt1hgtQYa/efi/BOOT/BOOTIA32.EFI
>  copying /usr/mdec/BOOTIX64.EFI to 
> /tmp/installboot.1lt1hgtQYa/efi/BOOT/BOOTIX64.EFI
> 
> Rebooting, that also did not help.

That looks OK, though. Passing the softraid disk is correct.

> I tried with "fdisk -e sd1" and disabling the 1 (EFI) partition by setting 
> its type to 0 (so that installboot would not try to install any EFI files to 
> sd1i) and then doing "installboot sd1", and that did not help too.
> 
> What am I doing wrong, are there actually any installboot arguments that 
> could help me make it work?

It looks like you're using GPT on both the physical and the
softraid disk, correct?

In my setup, I have GPT on the physical disk (sd0) but an MBR
on the softraid volume. So perhaps try using an MBR on sd1 and
see if that helps?
I am poking in the dark here. No idea if that will work for you.



Re: Crypto softraid is supported on GPT/UEFI boot and not just on BIOS/MBR boot, right?

2017-09-27 Thread tinkr
> On Wed, Sep 27, 2017 at 10:31:22AM -, ti...@openmailbox.org wrote:
>>  probing: pc0 mem[572K 56K 495M 1455M 5M 6144M]
>>  disk: hd0* hd1* hd2 sr0*
>>  >> OpenBSD/amd64 BOOTX64 3.32
>>  open(hd0a:/etc/boot.conf): Invalid Argument
>>  boot>
>> 
>> 
>> This error may be because OpenBSD creating "boot.conf" within the FAT32 EFI 
>> system boot volume actually crates "bo~1.con", which is not resolved as 
>> "boot.conf" by OpenBSD's BOOTX64 EFI loader program? -
> 
> boot.conf has nothing to do with it.
> softraid boot is handled independently from boot.conf.
> 
>> How do I instruct BOOTX64 to boot from sr0a:/boot ?
> 
> What's odd is that you have a bootable sr0 but the boot loader still
> tries hd0 instead. That looks like a bug. Usually sr0 should be tried
> in this situation.
>  
> I don't know the solution. Perhaps try re-running installboot?
> 
> FWIW, this all works fine for me on a thinkpad helix2.

Hi Stefan,

I first tried booting the machine (by typing "boot sr0a:/bsd" in the boot 
console of course), and doing "installboot -v sd0". It says:

 Using / as root
 installing bootstrap on /dev/rsd0c
 using first-stage /usr/mdec/biosboot, second-stage /usr/mdec/boot
 copying /usr/mdec/BOOTIA32.EFI to 
/tmp/installboot.MjdT8BAY8o/efi/BOOT/BOOTIA32.EFI
 copying /usr/mdec/BOOTIX64.EFI to 
/tmp/installboot.MjdT8BAY8o/efi/BOOT/BOOTIX64.EFI


..and after rebooting the machine, booting was still not automatic.

I then booted the machine (by typing "boot sr0a:/bsd" in the boot console again 
of course) and did "installboot -v sd1", and it gave:

 Using / as root
 installing bootstrap on /dev/rsd0c
 using first-stage /usr/mdec/biosboot, second-stage /usr/mdec/boot
 sd1: softraid volume with 1 disk(s)
 sd1: installing boot loader on softraid volume
 /usr/mdec/boot is 6 blocks x 16384 bytes
 copying /usr/mdec/BOOTIA32.EFI to 
/tmp/installboot.1lt1hgtQYa/efi/BOOT/BOOTIA32.EFI
 copying /usr/mdec/BOOTIX64.EFI to 
/tmp/installboot.1lt1hgtQYa/efi/BOOT/BOOTIX64.EFI

Rebooting, that also did not help.

I tried with "fdisk -e sd1" and disabling the 1 (EFI) partition by setting its 
type to 0 (so that installboot would not try to install any EFI files to sd1i) 
and then doing "installboot sd1", and that did not help too.

What am I doing wrong, are there actually any installboot arguments that could 
help me make it work?


Would I need to add some debug output lines to installboot? Actually, it would 
be nice if installboot's verbose mode would clarify which configuration the 
boot code is actually set up with, so the user is a bit more saved from the 
wild-guessing-by-a-large-number-of-reboots-hoping-for-the-best kind of method 
I'm refered to right now. Please let me know what I should do now to fix it -

Thanks,
Tinker

Re: Crypto softraid is supported on GPT/UEFI boot and not just on BIOS/MBR boot, right?

2017-09-27 Thread Stefan Sperling
On Wed, Sep 27, 2017 at 10:31:22AM -, ti...@openmailbox.org wrote:
>  probing: pc0 mem[572K 56K 495M 1455M 5M 6144M]
>  disk: hd0* hd1* hd2 sr0*
>  >> OpenBSD/amd64 BOOTX64 3.32
>  open(hd0a:/etc/boot.conf): Invalid Argument
>  boot>
> 
> 
> This error may be because OpenBSD creating "boot.conf" within the FAT32 EFI 
> system boot volume actually crates "bo~1.con", which is not resolved as 
> "boot.conf" by OpenBSD's BOOTX64 EFI loader program? -

boot.conf has nothing to do with it.
softraid boot is handled independently from boot.conf.

> How do I instruct BOOTX64 to boot from sr0a:/boot ?

What's odd is that you have a bootable sr0 but the boot loader still
tries hd0 instead. That looks like a bug. Usually sr0 should be tried
in this situation.
 
I don't know the solution. Perhaps try re-running installboot?

FWIW, this all works fine for me on a thinkpad helix2.



Re: Crypto softraid is supported on GPT/UEFI boot and not just on BIOS/MBR boot, right?

2017-09-27 Thread tinkr
>> On Wed, Sep 27, 2017 at 08:06:15AM -, ti...@openmailbox.org wrote:
[..]
> How do I instruct BOOTX64 to boot from sr0a:/boot ?
(Sorry typo, this should read "How do I instruct BOOTX64 to boot from sr0a:/bsd 
?", however sr0a:/bsd was spelled correctly above so it was clear enough 
already.)

Re: Crypto softraid is supported on GPT/UEFI boot and not just on BIOS/MBR boot, right?

2017-09-27 Thread tinkr
> On Wed, Sep 27, 2017 at 08:06:15AM -, ti...@openmailbox.org wrote:
>> Hi!
>> 
>> Crypto softraid is supported on GPT/UEFI boot and not just on BIOS/MBR boot, 
>> right?
>> 
>> It's supposed to work exactly the same way, just out of the box, the boot 
>> code will ask for typed password or keydisk, right?
>> 
>> Thanks,
>> Tinker
> 
> http://www.openbsd.org/faq/faq14.html#softraid

Dear Stefan,

Thanks for responding - yes thanks for the obvious reference. For making GPT 
booting work at all with OpenBSD, the "-b 960" argument to "fdisk -ig" that's 
mentioned on the FAQ page, is instrumental, as "fdisk -ig" only creates a GPT 
partitioning table whereas booting requires an EFI system boot partition too, 
and fdisk creates that one only when "-b 960" is specified.


About automatic softraid unpacking on boot, the answer I found was that: Yes, 
it is supported, but I think the boot order when booting softraid crypto on 
GPT/UEFI is different from on MBR/boot.

I think on MBR/BIOS boot, the setup is that OpenBSD's MBR sector reads some 
reserved subsequent sectors, which contain the unpacking code which ask you for 
password/keydisk, and then unpacks the softraid, which will in turn contain the 
boot code, which reads boot.conf .

In GPT/UEFI boot, OpenBSD's boot sequence is different: The host system's UEFI 
firmware will load the /efi/boot/bootx64.efi file, which tries to load the 
boot.conf file and then boot the system.


Unfortunately, bootx.64.efi does not get the idea of trying to boot sr0a:/bsd , 
but just tries hd0a:/bsd and then fails.

I tried to feed it with a boot.conf file by doing mount /dev/sd0i /mnt; mkdir 
-p /mnt/etc; echo "boot sr0a:/bsd" >> /mnt/etc/boot.conf , however this has no 
effect on the boot process, it still says the same as when the file was not 
there:

 probing: pc0 mem[572K 56K 495M 1455M 5M 6144M]
 disk: hd0* hd1* hd2 sr0*
 >> OpenBSD/amd64 BOOTX64 3.32
 open(hd0a:/etc/boot.conf): Invalid Argument
 boot>


This error may be because OpenBSD creating "boot.conf" within the FAT32 EFI 
system boot volume actually crates "bo~1.con", which is not resolved as 
"boot.conf" by OpenBSD's BOOTX64 EFI loader program? -

How do I instruct BOOTX64 to boot from sr0a:/boot ?

Also is this in the manual yet, where?

Thanks!
Tinker

Re: Crypto softraid is supported on GPT/UEFI boot and not just on BIOS/MBR boot, right?

2017-09-27 Thread Stefan Sperling
On Wed, Sep 27, 2017 at 08:06:15AM -, ti...@openmailbox.org wrote:
> Hi!
> 
> Crypto softraid is supported on GPT/UEFI boot and not just on BIOS/MBR boot, 
> right?
> 
> It's supposed to work exactly the same way, just out of the box, the boot 
> code will ask for typed password or keydisk, right?
> 
> Thanks,
> Tinker

http://www.openbsd.org/faq/faq14.html#softraid



Crypto softraid is supported on GPT/UEFI boot and not just on BIOS/MBR boot, right?

2017-09-27 Thread tinkr
Hi!

Crypto softraid is supported on GPT/UEFI boot and not just on BIOS/MBR boot, 
right?

It's supposed to work exactly the same way, just out of the box, the boot code 
will ask for typed password or keydisk, right?

Thanks,
Tinker