Skip to content

Instantly share code, notes, and snippets.

@kkew3
Created July 27, 2019 12:56
Show Gist options
  • Save kkew3/7b846f4500bfd9c851bad63a09ea6064 to your computer and use it in GitHub Desktop.
Save kkew3/7b846f4500bfd9c851bad63a09ea6064 to your computer and use it in GitHub Desktop.
[mount EBS volume to AWS EC2]
#!/bin/bash
# this command list attached volumes; make sure the volume to mount
# is in the list
lsblk
# see if the volume contains file system (skipped if for sure).
# the name of the volume is denoted here as `/dev/xvdf', which
# should be listed in the output of `lsblk'.
# If the output is `/dev/xvdf: data', then it does not have
# file system
#sudo file -s /dev/xvdf
# if no file system is found, make one. Replace FSNAME with the
# file system name
#sudo mkfs -t FSNAME /dev/xvdf
# make mount point named NAME and mount
mkdir NAME
sudo mount /dev/xvdf NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment