Last active
August 29, 2015 14:09
-
-
Save vbatts/b7dcd41bc8d9b1e16ea3 to your computer and use it in GitHub Desktop.
test setup for https://github.com/docker/docker/pull/9006
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 | |
set -e | |
dd of=pool.img if=/dev/zero bs=1G count=2 | |
dd of=meta.img if=/dev/zero bs=1G count=1 | |
l1=$(sudo losetup -f) | |
sudo losetup ${l1} ./pool.img | |
l2=$(sudo losetup -f) | |
sudo losetup ${l2} ./meta.img | |
name=${name:-docker-test-pool} | |
l1size=$(sudo blockdev --getsz ${l1}) | |
sudo dmsetup create ${name} \ | |
--table "0 ${l1size} thin-pool ${l2} ${l1} 512 8192" | |
sudo dmsetup suspend ${name} | |
sudo dmsetup resume ${name} | |
echo "start docker with '-s devicemapper --storage-opt "dm.thinpooldev=${name}"'" | |
echo "(cleanup with \`sh ./teardown.sh ${l1} ${l2}\`)" |
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 | |
set -e | |
if [ ${#@} -lt 2 ] ; then | |
echo "please provide the two loop device paths" | |
exit 1 | |
fi | |
sudo dmsetup remove docker-test-pool | |
sudo losetup -d ${1} | |
sudo losetup -d ${2} | |
rm pool.img meta.img |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment