From 56e438869ce0bda7edf49eaae2767f684778c037 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 23 May 2013 13:20:56 -0400 Subject: [PATCH] genfstab: prefer lsblk over blkid lsblk has a far nicer interface and is capable of doing its work without the need for extra privileges to read superblocks (assuming udev is behaving properly). --- genfstab.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/genfstab.in b/genfstab.in index 88dc6f4..447a3fa 100644 --- a/genfstab.in +++ b/genfstab.in @@ -7,8 +7,8 @@ m4_include(common) write_source() { local src=$1 spec= label= uuid= comment=() - label=$(blkid -s LABEL -o value "$1" 2>/dev/null) - uuid=$(blkid -s UUID -o value "$1" 2>/dev/null) + label=$(lsblk -rno LABEL "$1" 2>/dev/null) + uuid=$(lsblk -rno UUID "$1" 2>/dev/null) # bind mounts do not have a UUID! @@ -29,7 +29,7 @@ write_source() { *) [[ $uuid ]] && comment=("$1" "UUID=$uuid") [[ $label ]] && comment+=("LABEL=$label") - [[ $bytag ]] && spec=$(blkid -s "$bytag" -o value "$1") + [[ $bytag ]] && spec=$(lsblk -rno "$bytag" "$1" 2>/dev/null) ;; esac