Skip to content

Instantly share code, notes, and snippets.

@aidansteele
Created March 26, 2018 07:58
Show Gist options
  • Save aidansteele/18416bdce1b86d71fa70111378005a01 to your computer and use it in GitHub Desktop.
Save aidansteele/18416bdce1b86d71fa70111378005a01 to your computer and use it in GitHub Desktop.
userdata to use nvme disk for docker instead of ebs
set -euxo pipefail
service docker stop
vgextend docker /dev/nvme0n1
lvremove -f /dev/docker/docker-pool
vgreduce docker /dev/sdcz1
lvcreate -T docker -n docker-pool -L 200G
lvcreate docker -n scratch -L 200G
mkfs.ext4 -E nodiscard /dev/docker/scratch
mkdir /mnt/scratch
mount -o nodiscard /dev/docker/scratch /mnt/scratch/
rm -rf /var/lib/docker
mkdir /mnt/scratch/docker
echo 'OPTIONS="${OPTIONS} --data-root=/mnt/scratch/docker"' >> /etc/sysconfig/docker
service docker start
echo ECS_CLUSTER=<cluster> >> /etc/ecs/ecs.config
restart ecs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment