-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Amend Dracut module to export ZFS root on shutdown
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
- Loading branch information
1 parent
8ac9b5e
commit 07a3312
Showing
6 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export-zfs.sh | ||
module-setup.sh | ||
mount-zfs.sh | ||
parse-zfs.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
07a3312
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the suggestion "No need to force-import on every reboot anymore." specious, since a crashed machine will still require a forced import.
07a3312
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Rudd-O Yes, this doesn't completely address that issue, but along with d94fd5f which is now in master forcing the import should no longer be required. Although, it would be nice to get some independent confirmation of that.