Quick question: is there a filesystem that let me
- automatically "resize" (up or down) partitions,
- share one partition between several devices, and
- make sure that some content only go to one device and not the other?
Context: I have two drives: a big HDD (1 TB) that I trust, and a very small SSD (24 GB) that I do not trust (i.e. it could be destroyed at any time, but this should not corrupt the data on the HDD). To simplify, let's say I have two folders only:
/nixwill contain the system: I don't mind if I lose this partition, so I'd like to have it as much as possible on the SSD to launch new apps quickly. But '/nix' could contain more that 24 GB of data, so it needs to be partly on the HDD as well.
/homewill contain the data: it contains valuable data that I do not want to put on the SSD to make sure I don't lose them in case of a corruption of the SSD.
For now, I created 3 LVM partitions (physical volumes): two partitions on the HDD (
hddb), and one the SDD (
sdda), and I created two LWM group volumes, one that contains
hdda + sdda (for the ext4 partition
/nix), and one that contains
hddb (for the ext4 partition
/home). But the problem is that the total size of
/nix + /home is always close to the maximum available size, so when I need more memory on
/home, I need to shrink down
/nix. And shrinking a partition is not super practical, as it requires to boot from a live CD, and takes time...
I saw that the very poverful ZFS (that even allows compression!) can automatically "resize" the partition for me, but unfortunately I can't find how to say "keep the /home partition in HDD, and keep the /nix partition in SDD if possible".
Is there any better filesystem that allows that (compression would be nice as well), or a way to use ZFS in that manner?