Project

General

Profile

Actions

Bug #12006

closed

libzfs: replace EFI_MIN_RESV_SIZE by efi_reserved_sectors()

Added by Toomas Soome over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

Replace build time value with one calculated based on disk sector size.

Testing done:

# zpool create -f tank_4kn c0t600144F07A6B316A00005DDE63B30001d0

format> ver

Volume name = <        >
ascii name  = <SUN-COMSTAR-1.0-10.00GB>
bytes/sector    =  4096
sectors = 2621440
accessible sectors = 2619381
first usable sector = 6
last usable sector = 2621434
Part      Tag    Flag     First Sector       Size       Last Sector
  0        usr    wm              2048      9.98GB        2619386    
  1 unassigned    wm                 0         0             0    
  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           2619387      8.00MB        2621434    

format> 

# zpool create -B tank_4kn c0t600144F07A6B316A00005DDE63B30001d0

format> ver

Volume name = <        >
ascii name  = <SUN-COMSTAR-1.0-10.00GB>
bytes/sector    =  4096
sectors = 2621440
accessible sectors = 2619381
first usable sector = 6
last usable sector = 2621434
Part      Tag    Flag     First Sector       Size       Last Sector
  0     system    wm              2048    256.00MB        67583    
  1        usr    wm             67584      9.73GB        2619386    
  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           2619387      8.00MB        2621434    

format> 

# zpool create -B tank_512B c0t600144F07A6B316A00005DDE63C80002d0

Volume name = <        >
ascii name  = <SUN-COMSTAR-1.0-15.00GB>
bytes/sector    =  512
sectors = 31457280
accessible sectors = 31440829
first usable sector = 34
last usable sector = 31457246
Part      Tag    Flag     First Sector        Size        Last Sector
  0     system    wm              2048     256.00MB         526335    
  1        usr    wm            526336      14.74GB         31440862    
  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          31440863       8.00MB         31457246    

format>

# zpool create tank_512B c0t600144F07A6B316A00005DDE63C80002d0

Volume name = <        >
ascii name  = <SUN-COMSTAR-1.0-15.00GB>
bytes/sector    =  512
sectors = 31457280
accessible sectors = 31440829
first usable sector = 34
last usable sector = 31457246
Part      Tag    Flag     First Sector        Size        Last Sector
  0        usr    wm              2048      14.99GB         31440862    
  1 unassigned    wm                 0          0              0    
  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          31440863       8.00MB         31457246    

format>

Before patch, the zpool create does create reserved partition as:

format> ver

Volume name = <        >
ascii name  = <SUN-COMSTAR-1.0-10.00GB>
bytes/sector    =  4096
sectors = 2621440
accessible sectors = 2619381
first usable sector = 6
last usable sector = 2621434
Part      Tag    Flag     First Sector       Size       Last Sector
  0        usr    wm               256      9.94GB        2605050    
  1 unassigned    wm                 0         0             0    
  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           2605051     64.00MB        2621434    

format> 

Actions #1

Updated by Toomas Soome over 3 years ago

  • Description updated (diff)
Actions #2

Updated by Toomas Soome over 3 years ago

  • Description updated (diff)
Actions #3

Updated by Electric Monk over 3 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 2dd124cd38fa5e2da4e66c28cc8d9bafd41a6cb0

commit  2dd124cd38fa5e2da4e66c28cc8d9bafd41a6cb0
Author: Toomas Soome <tsoome@me.com>
Date:   2019-12-10T21:28:38.000Z

    12006 libzfs: replace EFI_MIN_RESV_SIZE by efi_reserved_sectors()
    Reviewed by: John Levon <john.levon@joyent.com>
    Reviewed by: Robert Mustacchi <rm@fingolfin.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF