Answer the question
In order to leave comments, you need to log in
How to limit the size of the moon?
Hello.
I'm making a diskless system for an internet club.
Disks are created by such a script, then distributed via iscsi:
modprobe dm_mod
modprobe dm_mirror
modprobe dm_snapshot
IMAGE_FILE=$1
DIRCLONE=/storage3/clon
img_loop_dev=`losetup -f`
losetup -v -f $IMAGE_FILE
cow_size=`blockdev --getsize $img_loop_dev`
echo $cow_size
chunk_size=64
# chunk_size=1
FILE=$IMAGE_FILE
for loopnumber in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
do
dd if=/dev/zero of=$DIRCLONE/$FILE.cow.$loopnumber bs=512 count=0 seek=$cow_size
COWLOOPDEV=`losetup -f`
losetup -v -f $DIRCLONE/$FILE.cow.$loopnumber
echo "0 $cow_size snapshot $img_loop_dev $COWLOOPDEV p $chunk_size" | dmsetup create $FILE.cow.$loopnumber
done
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question