Skip to content

Instantly share code, notes, and snippets.

Created December 29, 2017 21:06
What would you like to do?
Script to mount volumes on aws instances
# note - /dev/xvdh that is what /dev/sdh is mapped to
devpath=$(readlink -f /dev/xvdh)
sudo file -s $devpath | grep -q ext4
if [[ 1 == $? && -b $devpath ]]; then
sudo mkfs -t ext4 $devpath
sudo mkdir $MNTPOINT
#sudo chown riak:riak $MNTPOINT
sudo chmod 0775 $MNTPOINT
echo "$devpath $MNTPOINT ext4 defaults,nofail,noatime,nodiratime,barrier=0,data=writeback 0 2" | sudo tee -a /etc/fstab > /dev/null
sudo mount $MNTPOINT
echo deadline | sudo tee /sys/block/$(basename "$devpath")/queue/scheduler
echo never | sudo tee /sys/kernel/mm/transparent_hugepage/enabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment