Skip to content

Instantly share code, notes, and snippets.

@diogoca
Created November 20, 2015 14:39
Show Gist options
  • Select an option

  • Save diogoca/a9297dfb9b40e5b38d7b to your computer and use it in GitHub Desktop.

Select an option

Save diogoca/a9297dfb9b40e5b38d7b to your computer and use it in GitHub Desktop.
Move /var to another partition
# First, boot into single user mode (edit boot, esc + e), add init=/bin/bash after ro
# Make sure any process writing to /var is stopped. (Check with lsof | grep /var)
mkdir -p /home/var
rsync -va /var /home/var
mv /var /var.old # you can remove /var.old when you are done to reclaim the space
mkdir -p /var
mount -o bind /home/var /var
# update your /etc/fstab to make the bind-mount permanent.
/etc/fstab
/home/var /var none bind
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment