Project

General

Profile

Actions

Feature #13025

closed

Port OpenZFS: Add support for boot environment data to be stored in the label

Added by Toomas Soome over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
zfs - Zettabyte File System
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

OpenZFS commit: https://github.com/openzfs/zfs/commit/108a454a4604df6ea3be817f3cf076726df2c67a

Modern bootloaders leverage data stored in the root filesystem to
enable some of their powerful features. GRUB specifically has a grubenv
file which can store large amounts of configuration data that can be
read and written at boot time and during normal operation. This allows
sysadmins to configure useful features like automated failover after
failed boot attempts. Unfortunately, due to the Copy-on-Write nature
of ZFS, the standard behavior of these tools cannot handle writing to
ZFS files safely at boot time. We need an alternative way to store
data that allows the bootloader to make changes to the data.

This work is very similar to work that was done on Illumos to enable
similar functionality in the FreeBSD bootloader. This patch is different
in that the data being stored is a raw grubenv file; this file can store
arbitrary variables and values, and the scripting provided by grub is
powerful enough that special structures are not required to implement
advanced behavior.

We repurpose the second padding area in each label to store the grubenv
file, protected by an embedded checksum. We add two ioctls to get and
set this data, and libzfs_core and libzfs functions to access them more
easily. There are no direct command line interfaces to these functions;
these will be added directly to the bootloader utilities.

Reviewed-by: Pavel Zakharov <>
Reviewed-by: Matthew Ahrens <>
Reviewed-by: Brian Behlendorf <>
Signed-off-by: Paul Dagnelie <>
Closes #10009

Actions #1

Updated by Electric Monk over 1 year ago

  • Gerrit CR set to 837
Actions #2

Updated by Electric Monk about 1 year ago

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

git commit c4ecba8aa5f13f00c2439c06af2aa1198771ee66

commit  c4ecba8aa5f13f00c2439c06af2aa1198771ee66
Author: Paul Dagnelie <pcd@delphix.com>
Date:   2020-11-13T17:03:14.000Z

    13025 Port OpenZFS: Add support for boot environment data to be stored in the label
    Reviewed-by: Pavel Zakharov <pavel.zakharov@delphix.com>
    Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Toomas Soome <tsoome@me.com>
    Reviewed by: C Fraire <cfraire@me.com>
    Reviewed by: Andy Fiddaman <andy@omniosce.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF