Page MenuHomeFreeBSD

loader: zfs reader should not probe partitionless disks
ClosedPublic

Authored by tsoome on Dec 14 2018, 4:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 24, 8:00 PM
Unknown Object (File)
Sat, Mar 16, 7:23 AM
Unknown Object (File)
Feb 4 2024, 12:18 AM
Unknown Object (File)
Jan 30 2024, 9:43 PM
Unknown Object (File)
Jan 22 2024, 11:38 PM
Unknown Object (File)
Jan 14 2024, 8:34 PM
Unknown Object (File)
Dec 24 2023, 12:35 PM
Unknown Object (File)
Dec 24 2023, 12:35 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 - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Dec 14 2018, 5:01 PM
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.

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.