Created
March 1, 2019 16:14
-
-
Save Callisto13/aee3ec7d11a6b575642c7f0b7a9860a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mountandwrite() { | |
i=$1 | |
echo "mounting $i" | |
mount -t overlay -o lowerdir=./lower,upperdir=./upper$i,workdir=./work$i overlay target$i | |
echo "writing $i" | |
dd if=/dev/urandom of=target$i/foo bs=10M count=10 | |
} | |
unmount() { | |
i=$1 | |
echo "unmounting $i" | |
start_time=$(date +"%s.%N") | |
umount target$i | |
end_time=$(date +"%s.%N") | |
result="$(echo $end_time-$start_time | bc)" | |
echo "$i took $result seconds to unmount" | |
} | |
mkdir lower | |
for i in `seq 1 10`; do | |
mkdir upper$i work$i target$i | |
mountandwrite $i | |
done | |
for i in `seq 1 10`; do | |
unmount $i & | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment