BTRFS-PROPERTY(8)

πŸ’– BTRFS-PROPERTY β€” get/set/list properties for given filesystem object πŸ’–

okay bestie, pull up a chair, because btrfs property is genuinely one of those little commands that makes you feel like you have your life together. it's from the btrfs-progs girlies, and it does exactly what it says on the tin: gets, sets, and lists properties on a filesystem object. no cap.


✨ SYNOPSIS ✨

btrfs property <subcommand> <args>

🌸 DESCRIPTION 🌸

so btrfs property is your go-to for getting / setting / listing a property on a given filesystem object. and when we say "object", we mean it could be:

  • an inode (that's a file or a directory, mwah)
  • a subvolume
  • or the entire filesystem, the whole thing, main character energy

the whole point is that btrfs property gives you one unified, user-friendly way to tune all your different btrfs properties β€” instead of doing the traditional thing with chattr(1) or lsattr(1). it's giving glow-up. it's giving modern. we simply do not use the old method anymore.

πŸŽ€ Object types πŸŽ€

a property might apply to several object types at once, so sometimes you literally have to spell out which one you mean. that said, for the most common case β€” files and directories β€” you don't have to bother. she just knows. πŸ’…

the subcommands take a parameter -t, and you can use the first letter as a shortcut (f/s/d/i) for the type:

  • filesystem
  • subvolume
  • device
  • inode (file or directory β€” the everyday legends)

🧚 Inode properties 🧚

  • compression β€” the compression algorithm that's set for an inode. heads up though: it is not possible to set the compression level this way. possible values are:
    • lzo
    • zlib
    • zstd
    • no or none β€” disables compression (equivalent to chattr +m)
    • "" (empty string) β€” sets the default value
πŸ“Œ Note: this has changed in version 5.18 of btrfs-progs and requires kernel 5.14 or newer to work. so check your kernel before you come for me, bestie.

πŸ¦‹ Subvolume properties πŸ¦‹

  • ro β€” the read-only flag of the subvolume: true or false. bestie, please also go read the section SUBVOLUME FLAGS in btrfs-subvolume(8) for the possible implications regarding incremental send. this one has lore. do not skip it.

🌈 Filesystem properties 🌈

  • label β€” the label of the filesystem. for an unmounted filesystem, provide a path to a block device as the object. for a mounted filesystem, specify a mount point. easy.

πŸ‘‘ SUBCOMMAND πŸ‘‘

  • get [-t <type>] <object> [<name>] β€” reads the value of a property name from a btrfs object of the given type. if you leave the name empty, it reads all of them. all of them. greedy (affectionate).
  • list [-t <type>] <object> β€” lists the available properties for the given object, together with their descriptions. it's giving menu. it's giving "here's everything you could order".
  • set [-f] [-t <type>] <object> <name> <value> β€” sets the value of a property name on a given btrfs object.

Options

  • -f β€” force the change. because changing some properties may involve safety checks or additional changes that depend on the property's semantics. so like, she's checking your work before you commit. don't force it unless you mean it.

⭐ EXAMPLES ⭐

setting compression on a file, step by step, bestie:

$ touch file1
$ btrfs prop get file1
[ empty output ]
$ btrfs prop set file1 compression zstd
$ btrfs prop get file1
compression=zstd

look at that. empty output, then boom β€” compression=zstd. we love a transformation arc. ✨

making a writeable subvolume read-only:

$ btrfs subvol create subvol1
[ fill subvol1 with data ]
$ btrfs prop get subvol1
ro=false
$ btrfs prop set subvol1 ro true
ro=true

the way she went from ro=false to ro=true… iconic. periodt.


πŸ’€ EXIT STATUS πŸ’€

btrfs property returns a zero exit status if it succeeds. if it fails, you get a non-zero back. that's the whole rule. no drama.


πŸ™ˆ AVAILABILITY πŸ™ˆ

btrfs is part of btrfs-progs. please refer to the documentation at <https://btrfs.readthedocs.io>.


πŸ“ SEE ALSO πŸ“


and that's the page, bestie!! 🫢 this was btrfs-progs version 7.3, dated Oct 24, 2026 β€” go forth and set your properties, you gorgeous little power user. πŸ’œπŸŒΈβœ¨

πŸ“¦ where this page comes from