[oi-dev] Obstacle to GPT label boot?

Toomas Soome tsoome at me.com
Fri Mar 19 07:34:01 UTC 2021



> On 19. Mar 2021, at 09:04, Marcel Telka <marcel at telka.sk> wrote:
> 
> On Fri, Mar 19, 2021 at 08:17:44AM +0200, Toomas Soome via oi-dev wrote:
>> root at beastie:/code/illumos-gate# zpool status rpool
>>  pool: rpool
>> state: ONLINE
>>  scan: resilvered 1,68T in 0 days 10:10:07 with 0 errors on Fri Oct 25 05:05:34 2019
>> config:
>> 
>>        NAME        STATE     READ WRITE CKSUM
>>        rpool       ONLINE       0     0     0
>>          raidz1-0  ONLINE       0     0     0
>>            c3t0d0  ONLINE       0     0     0
>>            c3t1d0  ONLINE       0     0     0
>>            c3t3d0  ONLINE       0     0     0
>>            c3t4d0  ONLINE       0     0     0
>> 
>> errors: No known data errors
> 
> What is the slice layout at those disks?  Is it one small EFI boot slice
> (pcfs) + one big slice covering the rest of the disk and used for rpool?
> If I'm not mistaken this is the default layout created by the OI
> installer when installed on GPT/EFI disk (without MBR).
> 
> Is there a way to install OI on a GPT disk in a slice not covering the
> whole disk?
> 


Part      Tag    Flag     First Sector          Size          Last Sector
  0     system    wm               256       256.00MB           524543    
  1        usr    wm            524544         3.64TB           7814020750    
  2 unassigned    wm                 0            0                0    
  3 unassigned    wm                 0            0                0    
  4 unassigned    wm                 0            0                0    
  5 unassigned    wm                 0            0                0    
  6 unassigned    wm                 0            0                0    
  8   reserved    wm        7814020751         8.00MB           7814037134    

format> 

This is the default layout generated with zpool create -B rpool raidz c3t0d0 c3t1d0 c3t3d0 c3t4d0

Technically *every* GPT partitioned disk does have MBR, but it is called protective MBR (PMBR).

This can be checked with fdisk, but here is alternate way:

root at beastie:/home/tsoome# mdb /dev/rdsk/c3t0d0
> ::load disk_label
> ::mbr
Format: loader (illumos)
Signature: 0xaa55 (valid)
UniqueMBRDiskSignature: 0
Loader STAGE1_STAGE2_LBA: 524544
Loader STAGE1_STAGE2_SIZE: 1
Loader STAGE1_STAGE2_UUID: 7f0a04f2-6a11-e6b8-b0ae-dc14a75a96fc

STAGE1 in VBR:
Format: loader (illumos)
Signature: 0xaa55 (valid)
UniqueMBRDiskSignature: 0
Loader STAGE1_STAGE2_LBA: 525568
Loader STAGE1_STAGE2_SIZE: 328
Loader STAGE1_STAGE2_UUID: 7f0a04f2-6a11-e6b8-b0ae-dc14a75a96fc

PART TYPE                  ACTIVE  STARTCHS    ENDCHS      SECTOR     NUMSECT  
0    EFI_PMBR:0xee         0       1023/255/63 1023/255/63 1          4294967295
1    UNUSED:0
2    UNUSED:0
3    UNUSED:0
> ::gpt
Signature: EFI PART (valid)
Revision: 1.0
HeaderSize: 512 bytes
HeaderCRC32: 0x375ff497 (should be 0x375ff497)
Reserved1: 0 (should be 0x0)
MyLBA: 1 (should be 1)
AlternateLBA: 7814037167
FirstUsableLBA: 34
LastUsableLBA: 7814037134
DiskGUID: c350e9d4-baee-63db-f81f-f702e840eb5f
PartitionEntryLBA: 2
NumberOfPartitionEntries: 9
SizeOfPartitionEntry: 0x80 bytes
PartitionEntryArrayCRC32: 0xf2fd883d (should be 0xf2fd883d)

PART TYPE                STARTLBA      ENDLBA        ATTR     NAME
0    EFI_SYSTEM          256           524543        0        loader
1    EFI_USR             524544        7814020750    0        zfs
2    EFI_UNUSED         
3    EFI_UNUSED         
4    EFI_UNUSED         
5    EFI_UNUSED         
6    EFI_UNUSED         
7    EFI_UNUSED         
8    EFI_RESERVED        7814020751    7814037134    0        
> ::quit

root at beastie:/home/tsoome# 

To install on slice, you would need to select GPT partitioning and *not* select whole disk setup. However, I have not used OI installer for a long time, therefore I can not recall what exactly are on those screens:D Also it is very likely, some improvements can be made there (like for >2TB disks we should only offer GPT).


 

>> I can tell, this system does boot just fine with both UEFI and BIOS firmware.
> 
> Legacy BIOS?  Is your system really able to boot in legacy BIOS mode
> with the rpool as outlined above?
> 

Yes, this BIOS does see all 4 disks, therefore I can boot from this rpool. We have been able to do this since loader was integrated.. hm, log is telling…

Author: Toomas Soome <tsoome at me.com>
Date:   Sun Oct 25 00:06:51 2015 +0300

    5061 freebsd boot loader integration (loader project)
    Reviewed by: Richard Lowe <richlowe at richlowe.net>
    Reviewed by: Cody Mello <melloc at joyent.com>
    Approved by: Robert Mustacchi <rm at joyent.com>


5 years ago.. time flies...

rgds,
toomas


More information about the oi-dev mailing list