mirror_zfs/contrib/dracut/90zfs/export-zfs.sh.in
наб 6a41310c70 contrib/dracut: zfs-lib: export_all: replace with inline zpool export -a
07a3312f17, which introduced this in
October of 2014, didn't have zpool export -a available; we do

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13093
2022-03-03 10:45:24 -08:00

23 lines
384 B
Bash
Executable File

#!/bin/sh
_do_zpool_export() {
info "ZFS: Exporting ZFS storage pools..."
errs=$(zpool export -aF 2>&1)
ret=$?
echo "${errs}" | vwarn
if [ "${ret}" -ne 0 ]; then
info "ZFS: There was a problem exporting pools."
fi
if [ -n "$1" ]; then
info "ZFS: pool list"
zpool list 2>&1 | vinfo
fi
return "$ret"
}
if command -v zpool >/dev/null; then
_do_zpool_export "${1}"
fi