Currently _fs_sysfs_dname gets fsid from the findmnt command however
this command provides the metadata_uuid if the device is mounted with
temp-fsid. So instead, use btrfs filesystem show command to know the fsid.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
_fs_sysfs_dname()
{
local dev=$1
+ local fsid
if [ ! -b "$dev" ]; then
_fail "Usage: _fs_sysfs_dname <mounted_device>"
case "$FSTYP" in
btrfs)
- findmnt -n -o UUID ${dev} ;;
+ fsid=$($BTRFS_UTIL_PROG filesystem show ${dev} | grep uuid: | \
+ $AWK_PROG '{print $NF}')
+ echo $fsid ;;
*)
_short_dev $dev ;;
esac