From e65392aefb8278a5e8e7e1270891bc7d8769b205 Mon Sep 17 00:00:00 2001 From: Sam Yaple Date: Wed, 4 Nov 2015 04:44:09 +0000 Subject: [PATCH] Adjust gate btrfs setup This is in preperation for the DinD gate. Change-Id: I2d2489df00808824f957ed0e3aa3a44496ff7e3e Partially-Implements: blueprint multinode-gate --- tests/setup_ubuntu.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/setup_ubuntu.sh b/tests/setup_ubuntu.sh index 4eb30bc8b6..66280da34b 100755 --- a/tests/setup_ubuntu.sh +++ b/tests/setup_ubuntu.sh @@ -20,8 +20,15 @@ sudo parted /dev/${DEV} -s -- mklabel msdos sudo service docker stop echo 'DOCKER_OPTS="-s btrfs"' | sudo tee /etc/default/docker sudo rm -rf /var/lib/docker/* + +# We want to snapshot the entire docker directory so we have to first create a +# subvolume and use that as the root for the docker directory. sudo mkfs.btrfs -f /dev/${DEV} sudo mount /dev/${DEV} /var/lib/docker +sudo btrfs subvolume create /var/lib/docker/docker +sudo umount /var/lib/docker +sudo mount -o noatime,compress=lzo,space_cache,subvol=docker /dev/${DEV} /var/lib/docker + sudo service docker start sudo docker info