On Wed, Feb 20, 2013 at 3:49 PM, Markus Grundmann <mar...@freebsduser.eu> wrote:
> It's possible to enhance the properties in the current source tree with an
> entry like "protected"?
> I find it seems not to be difficult but I'm not an professional C
> programmer. For more information
> please take a little bit of time and read my short post at
Zfs already allows for custom properties. You could create your own
property, like "protected", and set it to anything you wanted to.
> Whenever I modify zfs pools or filesystems it's possible to destroy [on a
> bad day :-)] my data. A new
> property "protected=on|off" in the pool and/or filesystem can help the
> administrator for datalost
> (e.g. "zpool destroy tank" or "zfs destroy <tank/filesystem>" command will
> be rejected
> when "protected=on" property is set).
"zpool destroy tank" can be undone as long as you didn't overwrite the
partitions with something (the data is still there). The more
dangerous one is "zfs destroy". I suggest putting in a snapshot, which
counts as a child filesystem, so you would have to do "zfs destroy -r
tank/filesystem" to recursively destroy all the children.
I would imagine you could write some sort of wrapper for the "zfs"
command that checks if the command includes "destroy" and then check
for the existence of your custom property.
zfs-discuss mailing list