Skip to content

Instantly share code, notes, and snippets.

@alghanmi
Created July 26, 2012 09:01
Show Gist options
  • Save alghanmi/3181115 to your computer and use it in GitHub Desktop.
Save alghanmi/3181115 to your computer and use it in GitHub Desktop.
Move /var/log from the / partition to the /home partition
##
## Moving /var/log from SSD on / to regular HDD on /home/var_log
## http://backdrift.org/how-to-use-bind-mounts-in-linux
##
sudo cp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)
sudo mkdir /home/var_log
sudo chown root:root /home/var_log/
sudo chmod 755 /home/var_log/
echo "# bind /var/log to /home/var_log" | sudo tee -a /etc/fstab
echo "/home/var_log /var/log none bind 0 0" | sudo tee -a /etc/fstab
sudo mv /var/log /home/var_log
sudo shutdown -r now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment