Solved ZFS configuration - single SSD

Hello everyone!

I'm considering to install a new system on my laptop and I would like to use ZFS as it's filesystem - with a single SSD.
There are two things I'm not clear about and would like to know what you think about it.
1) I don't consider copy=2 or anything like that. Does this mean that any bitrot etc. might trigger the disc to read-only mode without the possibility of recovery? - By recovery, I mean for example to ignore the wrong bit / hash.
2) Would it be a bad idea to use multiple partitions? - for example an additional partition for home.

Best regards,
Hakaishi
 
Hello everyone!

I'm considering to install a new system on my laptop and I would like to use ZFS as it's filesystem - with a single SSD.
There are two things I'm not clear about and would like to know what you think about it.
1) I don't consider copy=2 or anything like that. Does this mean that any bitrot etc. might trigger the disc to read-only mode without the possibility of recovery? - By recovery, I mean for example to ignore the wrong bit / hash.
2) Would it be a bad idea to use multiple partitions? - for example an additional partition for home.

Best regards,
Hakaishi
I don't understand your post but I use ZFS with a single SSD, too. You just choose stripe on the Auto ZFS dialog, choose the disk and it will automatically setup the disk for you. Of course stripe means no redundancy, though.
 
1) I don't consider copy=2 or anything like that. Does this mean that any bitrot etc. might trigger the disc to read-only mode without the possibility of recovery? - By recovery, I mean for example to ignore the wrong bit / hash.
AFAIK, yes. With or without a single disk, you should make regular backups. Even on a RAID.
2) Would it be a bad idea to use multiple partitions? - for example an additional partition for home.
Yes. One of the major advantages of ZFS is that it integrates the volume management into the filesystem layer. You'll have no advantage from a separate $HOME partition. Contrarily, administration is much easier with one zpool(8) per disk. You may want to have a separate partition for dump/swap, and if you want hibernation (suspend to disk) RTFM here. I have
  1. an IRST hibernation partition 12GB = size of RAM
  2. a small 4GB partition for minidumps dump/swap +
  3. additional swap on a 12GB ZVOL.
Tweaks:
  • On a SSD, it's reasonable to tweak sysctl vfs.zfs.mdcomp_disable=1 before installation (open a shell in the installer: ALT+Function key) and add that to /boot/loader.conf(5) (without sysctl, but with "1" around the number 1).
  • Additionally, I have vfs.zfs.cache_flush_disable=1 + vfs.zfs.vdev.bio_flush_disable=1 in sysctl.conf(5), because a laptop has a builtin UPS (the battery). But that's non-standard and I do on my own risk.
Good luck!
 
mjollnir, thank you for your reply and tips.

AFAIK, yes. With or without a single disk, you should make regular backups. Even on a RAID.
I use ZFS on an external 2TB HDD with copy=2 as a backup disk.
I just wanted to know if I can recover from a read-only pool. For example if a bit changed or a bad sector appears. By recovering, I mean continue using the pool without having to delete and recreate it. I don't want to reinstall the whole system over and over again.
 
I just wanted to know if I can recover from a read-only pool. For example if a bit changed or a bad sector appears. By recovering, I mean continue using the pool without having to delete and recreate it. I don't want to reinstall the whole system over and over again.
I don't know how ZFS handles that in detail, a ZFS wizzard has to answer that. It's clear that there's a difference for any filesystem in where the error occurs: file data or filesystem metadata. You can set ZFS's dataset attribute redundant_metadata=most to trade enhanced random-write performance at the cost of reduced reliabilty. The default of this knob is all, i.e. if a single on-disk block is corrupt, at worst a single block of user data (which is recordsize bytes long) can be lost.
Obviously, if you already had bitrod on an old, worn-out device, you shouldn't use it anymore.
 
Thank you for the hint at the dataset property.
I've looked it up in the manpage. Not sure why I would want to change that, but it's an interesting setting to increase performance and reduce the written amount of data.
This makes it clear that there is still some additional redundancy happening, but maybe not on the data level, but only on the metadata level. What ever that will imply...

By the way, by partitioning I meant to separate home from the rest of the system in order to make backups more easily. That would be a dataset, correct?
Do you know if it would have an impact on the SSD to have multiple datasets?
 
This makes it clear that there is still some additional redundancy happening, but maybe not on the data level, but only on the metadata level. What ever that will imply...
It implies that you're able to read most of your data on a degraded zpool.
By the way, by partitioning I meant to separate home from the rest of the system in order to make backups more easily. That would be a dataset, correct?
Yes, ZFS datasets are analogous to partitions, and it's very common to have /home on a separate dataset; you can even give some users their own dataset and delegate fine-grained administrative rights to them. You can snapshot a dataset (optionally recursively), and typically snapshots are the subject of zfs send/receive. But you can also use traditional tools like tar(1) & cpio(1) etc.pp.
Do you know if it would have an impact on the SSD to have multiple datasets?
No, it does not have a negative impact, and it's the standard case to have multiple datasets on a zpool. SSD are special anyway, because their layout & internal data handling is a black box to the OS.
 
Back
Top