LinuxCommandLibrary

btrfs-property

Get and set properties on btrfs filesystem objects

TLDR

List available properties for a btrfs object

$ sudo btrfs property list [path/to/btrfs_object]
copy
Get all properties for a btrfs object
$ sudo btrfs property get [path/to/btrfs_object]
copy
Get the label property for a filesystem
$ sudo btrfs property get [path/to/btrfs_filesystem] label
copy
Get properties for a specific object type
$ sudo btrfs property get -t [subvol|filesystem|inode|device] [path/to/btrfs_filesystem]
copy
Set compression for a file or directory
$ sudo btrfs property set [path/to/btrfs_inode] compression [zstd|zlib|lzo|none]
copy

SYNOPSIS

btrfs property subcommand [options] path [property [value]]

DESCRIPTION

btrfs property manages properties on btrfs filesystem objects including files, directories, subvolumes, filesystems, and devices. Properties control behavior like compression, read-only status, and labels.
Different object types support different properties. The list command shows what properties are available for each object.

PARAMETERS

-t type

Object type: subvol, filesystem, inode, or device

SUBCOMMANDS

list

List available properties and descriptions
get
Get property values
set
Set a property value

PROPERTIES

compression

Compression algorithm for files: zstd, zlib, lzo, none
label
Filesystem label (filesystem property)
ro
Read-only status (subvolume property)

CAVEATS

Setting compression on a directory only affects new files; existing files need explicit recompression. Not all properties are writable. Some operations require root privileges.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community