How to clear zfs properties in solaris?



  • To clear a settable zfs property (except quota and reservation) on a child, use "zfs inherit" to inherit the property of the parent.

    For example, set the compress property to "on" on test_pool/fs1/admin:

    # zfs set compression=on test_pool/fs1/admin
    

    Check the compression property settings on test_pool:

    # zfs get -r compression test_pool
    

    To clear the compression property on test_pool/fs1/admin and revert to that of the parent:

    # zfs inherit compression test_pool/fs1/admin
    

    Check the result:

    # zfs get -r compression test_pool
    NAME                 PROPERTY     VALUE                SOURCE
    test_pool            compression  off                  default
    test_pool/export     compression  off                  default
    test_pool/fs1        compression  off                  default
    test_pool/fs1/admin  compression  off                  default
    test_pool/fs2        compression  off                  default
    

    If both had compression set to "on", the value set in the most immediate ancestor would be used, in the above example, fs1.

    NOTE: if you use the -r option, the properties of all descendents will be changed i.e.:

    # zfs get -r compression test_pool
    NAME                 PROPERTY     VALUE                SOURCE
    test_pool            compression  off                  default
    test_pool/export     compression  off                  default
    test_pool/fs1        compression  on                   local
    test_pool/fs1/admin  compression  on                   local
    test_pool/fs2        compression  off                  default
    
    # zfs inherit -r compression test_pool/fs1
    
    # zfs get -r compression test_pool
    NAME                 PROPERTY     VALUE                SOURCE
    test_pool            compression  off                  default
    test_pool/export     compression  off                  default
    test_pool/fs1        compression  off                  default
    test_pool/fs1/admin  compression  off                  default
    test_pool/fs2        compression  off                  default
    


© Lightnetics 2024