Ubuntu – How to layout the filesystem for a small SSD and a big HDD


Since I don't use my laptop's CD-drive I want to put a small (8 GB) SSD into the CD-drive slot (I'll use a caddy similar to this one). I want to use compressed btrfs on the SSD and put all the data on the big HDD.
I want to avoid unnecessary spin-ups. I want the system to be fast… I want to minimize wearing of the SSD.

How should I layout the mount points of my file-system?
How can I prevent the HDD to spin up at the same time?

Best Answer

It's really up to you. You can do almost anything.

I have (to show off):

  • 1x RAID0 PCI-E SSD (OCZ Revo 120gig) that runs at 540MB/s as the primary disk
  • 4x 1.5TB disks in RAID5 as the "data" disk (called /media/ned)
  • 2x 1.5TB disks in RAID1 (currently degraded - called /media/jeff)

Popular mounting convention would have me store the entire /home/ on ned... But this would slow down a lot of applications that use things in ~ to run (eg Firefox has a SQLite database that works best on a fast disk).

Per that convention, I used to keep the entire /home/ on jeff. mdadm's RAID1 is considerably faster than its RAID5 but tons slower than my SSD. When half of jeff died, I decided I wanted more speed.

So now I just keep a directory on ned for things I really don't want on the SSD. This includes my ~/Music ~/Documents, etc. You can mount bind them in your fstab but I've just gone with SymLinks. Move the directory and run something like:

ln -s /media/ned/.fakehome/Music ~/Music

Rinse and repeat.

I my case, it's really a case of how much I can stand to lose if the worst happens. I have some security with RAID5 so anything not on it (especially the RAID0 SSD) is much more liable to die if a squirrel farts in its direction.

As you've only got a relatively tiny SSD and only one data disk, the metrics and causalities are slightly different. Each method is equally unsafe and you're limited by space. You might do best to mount all of home on the data disk and do the reverse of what I'm doing. Create a directory on the SSD for the things you want to be fast and SymLink them back out onto the data partition.

You can use fstab-mount commands but I just find SymLinks easier to maintain. I'm not sure what the performance overhead differences are like but I'm fairly sure I've asked somewhere.