What does repack-small do?

Say you backed up initially with the default pack size (16 MiB). It isn’t a “hard limit” so yes, pack sizes could possibly be up to 18 MiB or so, but will generally “average out” to 16 MiB.

Now say you’ve started using a pack size of 128 MiB, either with “RESTIC_PACK_SIZE=128” or “–pack-size 128”

Finally, say you wish the old 16 MiB packs weren’t so… small… and you’d like to… repack them… to a larger pack size (128 MiB).

That’s what --repack-small does. It will repack packs smaller than the current RESTIC_PACK_SIZE or --pack-size setting (it’s worth noting switches always take priority over environment variables). :slight_smile:

The main reason to do this is if you think you might run into issues with too many files (number of files, not size of files) with a certain backend. Or if your local backend is struggling to enumerate a high number of files in a folder (think an APFS volume on a spinning SMR drive, which is notoriously slow on directory enumeration :fearful:). Raising the pack size limit will stuff more files into one pack (it will pack multiple small files into one pack, and split overly large files to occupy the pack). By using a larger pack size, you’ll decrease the sheer number of packs necessary to store your data.

Downsize is, when you have to prune, you may need to rewrite more packs than you would with a smaller pack size - which may be costly or time consuming depending on your backend.

3 Likes