Alexey
August 20, 2023, 3:09am
3
You may try this to recover pieces:
Wrote some Python code here to extract the path. I tested it on some of my piece files and couldn’t find one for which the computed file name was wrong, but obviously no warranties and your node might as well disqualify the moment you run this code
Have fun.
in conjunction with
You can try to modify line 77 of the python script so that the output for each file will be a copy or a move command. For example, instead of having for each file the output:
“File lost+found/#92559603 should probably go do ukfu6bhbboxilvt7jrwlqk7y2tapb5d2r2tsmj2sjxvw5qaaaaaa/y5/a7ok7l6xcujgiudtnpo6a2bnu5lptbe35je2n5khp5isi43tqq.sj1”
you will get:
“cp your_PATH_lost+found/#100010469 PATH_TO_BLOBS/pmw6tvzmf2jv6giyybmmvl4o2ahqlaldsaeha4yx74n5aaaaaaaa/7w/f2xfjrqkmlooj5sbp6hougk7jjpssdl36rxfvitanfc7xsoyaq.sj1”
After modifying the script, assign the lost+found path to the variable files_to_scan (line 8 of the script)
files_to_scan = ‘your_PATH_lost+found/*’
Run the script and redirect the output to a file:
python3 script > file.sh
Open the file.sh. Its content will be for example:
“cp your_PATH_lost+found/#124399501 PATH_TO_BLOBS/ukfu6bhbboxilvt7jrwlqk7y2tapb5d2r2tsmj2sjxvw5qaaaaaa/f7/7elfswbyhvzmtfdiqpmf6nkeiejcrnpqsah2gweltaf3oywd5a.sj1”
you would get a script for PowerShell (just use ps1
extension instead of sh
) to recover pieces.
I guess you would need to change permissions for these files to match permissions of other files in the blobs
folder.
1 Like