mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 18:59:33 +03:00
07a3312f17
Make use of Dracut's ability to restore the initramfs on shutdown and pivot to it, allowing for a clean unmount and export of the ZFS root. No need to force-import on every reboot anymore. Signed-off-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue #2195 Issue #2476 Issue #2498 Issue #2556 Issue #2563 Issue #2575 Issue #2600 Issue #2755 Issue #2766
30 lines
413 B
Bash
Executable File
30 lines
413 B
Bash
Executable File
#!/bin/sh
|
|
|
|
_do_zpool_export() {
|
|
local ret=0
|
|
local final=$1
|
|
local force
|
|
|
|
if [ "x$final" != "x" ]; then
|
|
force="-f"
|
|
fi
|
|
|
|
info "Exporting ZFS storage pools"
|
|
zpool list -H | while read fs rest ; do
|
|
zpool export $force "$fs" || ret=$?
|
|
done
|
|
|
|
if [ "x$final" != "x" ]; then
|
|
info "zpool list"
|
|
zpool list 2>&1 | vinfo
|
|
fi
|
|
|
|
return $ret
|
|
}
|
|
|
|
if command -v zpool >/dev/null; then
|
|
_do_zpool_export $1
|
|
else
|
|
:
|
|
fi
|