Created
July 27, 2019 12:56
-
-
Save kkew3/7b846f4500bfd9c851bad63a09ea6064 to your computer and use it in GitHub Desktop.
[mount EBS volume to AWS EC2]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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