Last active
November 14, 2018 08:35
-
-
Save camme/bee6e573e45337ec36c65a50bda1ce30 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 | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root" | |
exit | |
fi | |
file -s /dev/xvdb | |
mkfs -t ext4 /dev/xvdb | |
mkdir /data | |
mount /dev/xvdb /data | |
cp /etc/fstab /etc/fstab.orig | |
UUID=$(file -s /dev/xvdb | grep -E -o '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}') | |
echo "UUID=${UUID} /data ext4 defaults,nofail 0 2" >> /etc/fstab | |
umount /data | |
mount -a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment