Skip to content

Commit 1c64dc7

Browse files
committed
fix: Mirrored boot pool remains degraded after member recovers for cache pool
1 parent 375a4cd commit 1c64dc7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ungrub/mkbootable

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ add_device() {
155155

156156
remove_device() {
157157
if [[ "$DEV" = "missing" ]]; then
158-
TARGET=$(zpool status -P "$POOL" | awk '/was \/dev/ {print $1; exit}')
158+
TARGET="$(zpool status -P "$pool" | awk '/^\t / && ($2 == "OFFLINE" || $2 == "REMOVED" || $2 == "UNAVAIL") { print $1; exit }')"
159159
zpool detach "$POOL" "$TARGET"
160160
else
161161
zpool detach "$POOL" "$BOOT_PART"

0 commit comments

Comments
 (0)