Skip to content

Instantly share code, notes, and snippets.

@brndnmtthws
Forked from aussielunix/aws_nvme-cloud-init.yml
Last active January 23, 2021 19:15
Show Gist options
  • Save brndnmtthws/c64f1a238e1b54fab8bbd92ca6199342 to your computer and use it in GitHub Desktop.
Save brndnmtthws/c64f1a238e1b54fab8bbd92ca6199342 to your computer and use it in GitHub Desktop.
simple cloud-init for mounting an ephemeral nvme store in AWS. This is to be used as user-data.
#cloud-config
repo_update: true
repo_upgrade: all
package_upgrade: true
bootcmd:
- test -z "$(blkid /dev/nvme0n1)" && mkfs -t ext4 -L scratch /dev/nvme0n1
- mkdir -p /mnt/tmp
- mount /dev/nvme0n1 /mnt/tmp
- cp -a /var /mnt/tmp
- umount /mnt/tmp
- rmdir /mnt/tmp
mounts:
- [ "/dev/nvme0n1", "/var", "ext4", "defaults,discard,nofail", "0", "2" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment