This is the output:
I think you'd better use e2fsck.new instead of e2fsck.sh
Is there also a command for copying?
dd if=/dev/sda2 of=/i-data/46f5cf6d/admin/Copy_of_sda2 bs=64M
This will copy the whole content of /dev/sda2 to a file /i-data/46f5cf6d/admin/Copy_of_sda2 (should show up in your admin share), using a memory buffer of 64MiB.
I don't think the copy speed will exceed 50MB/sec, so do the math.
The command has to run as root, as anyone else doesn't have the permission to read a raw block device.
To revert simply exchange the if and of (inputfile and outputfile) values. BTW, when using dd, always doublecheck the value of of=, as dd will happily overwrite anything
you offer as target.
Most of the files are indeed photos, then there are a lot of documents and some multimedia files like music or videos. Most of them I could find on the list for PhotoRec. If some files/ Metadata gets lost its ok, I have an old backup, which might cover about 60% of the files, I have stored on the 2tb disk.
In that case you can give PhotoRec a shot. Theoretically it can run on the NAS, but as it omits filesystem data, you can also run it on one of the other supported platforms. (Windows, MacOS).
I think I can provide a script which can filter out (after
restoring them) the 60% which is already in backup. (A simple dedup should do. Maybe while ignoring the last 4kB, as both the originals as the restored files might have or have not padding bytes at the end.
Ideally (when you have storage room enough) the sequence would be:
- Create a binary backup.
- Let PhotoRec restore whatever it can.
- Do an attempt to repair on /dev/md0. If that fails, and the disk content is changed, put back the backup.
- Do an attempt to repair on /dev/sda2. If that fails, and the disk content is changed, put back the backup.
- Do an attempt to repair on several offsets on /dev/sda2.
If one of the repair attempts succeed, you can probably drop all PhotoRec data.
It is possible to install a newer version of e2fsck on the NAS, by installing Entware-ng, and installing e2fs-tools on that. I don't know if that will give better repair results.