Last active
February 15, 2018 11:33
-
-
Save sou/53bdde24a6fbbe5bdc8a6a276294b09a to your computer and use it in GitHub Desktop.
This file contains 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 | |
FS=$(dumpe2fs /dev/xvdf | awk '/Filesystem magic number*/ { print $4 }') | |
if [ -z "$FS" ] || [ "$FS" != "0xEF53" ]; then | |
mkfs -t ext4 /dev/xvdf | |
fi | |
if [ -z "$(cat /etc/fstab | grep '/dev/xvdf')" ]; then | |
echo '/dev/xvdf /data ext4 defaults 1 1' >> /etc/fstab | |
mount -a | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment