Skip to content

Instantly share code, notes, and snippets.

@andrewp-as-is
Last active June 19, 2020 19:11
Show Gist options
  • Save andrewp-as-is/c5e47f43b2883208e7382e7abe6ab5fa to your computer and use it in GitHub Desktop.
Save andrewp-as-is/c5e47f43b2883208e7382e7abe6ab5fa to your computer and use it in GitHub Desktop.
AWS EC2 mount volume
#!/usr/bin/env bash
filesys="/dev/nvme4n1"
label="label"
mount_dir="/mnt/$label"
sudo mkfs -t ext4 -T small $filesys
sudo e2label $filesys "$label"
sudo mkdir "$mount_dir"
sudo mount /dev/$filesys "$mount_dir"
sudo chmod -R 755 "$mount_dir"
# sudo umount /dev/$filesys
lsblk
sudo fdisk -l $filesys
SSH_HOSTNAME:=aws
all:
ssh $(SSH_HOSTNAME) < ./e2-mount-volume.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment