summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2021-03-24 16:26:17 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2021-03-24 16:37:09 +0100
commit28865f971e0b23f4d1a4117e0e0fdb61bd21d836 (patch)
tree203f2a3d1d82265e611e0ee80474159642e63045
parent63c58d2a5d935cd78c77f3db13a655e68fb36367 (diff)
downloadlvm2-28865f971e0b23f4d1a4117e0e0fdb61bd21d836.tar.gz
fsadm: handle error from blkid
Fsadm wants to print its own error message when it can't detect type of the filesystem on a block device. Otherwise fsadm exits with no message on an unused block device.
-rwxr-xr-xscripts/fsadm.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index 20ae57462..3e1f3d405 100755
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -230,7 +230,7 @@ detect_fs() {
esac
# use null device as cache file to be sure about the result
# not using option '-o value' to be compatible with older version of blkid
- FSTYPE=$("$BLKID" -c "$NULL" -s TYPE "$VOLUME")
+ FSTYPE=$("$BLKID" -c "$NULL" -s TYPE "$VOLUME" || true)
test -n "$FSTYPE" || error "Cannot get FSTYPE of \"$VOLUME\"."
FSTYPE=${FSTYPE##*TYPE=\"} # cut quotation marks
FSTYPE=${FSTYPE%%\"*}