fix disk location

This commit is contained in:
oiseauroch 2022-11-29 14:57:52 +01:00
parent 94c76ff596
commit 279b0a6e4b

View File

@ -1,7 +1,7 @@
#!/bin/bash
if [ "$VIRTUALISATION" = "true" ]
then
datadir=__DATADIR__
final_path=__FINALPATH__
format=$1
i=0
while $(fdisk -l /dev/nbd$i 1&>2 /dev/null)
@ -10,7 +10,7 @@ then
done
echo $i
modprobe nbd max_part=$(( i + 1 ))
qemu-nbd --connect /dev/nbd$i $datadir/garage.qcow2
qemu-nbd --connect /dev/nbd$i $final_path/garage_data.qcow2
if [[ "$format" = "true" ]]
then
mkfs.ext4 /dev/nbd$i > /dev/null