bup-fsck(1)
π bup-fsck β verify or repair a bup repository π
okay bestie, welcome to bup-fsck, aka the manual to bup fsck (same thing, one's the page one's the command, don't think about it too hard β¨). it lives in the bup suite and it's basically your repo's personal hype-checker β it looks at your data and goes "girlβ¦ is this ok?" so you don't find out the hard way. let's GO π«Ά
β¨ SYNOPSIS β¨
bup fsck [-r] [-g] [-v] [--quick] [-j jobs] [--par2-ok] [--disable-par2]
[packfile...]
π DESCRIPTION π
so when you hand it packfiles (and btw they must end in .pack, that's the rule π
), the pack-related operations get limited to just those files. no packfiles given? then it considers every single packfile in the current repository, all of them, the whole squad.
rn, bup fsck checks the data in the repository for corruption. more specifically, it checks the integrity of the data packfiles and their corresponding indexes to make sure they haven't changed since they were written. what it does not do is check higher level concerns like connectivity (missing objects) β like, whether all the data referred to by a save actually exists in the repository. for some of those higher level checks, go look at bup-validate-object-links(1) and bup-validate-refs(1). the way i'd put it: bup fsck's whole thing is detecting and potentially repairing file corruption, while those higher level problems are more likely to be caused by bugs (hopefully rarer ones π).
when it's checking packfiles and indexes, right now fsck will normally rely on git-verify-pack(1). but with --quick (more on that below), bup will just check the index and packfile checksums itself. lowkey efficient.
to allow repairs, fsck has to be asked via --generate to generate par2(1) "recovery blocks" (if you have it installed π). these blocks let you recover from damage affecting up to 5% of your .pack files. iconic tbh.
here's the tea on why this matters. in a normal backup system, damaged blocks are less important, because there tends to be enough data duplicated between backup sets that a single damaged backup set is non-critical. in a deduplicating backup system like bup, however, no block is ever stored more than once, even if it is used in every single backup. so if that block were to be unrecoverable, all your backup sets would be damaged at once π. thus, it's important to be able to verify the integrity of your backups and recover from disk errors if they occur. periodt.
when attempting to --repair, bup will exit with status 1 if and only if repairs were needed and were successful, and there were no other errors.
β οΈ WARNING: bup fsck obviously cannot recover from a complete disk failure. if your backups are important, you need to carefully consider redundancy (such as using RAID for multi-disk redundancy, or making off-site backups for site redundancy). no cap, think about this one.
when asked to examine all packfiles (i.e. when no packfiles are specified), fsck will report any files that appear to be related to a pack file that no longer exists π». previous versions of bup gc can cause this to happen because they did not remove all of the related files when removing a pack file.
π₯ OPTIONS π₯
-r,--repairβ attempt to repair any damaged packs using existing recovery blocks. (requirespar2(1).)-g,--generateβ generate recovery blocks for any packs that don't already have them. (requirespar2(1).)-v,--verboseβ increase verbosity (can be used more than once, pile it on π ).--quickβ don't run a fullgit verify-packon each pack file; instead just check the final checksum. this can cause a significant speedup with no obvious decrease in reliability β¨. however, you may want to avoid this option if you're paranoid. has no effect on packs that already have recovery information.-j,--jobs=numjobsβ maximum number of pack verifications to run at a time. the optimal value for this option depends how fast your CPU can verify packs vs. your disk throughput. if you run too many jobs at once, your disk will get saturated by seeking back and forth between files and performance will actually decrease β even ifnumjobsis less than the number of CPU cores on your system π. you can experiment with this option to find the optimal value.--par2-okβ immediately return0ifpar2(1)is installed and working, or1otherwise. do not actually check anything. it's just a vibe check on par2 itself, that's all.--disable-par2β pretend thatpar2(1)is not installed, and ignore all recovery blocks. gaslighting, but make it config.
π EXAMPLES π
# generate recovery blocks for all packs that don't
# have them
bup fsck -g
# generate recovery blocks for a particular pack
bup fsck -g ~/.bup/objects/pack/153a1420cb1c8*.pack
# check all packs for correctness (can be very slow!)
bup fsck
# check all packs for correctness and recover any
# damaged ones
bup fsck -r
# check a particular pack for correctness and recover
# it if damaged
bup fsck -r ~/.bup/objects/pack/153a1420cb1c8*.pack
# check if recovery blocks are available on this system
if bup fsck --par2-ok; then
echo "par2 is ok"
fi
β EXIT STATUS β
exits with 1 if --repair was requested, needed, successful, and there were no other errors. otherwise exits with 0 if there were no errors, and a value other than zero or one for errors. yes you read that right, main character exit codes only π
π SEE ALSO π
bup-damage(1), fsck(1), git-fsck(1), bup-validate-object-links(1), and bup-validate-refs(1)
π§ BUP π§
part of the bup(1) suite. the whole little family π«Ά
π AUTHORS π
Avery Pennarun apenwarr@gmail.com
Bup 0.34 Β· 2026-09-01 β mwah, that's the version and the date, go forth and verify your packs bestie πβ¨π
π¦ where this page comes from
- fedora 44: bup 0.34-1.fc44 Β· LGPL-2.0-only
- nixpkgs unstable: bup 0.34
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms