Back up, restore, and verify Linux filesystem inode flags (as reported by lsattr/chattr)
Find a file
2026-03-10 15:55:17 +01:00
.gitignore add CLAUDE.md and fix .gitignore typo 2026-03-10 15:13:47 +01:00
CLAUDE.md add CLAUDE.md and fix .gitignore typo 2026-03-10 15:13:47 +01:00
fixattr.go ignore nocow attribute 2026-01-29 20:34:58 +01:00
go.mod add CLAUDE.md and fix .gitignore typo 2026-03-10 15:13:47 +01:00
go.sum add database 2026-01-21 15:59:38 +01:00
LICENSE license 2026-03-10 15:55:17 +01:00
README.md add readme 2026-03-10 15:22:33 +01:00

fixattr

Back up, restore, and verify Linux filesystem inode flags (as reported by lsattr/chattr).

Most backup tools do not handle (wisely) the extended attributes. This tool keeps the information in a database so that you can restore it later.

Install

go install kanis.fr/fixattr/v2@latest

Or build from source:

go build ./...

Usage

backup

Walk a directory tree and save all inode flags to a SQLite database:

fixattr backup -path /
# writes /attribute.sqlite3

restore

Apply saved flags from a database to a directory tree:

fixattr restore -db /attribute.sqlite3 -target /mnt/newdisk

verify

Compare inode flags between two directory trees and report differences:

fixattr verify -source / -target /mnt/newdisk

show

Display inode flags (via lsattr) for all files with non-zero flags under a path:

fixattr show -source /

Notes

  • The No_COW flag (C) is intentionally excluded from backup and comparison.
  • Traversal stays within a single filesystem (mount points are not crossed).
  • Directories containing a CACHEDIR.TAG file are skipped entirely.
  • Requires lsattr on $PATH for the show and verify commands.

Known bug

It only works with the root directory for now.