1

So I recently set up my own little server here at home.

I got my main system set up on an SSD and a ZFS pool of larger HDDs for data storage.

Now the question I was asking myself was if for services I want to set up such as mysql, ownCloud, gitolite etc. it would make more sense to keep the data folders on the SSD and do a regular RSYNC to a special backup dataset on the ZFS volume or to keep the datafolders on the ZFS pool in the first place.

In my opinion having them on the SSD and syncing them is probably not such a good idea as that looses me the consistency checking that comes with ZFS and kind of defeats the purpose of having it in the first place.

What is the recommended option in such a situation? Is symlinking everything from /var/lib into the pool folders the right way to go? Should I modify the config scripts? Should I mount /var on the ZFS volume in the first place?

In general which folders should be put on the ZFS volume?

Blackclaws
  • 296
  • 1
  • 2
  • 6
  • Use the ZFS pool for your bulk storage and file system separation. – ewwhite Oct 14 '15 at 10:06
  • Why don't you create one SSD pool and one HDD pool and have the applications that require performance run off of the SSD pool and the other applications off of the HDD pool. You could also move `/` to the SSD pool. But that's for you to decide, we don't know your requirements. – Marco Oct 14 '15 at 10:08
  • @Marco I shied away from the idea of making the SSD a ZFS pool as well due to the fact that in case my zfs install fails due to an upgrade or similar things I still want to be able to boot into my system without having to use a rescue disk. One idea might be to use just part of the SSD as a high performance pool which would have no mirror then however but could be regularly backupped on the mirrored pool. – Blackclaws Oct 14 '15 at 10:14
  • @ewwhite Could you clarify or give a short example what you mean exactly by file system seperation? Do you mean mounting /var on one dataset for example? – Blackclaws Oct 14 '15 at 10:16
  • I mean that you can have a zpool and carve it into the filesystems you need, with appropriate permissions and attributes. – ewwhite Oct 14 '15 at 10:17
  • @ewwhite Thats what I am already doing for data storage but I wasn't sure what would be the best route to go for service data, i.e. symlinking to the zpool mountpoints, putting /var completely on the zpool thereby maybe sacrificing a bit of performance (though I'm not sure how much actually) or changing configuration files as far as possible to directly have the services put their data into the pool folders. – Blackclaws Oct 14 '15 at 10:22

1 Answers1

1

As always, it depends a lot on your situation.

If you want ZFS just for long-time archival of backups without the danger of bit flips and do not want to change much, you could use your main system any way you want and use checksums (for example md5deep) on your active data, then copy/rsync it to the backup pool, do one more hashing and be done with it.

If you want maximum application performance, you can split your applications and your data - applications on the SSD on any filesystem (because they can be reinstalled easily), data on your pool (because it is valuable). You then use the data either locally or even via NFS, depending on what your applications need.

If you want balanced performance (better pool performance, but not as fast as native access from the second example) and are fine with a reorganization of the layout, you could add the SSD as a separate log device for the ZFS intent log (ZIL), which speeds up synchronous writes. Be careful though, as all data you write to your disks is also written to the SSD, it could die of wear leveling faster than normally.

In any case, you will only get snapshots on ZFS filesystems and zvols. This feature alone would convince me to use ZFS for as much as possible. Installed the wrong software? Just roll back, your state will be clean again. Boot fails after system upgrade? Just use the last good snapshot 15 minutes earlier, no worries. accidentally overwrote vital system information while editing some files in /etc/? No problem, got you covered.

user121391
  • 2,502
  • 13
  • 31