Solved Completely remove user-defined property from root-level dataset

Hey, folks. While setting a user-defined property on the root dataset of a pool---with the intention of it being inherited by every dataset in the pool---I made a typo that resulted in a property that is useless. According to the Handbook:

FreeBSD Handbook said:
To remove a custom property, use zfs inherit with -r. If the custom property is not defined in any of the parent datasets, it will be removed completely...

However, as this property was set on the root level of the dataset tree, there is no parent from which to inherit the null value and remove the property entirely. The zfs(8) man page section on zfs inherit doesn't contain any more information on it than the Handbook does either. Is there a way to remove this property, or am I stuck with it? It doesn't have any effect, but it is annoying to have it there all the same.
 
You still do the same thing:

Code:
# zfs set com.test:test=1 sys |grep com.test
# zfs get all sys | grep com.test
sys   com.test:test         1                      local
# zfs inherit com.test:test sys
# zfs get all sys | grep com.test
#
 
That did it. Thanks. It's odd that the man page and handbook don't mention that, though, and only mention using the '-r' and '-S' flags. I'll look into filing a bug report with the FreeBSD Doc folks.
 
I've not read it but it sounds like the documentation is a bit confusing. You don't "need" to use -r to remove a custom property.

If you set a custom property on some/dataset, it will be inherited by all children. To remove it, you only need to remove it from some/dataset. You shouldn't have to use -r as it's only set on that one dataset.

Of course the name "inherit" is a bit confusing as well. All it does is actually remove any local dataset setting for the property. For any standard property, this means the dataset will just use the value of its parent instead (or the ZFS default if it's the root dataset). For custom properties, it causes them to completely disappear if the property you tell it to inherit isn't set on a parent.
 
Alright, thanks for the feedback. The man page isn't actually confusing as to what zfs inherit does---the relevant section simply doesn't make any mention of user-defined properties, or what happens to them when the command is run. One can infer that the "default setting" for a user-defined property is non-existence, but the man page should probably be more explicit. The Handbook entry is a bit misleading, though. I'll mark this as "Solved."
 
It would be all much easier if there was a zfs unset to complement zfs set. The "inherit" word will throw people off way too easily because it conjures up the notions of inheritance and recursion that need multiple levels of datasets to be applicable.
 
Back
Top