-
-
Save cowlby/4c443141ba541c97ae73 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 | |
#attach the EBS to /dev/sdf before running it | |
#format EBS | |
mkfs -t ext4 /dev/xvdf | |
#copy original /var to /dev/xvdf | |
mkdir /mnt/new | |
mount /dev/xvdf /mnt/new | |
cd /var | |
cp -ax * /mnt/new | |
cd / | |
mv var var.old | |
#mount EBS as new /var | |
umount /dev/xvdf | |
mkdir /var | |
mount /dev/xvdf /var | |
#update fstab file to mount EBS on system startup | |
echo "/dev/xvdf /var ext4 noatime 0 0" >> /etc/fstab |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment