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've put a new SSD as /dev/sda, the old HD as /dev/sdb. And done a fresh installation as one partition on /dev/sda1.

The main quirk in my set-up is that I don't want to repartition the old HD, since it's got lots of data on it.

Since I had a swap partition on the HD before, I've put that into fstab. I've also mounted the HD. And /tmp (and /tmp/var) are in tmpfs.

But, how can I go about moving /var to the HD? I can junk the old one (currently sitting under root at /dev/sdb5, and /mnt/hd).

Doing a simple ln -s /mnt/hd/var /var doesn't seem to work. Is this something I need to do with mount -o bind? I'm asking because the "attempt, fail, recover" cycle time is pretty long.

share|improve this question
Why do you want to preserve the old var? Or if not preserve... why have /var on your HDD? It's written to pretty frequently, I'd much rather have it on my SSD. I don't think having it on a separate drive (from /) makes up for the HDD speed and latency hit. – Mark Russell Sep 4 '11 at 4:15
But I've seen many recommendations on the net to keep /var off the SSD, simply because it gets written to a lot... And I'm trying to avoid excessive wear on the SSD. – mdda Sep 4 '11 at 15:12
possible duplicate of How can I store /var on a separate partition? – bain May 25 '14 at 15:53

The quick and easy way would be to edit your /etc/fstab file and add an entry similar to the one that you should see for the / partition and just put the necessary pointers such as the fs type, ext4 and point it to /dev/sdb5. Reboot and it should work. I would mount it to a temporary mount point and recursively copy or rsync it to that filesystem to ensure that you do not loose any data first.

share|improve this answer
But doesn't mounting /dev/sdb5 as /var declare the whole partition as /var? I have other directories on that partition (such as my old /home/...) – mdda Sep 4 '11 at 3:25
Yes, so you would need to do some cleanup so that /var only has data specific to /var. – Justin Andrusk Sep 5 '11 at 15:25

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.