materusPC: use qcow2 again

This commit is contained in:
Mateusz Słodkowicz 2024-07-13 23:53:37 +02:00
parent 94db4c8851
commit f833382298
Signed by: materus
GPG Key ID: 28D140BCA60B4FD1
1 changed files with 7 additions and 5 deletions

View File

@ -184,13 +184,15 @@ in
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
serviceConfig.RemainAfterExit = true; serviceConfig.RemainAfterExit = true;
script = '' script = ''
modprobe nbd max_part=16
losetup -P /dev/loop6 /materus/data/VM/data.raw sleep 1
mount /dev/loop6p1 /materus/data/Windows -o uid=1000,gid=100 qemu-nbd -c /dev/nbd10 /materus/data/VM/data.qcow2 --discard=unmap
sleep 1
mount /dev/nbd10p1 /materus/data/Windows -o uid=1000,gid=100
''; '';
preStop = '' preStop = ''
umount -lf /materus/data/Windows umount -r /dev/nbd10p1
losetup -d /dev/loop6 qemu-nbd -d /dev/nbd10
''; '';
}; };
} }