|
|
f065e8 |
From d9b46474fc19d9c57e2cfb752d60319017da8410 Mon Sep 17 00:00:00 2001
|
|
|
f065e8 |
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
|
|
|
f065e8 |
Date: Wed, 6 Apr 2022 14:14:19 +0200
|
|
|
f065e8 |
Subject: [PATCH] Filesystem: improve logic for UUID/label and add note that
|
|
|
f065e8 |
/dev/disk/by-{uuid,label}/ are preferred on Linux
|
|
|
f065e8 |
|
|
|
f065e8 |
---
|
|
|
f065e8 |
heartbeat/Filesystem | 8 +++++---
|
|
|
f065e8 |
1 file changed, 5 insertions(+), 3 deletions(-)
|
|
|
f065e8 |
|
|
|
f065e8 |
diff --git a/heartbeat/Filesystem b/heartbeat/Filesystem
|
|
|
f065e8 |
index 72a1b8623..44270ad98 100755
|
|
|
f065e8 |
--- a/heartbeat/Filesystem
|
|
|
f065e8 |
+++ b/heartbeat/Filesystem
|
|
|
f065e8 |
@@ -163,6 +163,8 @@ directory where the status file is to be placed.
|
|
|
f065e8 |
<parameter name="device" required="1">
|
|
|
f065e8 |
<longdesc lang="en">
|
|
|
f065e8 |
The name of block device for the filesystem, or -U, -L options for mount, or NFS mount specification.
|
|
|
f065e8 |
+
|
|
|
f065e8 |
+NOTE: On Linux /dev/disk/by-{uuid,label}/ are preferred to -U/-L.
|
|
|
f065e8 |
</longdesc>
|
|
|
f065e8 |
<shortdesc lang="en">block device</shortdesc>
|
|
|
f065e8 |
<content type="string" default="${OCF_RESKEY_device_default}" />
|
|
|
f065e8 |
@@ -902,11 +904,11 @@ set_blockdevice_var() {
|
|
|
f065e8 |
fi
|
|
|
f065e8 |
|
|
|
f065e8 |
case "$DEVICE" in
|
|
|
f065e8 |
- --*) # Typically --uuid or --label
|
|
|
f065e8 |
- device_opt=$(echo $DEVICE | sed -E "s/([[:blank:]]|=).*//")
|
|
|
f065e8 |
+ --uuid=*|--uuid\ *|--label=*|--label\ *)
|
|
|
f065e8 |
+ device_opt=$(echo $DEVICE | sed "s/\([[:blank:]]\|=\).*//")
|
|
|
f065e8 |
DEVICE=$(echo $DEVICE | sed -E "s/$device_opt([[:blank:]]*|=)//")
|
|
|
f065e8 |
;;
|
|
|
f065e8 |
- -*) # Oh... An option to mount instead... Typically -U or -L
|
|
|
f065e8 |
+ -U*|-L*) # short versions of --uuid/--label
|
|
|
f065e8 |
device_opt=$(echo $DEVICE | cut -c1-2)
|
|
|
f065e8 |
DEVICE=$(echo $DEVICE | sed "s/$device_opt[[:blank:]]*//")
|
|
|
f065e8 |
;;
|