My library was unavailable and I ran a ./seaf-fsck.sh --repair on my server.
This command replaced the size of all files in my libraries to 0 byte files.
Now that my library is available, I’d like to recover these files ('cause if I try to download them, I’m just downloading 0 byte files).
I tried to run ./seaf-fsck.sh --repair but the program didn’t find any errors and didn’t change anything.
Since version 4.2.0, you can use seaf-fsck to export all the files in libraries to external file system (such as Ext4). This procedure doesn’t rely on the seafile database. As long as you have your seafile-data directory, you can always export your files from Seafile to external file system.
The command syntax is
cd seafile-server-latest
./seaf-fsck.sh --export top_export_path [library-id1] [library-id2] …
The argument top_export_path is a directory to place the exported files. Each library will be exported as a sub-directory of the export path. If you don’t specify library ids, all libraries will be exported.
Currently only un-encrypted libraries can be exported. Encrypted libraries will be skipped.
@DerDanilo I’m not sure if this is a bug, I don’t know what is the expected behavior of seaf-fsck in that case.
@arjones85 This is not gonna work in ;y case as the libraries I want to export are encrypted. Also, if I export the files I will be able to get back the files. However, I would have to re-import them into Seafile. What I want to do is to fix the imported libraries.
Also, the libraries I’m using are using a Object Storage backend (Amazon S3-like, but with the Openstack swift API).
When viewing a snapshot there is a recover button on the top right. I think that is what you need.
Looks like seaf-fsck created a new commit where all files are empty and choose it as the most recent one. There are no logs from running seaf-fsck, are there? That looks a bit like seaf-fsck was not able to access the stored blocks which led it believe they would be lost.
Works like a charm ! I Didn’t know this was possible.
Thank you so much @shoeper
That’s exactly what seaf-fsck did.
But I don’t have anymore the logs from seaf-fsck. I just remember there was lines saying “Replacing with 0 byte files”.