Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running out of space and would like to move my logs to recover some room on my SSD. My question:

  1. I have an SSD (mounted at /) and regular hard-drive (mounted at /mnt/d2). How can I change it so that my logs (all the logs stored in /var/log) are stored somewhere on my other hard-drive (maybe /mnt/d2/var/log)?

Thank you!

share|improve this question
up vote 2 down vote accepted
sudo /etc/init.d/rsyslog stop
sudo mv /var/log /mnt/d2/
sudo ln -s /mnt/d2/log /var/log
sudo /etc/init.d/rsyslog start

You might want to go ahead and reboot the machine, while you're at it, just in case you have something other than rsyslogd busily trying to write to logs under /var/log - those won't recover until they're restarted as well, which just bouncing the whole box will accomplish nicely.

What we're doing here is, instead of trying to reconfigure everything that might possibly want to write to /var/log, instead just gently redirecting things going there to your other disk. You can still cd /var/log or less /var/log/syslog or whatever and have it work just fine, this way, and any new programs that try to log to directories under /var/log directly rather than working through rsyslogd will also still work as expected.

share|improve this answer
Ah, this is so helpful. Thank you. I thought to potentially do the symlinking, but I got caught up in a mire of symlink subtleties (didn't think to stop rsyslog). – aaronlevin Nov 23 '12 at 22:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.