various minor improvements
[distro-setup] / check-subvol-stale
index 1451844f7c89298d2a9e100eeabba7f837874d24..f278188fa63c6e58b00a76f66b20b971f15873fc 100644 (file)
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
+# usage: $0 SUBVOL_MOUNTPOINT...
 # if latest subvols $@ are not mounted, exit 1, print message, and touch /nocow/btrfs-stale/$subvol
 
 [[ $EUID == 0 ]] || exec sudo -E "$BASH_SOURCE" "$@"
@@ -50,7 +50,7 @@ for d; do
         continue
     fi
     stale=true
-    if btrfs sub show $d|sed '0,/^\t*Snapshot(s):/d;s/^\s*//' | \
+    if btrfs sub show $d 2>/dev/null | sed '0,/^\t*Snapshot(s):/d;s/^\s*//' | \
             grep -xF btrbk/$last_snap &>/dev/null; then
         stale=false
     else