From 652fcdbe44c14e909f9c620792a504d1e0e2912c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20S?= Date: Fri, 26 Jun 2020 15:49:30 +0900 Subject: [PATCH] IS_DUPLICATE_FS_LABEL: blkid has a cache that can provoke false positive Disable the cache by using `-c /dev/null`. Example of false positive: ``` /dev/mapper/HDD0-swap2: LABEL="SWAP2" UUID="5540a49e-3e7b-4528-9c4e-49fb5f8d7f3d" TYPE="swap" /dev/dm-0: LABEL="SWAP2" UUID="5540a49e-3e7b-4528-9c4e-49fb5f8d7f3d" TYPE="swap" ``` `dm-0` may have been cached during boot time, if you don't use a cache, it doesn't appear any more. --- evocheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evocheck.sh b/evocheck.sh index c94ee1a..e8b88fd 100755 --- a/evocheck.sh +++ b/evocheck.sh @@ -1013,7 +1013,7 @@ check_duplicate_fs_label() { BLKID_BIN=$(command -v blkid) if [ -x "$BLKID_BIN" ]; then tmpFile=$(mktemp -p /tmp) - parts=$($BLKID_BIN | grep -ve raid_member -e EFI_SYSPART | grep -Eo ' LABEL=".*"' | cut -d'"' -f2) + parts=$($BLKID_BIN -c /dev/null | grep -ve raid_member -e EFI_SYSPART | grep -Eo ' LABEL=".*"' | cut -d'"' -f2) for part in $parts; do echo "$part" >> "$tmpFile" done