btrfs-property
Set or get Btrfs object properties
TLDR
List available properties (and descriptions) for the given btrfs object
Get all properties for the given btrfs object
Get the label property for the given btrfs filesystem or device
Get all object type-specific properties for the given btrfs filesystem or device
Set the compression property for a given btrfs inode (either a file or directory)
SYNOPSIS
btrfs property [-p] [-ts] <path> [<name> [<value>]]
PARAMETERS
-p, --path-only
Print only paths of objects (useful in scripts or lists)
-t
Display property types (e.g., inode, volume)
-s
Display available property settings
DESCRIPTION
btrfs property is a subcommand of the btrfs(8) utility for querying and modifying properties on BTRFS filesystem objects, including files, directories, and subvolumes. Properties provide BTRFS-specific controls beyond standard attributes, such as enabling compression, marking subvolumes read-only, disabling copy-on-write (nodatacow), or setting quota overrides.
Operation modes depend on arguments:
• No name: Lists all properties for the path.
• name only: Retrieves the property's value.
• name and value: Sets the property.
This enables precise tuning, e.g., btrfs property set /mnt/mysubvol ro true makes a subvolume read-only, protecting it from writes. File-level properties like compression=zstd apply to new files in a directory. Properties are inherited or set per-object, with some requiring root privileges or specific object types (subvolume vs. inode).
Output can be customized with options for scripting. Full details on properties in btrfs-property(5). Useful for administration, performance optimization, and data protection in BTRFS environments.
CAVEATS
Root privileges often required for setting properties. Not all properties supported on every object type or kernel version. Subvolume properties like ro affect snapshots differently.
COMMON PROPERTIES
ro: Read-only for subvolumes (true/false)
compression: Algorithm (none, zstd, lzo, zlib)
nodatacow: Disable COW for files (true)
datacow: Re-enable COW (true)
quota_override: Quota override (number)
See btrfs-property(5) for complete list.
HISTORY
Added in btrfs-progs 0.20-dev (January 2012), with kernel support from 3.7+. Expanded in later versions for more properties like compression inheritance (kernel 4.6+).
SEE ALSO
btrfs(8), chattr(1), lsattr(1), btrfs-property(5)


