Possible to skip the restore scan?

I’m on the latest build of Restic. Doing a restore + verify. I figure the answer is “no”, but is there any way to skip the initial file counting before the restore? This snapshot is full of small files, about ~1.5TB total. It’s been going for 94 hours and hasn’t even started to restore anything yet. :smiling_face_with_tear:

Source is a Thunderbolt 3 SSD ~2900MB/s. Target is a HDD, but yeah it hasn’t even gotten that far yet. Not complaining - just making sure I’m not missing something obvious like --no-scan for restores. Or if that would be possible, I’m seeing if it’s a feasible feature request. I figure it’s necessary for the restore, but on the off-chance I’m wrong… lol :slight_smile:

Stats:
Total File Count: 19696980
Total Size: 1.498 TiB

1 Like

Hi @akrabu ,

as per my knowledge the answer is no. The reason is based on the following design of restic restore:

  1. List all files in the snapshot
  2. Identity from the index which packfiles must be restored and map it to files identified in 1.
  3. As packfiles are retrieved and processed; the files are written in to.
  4. Apply metadata to all the files by reading the tree blobs

The above is what I have figured out from working on the code base.

The issue here maybe that it’s storing 19696980 file paths in memory and then has to build the index to pack mapping before triggering retrieval. (I am also thinking some of this data in memory gets paged and adds to the issue; this is a random guess, I am not an expert)

i will have a look at the code, maybe some performance improvements can be done here. Instead of —noscan maybe adding more threads might help.

1 Like

Hi @konidev20!

Yeah, I figured as much. It is using a fair amount of RAM, but it doesn’t look like the pressure is too bad.

There are some restic github issues with some cool info: Restores could be even faster · Issue #2074 · restic/restic · GitHub

Check it out you might find something interesting.

2 Likes