[SOLVED] Salvaging chunks from lost+found

Aug 2, 2022
10
2
8
Hi,

My filesystem went FUBAR, nuked a couple of directories, and dumped their contents in lost+found, and the files are named after their inode.
How do i generate the SHA-256 digest that the filename is generated from, so I can move them back to the correct directory.

According to the documentation the chunk contains a header and footer, and the sha-256 sum is generated from everything in between.


Happy new year,
René
 
you can use "proxmox-backup-debug inspect chunk":

Code:
$ cp /tank/pbs/.chunks/fe90/fe9059f5dbe49c9d502c3aff716cda1ebb9eb829a181d90597d8ba6dc2a8b78a /tmp/chunk

$ proxmox-backup-debug inspect chunk /tmp/chunk --use-filename-as-digest false --decode /tmp/decoded; sha256sum /tmp/decoded
CRC: "1772557324(OK)"
encryption: "none"
fe9059f5dbe49c9d502c3aff716cda1ebb9eb829a181d90597d8ba6dc2a8b78a  /tmp/decoded

replace paths accordingly ;) if your chunks are encrypted, you also need to specify the keyfile for decoding to work (the digest is based on the raw input data, not the encrypted chunk!)