mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
Use -F to export pools so as not to dirty up device labels
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Manuel Amador (Rudd-O) <rudd-o@rudd-o.com> Closes #5228 Closes #5238
This commit is contained in:
parent
dabb6f4fab
commit
7e8a2d0b75
@ -4,18 +4,19 @@
|
|||||||
|
|
||||||
_do_zpool_export() {
|
_do_zpool_export() {
|
||||||
local ret=0
|
local ret=0
|
||||||
|
local errs=""
|
||||||
local final="${1}"
|
local final="${1}"
|
||||||
local opts=""
|
|
||||||
|
|
||||||
if [ "x${final}" != "x" ]; then
|
info "ZFS: Exporting ZFS storage pools..."
|
||||||
opts="-f"
|
errs=$(export_all -F 2>&1)
|
||||||
|
ret=$?
|
||||||
|
[ -z "${errs}" ] || echo "${errs}" | vwarn
|
||||||
|
if [ "x${ret}" != "x0" ]; then
|
||||||
|
info "ZFS: There was a problem exporting pools."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
info "Exporting ZFS storage pools."
|
|
||||||
export_all ${opts} || ret=$?
|
|
||||||
|
|
||||||
if [ "x${final}" != "x" ]; then
|
if [ "x${final}" != "x" ]; then
|
||||||
info "zpool list"
|
info "ZFS: pool list"
|
||||||
zpool list 2>&1 | vinfo
|
zpool list 2>&1 | vinfo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ install() {
|
|||||||
inst_script "${moddir}/zfs-generator.sh" "$systemdutildir"/system-generators/dracut-zfs-generator
|
inst_script "${moddir}/zfs-generator.sh" "$systemdutildir"/system-generators/dracut-zfs-generator
|
||||||
fi
|
fi
|
||||||
inst_hook mount 98 "${moddir}/mount-zfs.sh"
|
inst_hook mount 98 "${moddir}/mount-zfs.sh"
|
||||||
inst_hook shutdown 30 "${moddir}/export-zfs.sh"
|
inst_hook shutdown 20 "${moddir}/export-zfs.sh"
|
||||||
|
|
||||||
inst_simple "${moddir}/zfs-lib.sh" "/lib/dracut-zfs-lib.sh"
|
inst_simple "${moddir}/zfs-lib.sh" "/lib/dracut-zfs-lib.sh"
|
||||||
if [ -e @sysconfdir@/zfs/zpool.cache ]; then
|
if [ -e @sysconfdir@/zfs/zpool.cache ]; then
|
||||||
|
@ -44,7 +44,7 @@ if [ "${root}" = "zfs:AUTO" ] ; then
|
|||||||
ZFS_DATASET="$(find_bootfs)"
|
ZFS_DATASET="$(find_bootfs)"
|
||||||
if [ $? -ne 0 ] ; then
|
if [ $? -ne 0 ] ; then
|
||||||
warn "ZFS: No bootfs attribute found in importable pools."
|
warn "ZFS: No bootfs attribute found in importable pools."
|
||||||
export_all || export_all "-f"
|
export_all -F
|
||||||
|
|
||||||
rootok=0
|
rootok=0
|
||||||
return 1
|
return 1
|
||||||
|
@ -90,7 +90,7 @@ mount_dataset() {
|
|||||||
# export_all OPTS
|
# export_all OPTS
|
||||||
# exports all imported zfs pools.
|
# exports all imported zfs pools.
|
||||||
export_all() {
|
export_all() {
|
||||||
local opts="${1}"
|
local opts="${@}"
|
||||||
local ret=0
|
local ret=0
|
||||||
|
|
||||||
IFS="${NEWLINE}"
|
IFS="${NEWLINE}"
|
||||||
|
Loading…
Reference in New Issue
Block a user