Page MenuHomeFreeBSD

loader: zfs reader should not probe partitionless disks
ClosedPublic

Authored by tsoome on Dec 14 2018, 4:55 PM.

Details

Summary

First of all, normal setups can not boot such pools as the tools
do not support installing boot programs.

Secondly, for proper pool configuration detection, we need to checks all
four label copies on disk, 2 from front and 2 from the end of the disk,
but zfs label does not contain the size of the disk - so we depend on
firmware to report the correct disk size or use information from the
partition table.

Without partition table, we only can rely on firmware to report and support
disk IO properly.

There is a specific case: 8TB disks are reported by BIOS to have 4294967295
sectors (0x00000000ffffffff), the sectors reported by OS is 15628053168
(0x00000003a3812ab0), so the reported size is less than actual but is hitting
32-bit max. Unfortuantely the real limit must be even lower because probing
this disk in this system will wnd up with hung system.

UEFI boot of this system seems not to be affected.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

tsoome created this revision.Dec 14 2018, 4:55 PM
This revision is now accepted and ready to land.Dec 14 2018, 5:01 PM
tsoome updated this revision to Diff 52008.Dec 14 2018, 5:59 PM

Small comment rerwrite

This revision now requires review to proceed.Dec 14 2018, 5:59 PM
This revision was not accepted when it landed; it landed in state Needs Review.Dec 16 2018, 8:58 AM
This revision was automatically updated to reflect the committed changes.

This broke boot on my laptop.
Single SATA SSD. UEFI boot.
loader.efi does not find my ZFS pool, which is on GPT partition 3.

=>       40  250069600  ada0  GPT  (119G)
         40       1024     1  freebsd-boot  (512K)
       1064     131072     2  efi  (64M)
     132136        984        - free -  (492K)
     133120  249935872     3  freebsd-zfs  (119G)
  250068992        648        - free -  (324K)

This broke boot on my laptop.
Single SATA SSD. UEFI boot.
loader.efi does not find my ZFS pool, which is on GPT partition 3.

=>       40  250069600  ada0  GPT  (119G)
         40       1024     1  freebsd-boot  (512K)
       1064     131072     2  efi  (64M)
     132136        984        - free -  (492K)
     133120  249935872     3  freebsd-zfs  (119G)
  250068992        648        - free -  (324K)

Ah, right, indeed. Looking for fix asap.

tsoome updated this revision to Diff 52090.Dec 17 2018, 7:14 AM

Since UEFI does probe zfs only by calling zfs probe with partition and not
with whole disk, we need zfs probe to check this case.

I also think we actually should remove all partitioning code from zfs_probe_dev
and to perform partition iteration outside it, but that will be for future
changes.

This revision was not accepted when it landed; it landed in state Needs Review.Dec 17 2018, 7:43 AM
This revision was automatically updated to reflect the committed changes.