1

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.

Kris Harper
  • 13,477
mdda
  • 11
  • 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 04 '11 at 04:15
  • 1
    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 04 '11 at 15:12

1 Answers1

1

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.

  • 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 04 '11 at 03:25
  • Yes, so you would need to do some cleanup so that /var only has data specific to /var. – Justin Andrusk Sep 05 '11 at 15:25