1bup-fsck(1) bup-fsck(1)
2
3
4
6 bup-fsck - verify or repair a bup repository
7
9 bup fsck [-r] [-g] [-v] [--quick] [-j jobs] [--par2-ok] [--dis‐
10 able-par2] [filenames...]
11
13 bup fsck is a tool for validating bup repositories in the same way that
14 git fsck validates git repositories.
15
16 It can also generate and/or use “recovery blocks” using the par2(1)
17 tool (if you have it installed). This allows you to recover from dam‐
18 aged blocks covering up to 5% of your .pack files.
19
20 In a normal backup system, damaged blocks are less important, because
21 there tends to be enough data duplicated between backup sets that a
22 single damaged backup set is non-critical. In a deduplicating backup
23 system like bup, however, no block is ever stored more than once, even
24 if it is used in every single backup. If that block were to be unre‐
25 coverable, all your backup sets would be damaged at once. Thus, it's
26 important to be able to verify the integrity of your backups and recov‐
27 er from disk errors if they occur.
28
29 WARNING: bup fsck's recovery features are not available unless you have
30 the free par2(1) package installed on your bup server.
31
32 WARNING: bup fsck obviously cannot recover from a complete disk fail‐
33 ure. If your backups are important, you need to carefully consider re‐
34 dundancy (such as using RAID for multi-disk redundancy, or making
35 off-site backups for site redundancy).
36
38 -r, --repair
39 attempt to repair any damaged packs using existing recovery
40 blocks. (Requires par2(1).)
41
42 -g, --generate
43 generate recovery blocks for any packs that don't already have
44 them. (Requires par2(1).)
45
46 -v, --verbose
47 increase verbosity (can be used more than once).
48
49 --quick
50 don't run a full git verify-pack on each pack file; instead just
51 check the final checksum. This can cause a significant speedup
52 with no obvious decrease in reliability. However, you may want
53 to avoid this option if you're paranoid. Has no effect on packs
54 that already have recovery information.
55
56 -j, --jobs=numjobs
57 maximum number of pack verifications to run at a time. The op‐
58 timal value for this option depends how fast your CPU can verify
59 packs vs. your disk throughput. If you run too many jobs at
60 once, your disk will get saturated by seeking back and forth be‐
61 tween files and performance will actually decrease, even if
62 numjobs is less than the number of CPU cores on your system.
63 You can experiment with this option to find the optimal value.
64
65 --par2-ok
66 immediately return 0 if par2(1) is installed and working, or 1
67 otherwise. Do not actually check anything.
68
69 --disable-par2
70 pretend that par2(1) is not installed, and ignore all recovery
71 blocks.
72
74 # generate recovery blocks for all packs that don't
75 # have them
76 bup fsck -g
77
78 # generate recovery blocks for a particular pack
79 bup fsck -g ~/.bup/objects/pack/153a1420cb1c8*.pack
80
81 # check all packs for correctness (can be very slow!)
82 bup fsck
83
84 # check all packs for correctness and recover any
85 # damaged ones
86 bup fsck -r
87
88 # check a particular pack for correctness and recover
89 # it if damaged
90 bup fsck -r ~/.bup/objects/pack/153a1420cb1c8*.pack
91
92 # check if recovery blocks are available on this system
93 if bup fsck --par2-ok; then
94 echo "par2 is ok"
95 fi
96
98 bup-damage(1), fsck(1), git-fsck(1)
99
101 Part of the bup(1) suite.
102
104 Avery Pennarun <apenwarr@gmail.com>.
105
106
107
108Bup 0.29.2 2018-10-20 bup-fsck(1)