Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Native ZFS for Linux
C Shell Other
branch: master

This branch is even with zfsonlinux:master

Base init scripts for SYSV systems

* Based on the init scripts included with Debian GNU/Linux, then take code
  from the already existing ones, trying to merge them into one set of
  scripts that will work for 'everyone' for better maintainability.
  * Add configurable variables to control the workings of the init scripts:
      Set a sleep time before we load the module (used primarily by initrd
      scripts to allow for slower media (such as  USB devices etc) to be
      availible before we load the zfs module).
      Set a timed sleep in the initrd to after the load of the zfs module.
      To allow for mounting additional datasets in the initrd. Primarily used
      in initrd scripts to allow for when filesystem needed to boot (such as
      /usr, /opt, /var etc) isn't directly under the root dataset.
      Exclude pools from being imported (in the initrd and/or init scripts).
      Set to control how dkms should build the dkms packages.
      Set path(s) where "zpool import" should import pools from.
      This was previously the job of "USE_DISK_BY_ID" (which is still used
      for backwards compatibility) but was renamed to allow for better
      control of import path(s).
      * If old USE_DISK_BY_ID is set, but not new ZPOOL_IMPORT_PATH, then we
        set ZPOOL_IMPORT_PATH to sane defaults just to be on the safe side.
    * ZED_ARGS
      To allow for local options to zed without having to change the init script.
  * The import function, do_import(), imports pools by name instead of '-a'
    for better control of pools to import and from where.
    * If USE_DISK_BY_ID is set (for backwards compatibility), but isn't 'yes'
      then ignore it.
    * If pool(s) isn't found with a simple "zpool import" (seen it happen),
      try looking for them in /dev/disk/by-id (if it exists). Any duplicates
      (pools found with both commands) is filtered out.
      * IF we have found extra pool(s) this way, we must force USE_DISK_BY_ID
        so that the first, simple "zpool import $pool" is able to find it.
    * Fallback on importing the pool using the cache file (if it exists) only
      if 'simple' import (either with ZPOOL_IMPORT_PATH or the 'built in'
      defaults) didn't work.
  * The export function, do_export(), will export all pools imported, EXCEPT
    the root pool (if there is one).
  * ZED script from the Debian GNU/Linux packages added.
    * Refreshed ZED init script from behlendorf@5e7a660 to be portable so it
      may be used on both LSB and Redhat style systems.
    * If there is no pool(s) imported and zed successfully shut down, we will
      unload the zfs modules.
  * The function library file for the ZoL init script is installed as
  * The four init scripts, the /etc/{defaults,sysconfig,conf.d}/zfs config file
    as well as the common function library is tagged as '%config(noreplace)' in
    the rpm rules file to make sure they are not replaced automatically if locally
  * Pitfals and workarounds:
    * If we're running from init, remove stale /etc/dfs/sharetab before importing
      pools in the zfs-import init script.
    * On Debian GNU/Linux, there's a 'sendsigs' script that will kill basically
      everything quite early in the shutdown phase and zed is/should be stopped
      much later than that. We don't want zed to be among the ones killed, so add
      the zed pid to list of pids for 'sendsigs' to ignore.
    * CentOS uses echo_success() and echo_failure() to print out status of
      command. These in turn uses "echo -n \0xx[etc]" to move cursor and choose
      colour etc. This doesn't work with the modified IFS variable we need to
      use in zfs-import for some reason, so work around that when we define
      zfs_log_{end,failure}_msg() for RedHat and derivative distributions.
  * All scripts passes ShellCheck (with one false positive in do_mount()).

Signed-off-by: Turbo Fredriksson
Signed-off-by: Brian Behlendorf <>
Reviewed by: Richard Yao <>
Reviewed by: Chris Dunlap <>
Closes #2974
Closes #2107
latest commit 2a34db1bdb
@FransUrbo FransUrbo authored committed
Failed to load latest commit information.
cmd Add libzfs_error_init() function
config Base init scripts for SYSV systems
contrib Add bash completions by Aneurin Price.
dracut Execute udevadm settle before trying to import pools
etc Base init scripts for SYSV systems
include Add libzfs_error_init() function
lib Add libzfs_error_init() function
man Zdb should be able to open the root dataset
module Illumos 5243 - zdb -b could be much faster
rpm Base init scripts for SYSV systems
scripts Set zfs_autoimport_disable default value to 1
udev Open pools asynchronously after module load
.gitignore Ignore *.{deb,rpm,tar.gz} files in the top directory.
.gitmodules Add compatibility test script
AUTHORS Add a missing > to AUTHORS
COPYRIGHT Update ZED copyright boilerplate
DISCLAIMER Fix minor typos and update marketing copy.
META Tag zfs-0.6.4 Style check shell scripts
README.markdown Fix minor typos and update marketing copy. build: do not call boilerplate ourself Add RHEL style kmod packages
copy-builtin Consistent menuconfig name Initial implementation of zed (ZFS Event Daemon) Move zfs.release generation to configure step


Native ZFS for Linux!

ZFS is an advanced file system and volume manager which was originally developed for Solaris and is now maintained by the Illumos community.

ZFS on Linux, which is also known as ZoL, is currently feature complete. It includes fully functional and stable SPA, DMU, ZVOL, and ZPL layers.

Full documentation for installing ZoL on your favorite Linux distribution can be found at:

Something went wrong with that request. Please try again.