From 4b592ec2a30d5cf79ee6ce6a47b4228cb4be2f18 Mon Sep 17 00:00:00 2001 From: Timofey Titovets Date: Thu, 9 Feb 2017 11:56:31 +0300 Subject: [PATCH] Check: if disk with UUID are btrfs by blkid Old check can't find btrfs fs, if fs not mounted Signed-off-by: Timofey Titovets --- scripts/beesd | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/beesd b/scripts/beesd index 6abffc4..cfe256c 100755 --- a/scripts/beesd +++ b/scripts/beesd @@ -52,16 +52,18 @@ DB_SIZE="${DB_SIZE:-$((64*AL16M))}" LOG_SHORT_PATH="${LOG_SHORT_PATH:-N}" LOG_FILTER_TIME="${LOG_FILTER_TIME:-N}" -INFO "Check: BTRFS UUID exists" -if [ ! -d "/sys/fs/btrfs/$UUID" ]; then - ERRO "Can't find BTRFS UUID: $UUID" -fi - INFO "Check: Disk exists" if [ ! -b "/dev/disk/by-uuid/$UUID" ]; then ERRO "Missing disk: /dev/disk/by-uuid/$UUID" fi +it_btrfs(){ [ "$(blkid -s TYPE -o value "$1")" == "btrfs" ]; } + +INFO "Check: Disk with btrfs" +if ! it_btrfs "/dev/disk/by-uuid/$UUID"; then + ERRO "Disk not contain btrfs: /dev/disk/by-uuid/$UUID" +fi + INFO "WORK DIR: $WORK_DIR" mkdir -p "$WORK_DIR" || exit 1