-
Hi, In ZFS you can mount any snapshot as real-only, clone any snapshot to make changes or make destructive rollback. So I want to ask if there is any chance to make snapshots little more flexible like in Btrfs. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Snapshots are read-only by definition. Period. I don't know about BTRFS, but if you need to "make changes to the older snapshot", the writes must go somewhere, and that is what clones are for. They store all divergence from the original snapshot. |
Beta Was this translation helpful? Give feedback.
-
I understand that snapshots are read-only. You are right that clones solve this. I was thinking what needs to be done to achieve similar result in ZFS:
This basically simulates what Btrfs does. It mounts old snapshot (as writable clone) to same path as original dataset. Basically making a switch. I was just thinking that it would be nice if ZFS could do this in one go with single command. Something like |
Beta Was this translation helpful? Give feedback.
What worries me here most is the unmount operation. If even a single file from that mount point is open, Linux kernel won't let you to unmount it. And swapping the dataset beneath application without unmounting is a request for data corruption. If that is not a problem for you, just write a script of few lines doing that. But you need to keep also in mind possible interaction with other processes on a system, that will see the created clone and may get surprised by it in some way.