mirror of
				https://github.com/Zygo/bees.git
				synced 2025-10-31 02:00:34 +01:00 
			
		
		
		
	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 <nefelim4ag@gmail.com>
This commit is contained in:
		| @@ -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 | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user