Back up, restore, and verify Linux filesystem inode flags (as reported by
lsattr/chattr)
- Go 100%
| .gitignore | ||
| CLAUDE.md | ||
| fixattr.go | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| README.md | ||
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_COWflag (C) is intentionally excluded from backup and comparison. - Traversal stays within a single filesystem (mount points are not crossed).
- Directories containing a
CACHEDIR.TAGfile are skipped entirely. - Requires
lsattron$PATHfor theshowandverifycommands.
Known bug
It only works with the root directory for now.