OS-8416: piadm(8) needs to unmount/not-unmount v1 USB key properly


Issue Type:Bug
Priority:5 - Low
Created at:2022-10-11T15:27:19.937Z
Updated at:2022-10-12T14:50:16.401Z


Created by:Dan McDonald
Reported by:Dan McDonald

Fix Versions

2022-10-20 Clicker (Release Date: 2022-10-20)

Related Links


Customer found out the hard way that we have an unimplemented function call in the corner-case of piadm(8) on a Triton Head Node exiting on a v1 (GRUB) USB key. It invokes a function that turned out not to be needed as it should’ve been an if-check.

diff --git a/src/piadm.sh b/src/piadm.sh
index e1c88ad9..0410eba1 100644
--- a/src/piadm.sh
+++ b/src/piadm.sh
@@ -1219,7 +1219,9 @@ bringup_HN() {
        version=$(sdc-usbkey status -j | json version)
        if [[ "$version" != "2" ]]; then
                # Unmount on version-mismatch...
-               usb_unmount_unless_already
+               if [[ "$stick_premounted" != "yes" ]]; then
+                       sdc-usbkey unmount
+               fi
                err "USB key must be Version 2 (loader) to install on a pool."


Comment by Dan McDonald
Created at 2022-10-11T15:41:02.101Z

Don’t have a v1 USB key readily available to test, but the replacement code is literally executed line-for-line at the bottom of bringup_HN().