mirror of
https://github.com/nextcloud/vm.git
synced 2025-10-26 11:27:32 +00:00
check if UUID is used
This commit is contained in:
parent
403143d3aa
commit
0d6ab8a7f9
18
lib.sh
18
lib.sh
@ -1245,17 +1245,19 @@ fi
|
||||
if ! zpool list "$POOLNAME" >/dev/null 2>&1
|
||||
then
|
||||
zpool import -f "$POOLNAME"
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
# Get UUID
|
||||
if fdisk -l /dev/sdb1 >/dev/null 2>&1
|
||||
# Check if UUID is used
|
||||
if zpool list -v | grep sdb
|
||||
then
|
||||
UUID_SDB1=$(blkid -o value -s UUID /dev/sdb1)
|
||||
# Get UUID
|
||||
if fdisk -l /dev/sdb1 >/dev/null 2>&1
|
||||
then
|
||||
UUID_SDB1=$(blkid -o value -s UUID /dev/sdb1)
|
||||
fi
|
||||
# Export / import the correct way (based on UUID)
|
||||
check_command zpool export "$POOLNAME"
|
||||
check_command zpool import -d /dev/disk/by-uuid/"$UUID_SDB1" "$POOLNAME"
|
||||
fi
|
||||
# Export / import the correct way
|
||||
check_command zpool export "$POOLNAME"
|
||||
check_command zpool import -d /dev/disk/by-uuid/"$UUID_SDB1" "$POOLNAME"
|
||||
}
|
||||
|
||||
## bash colors
|
||||
|
||||
Loading…
Reference in New Issue
Block a user