Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add the ability to check and fix the errors in gocryptfs file system #191

Closed
yanjiew1 opened this issue Jan 7, 2018 · 16 comments

Comments

@yanjiew1
Copy link

yanjiew1 commented Jan 7, 2018

Sometimes, the file system may be corrupted due to the bad cloud synchronizing apps or provider as well as memory error or silent bit rot on the disk.

Checking and fixing errors in the gocryptfs file system may be a good feature.

@rfjakob
Copy link
Owner

rfjakob commented Jan 7, 2018 via email

@rfjakob
Copy link
Owner

rfjakob commented Mar 23, 2018

For now, @yahesh posted this a quickl way to check the files in a mounted directory: #221 (comment)

find . -type f -exec shasum {} \; | grep "shasum:"

@rfjakob
Copy link
Owner

rfjakob commented Apr 2, 2018

The -fsck feature is almost done - read-only, though! The users will have to fix errors (and/or delete corrupt files) themselves.

If you want to test-drive it, it's available in the fsck branch,

git remote update
git checkout fsck
./build.bash

@rfjakob rfjakob closed this as completed in 4e57835 Apr 3, 2018
@rfjakob
Copy link
Owner

rfjakob commented Apr 3, 2018

Merged to master.

@pos42
Copy link

pos42 commented Aug 27, 2018

Will the fsck be distributed with the binary package? Or do I have to build it myself?

Asking as I think it should be included in the gocryptfs binary itself or at least be distributed along with the gocryptfs binary.

@pos42
Copy link

pos42 commented Aug 27, 2018

I see... You have added it to the binary, but not added it to "gocryptfs --help"

@rfjakob
Copy link
Owner

rfjakob commented Aug 28, 2018

Hmm yes, fsck should probably be in the short help

@pos42
Copy link

pos42 commented Aug 28, 2018

Is it still read only in 1.6?

@rfjakob
Copy link
Owner

rfjakob commented Aug 28, 2018

Yes

@pos42
Copy link

pos42 commented Aug 28, 2018

Can we expect it to be non read only in the future? Timeframe? Asking as I am starting to put a lot of stuff in my rocket fast gocryptfs folders (love it…). The best overlay encryption out there... I would like to see something like Cryptomator:s ”sanitizer".

Two days ago I had a problem where a few folders within my gocryptfs could not be deleted. Probably due to cloud problems. This was a head ace.

So I am waiting for a writeable fsck version to be able to trust it even more… OR instruction of how to handle the read only version with manual repair. But it you have many errors a manual repair is not optimal.

Love your work with gocryptfs !

@rfjakob
Copy link
Owner

rfjakob commented Aug 28, 2018

About "fixing" corruption... The thing is, in general there is not much that can be done but deleting the corrupt file. Would this still be useful for you?

@rfjakob
Copy link
Owner

rfjakob commented Aug 28, 2018

Or better, move the corrupt file to a lost+found folder. That should work. Maybe for 1.7!

@pos42
Copy link

pos42 commented Aug 28, 2018

Yes

Great idea!

If you consider a file dead and it is locked and can´t be deleted, what could you do? Create a new gocryptfs folder or just leave it there for ever? If it cannot be removed, sync programs like rsync could give errors every time as well as the file is not deletable.

So an fsck that asks about deletion of corrupted files would be great (and move them to lost+found). Perhaps a "-y" flag to it if it is many like std fsck.

@pos42
Copy link

pos42 commented Aug 28, 2018

B t w

You should reconsider regarding std paypal donations to the project. Maybe call it a "wife flower" fund to be used because all hours you spent on this.

@rfjakob
Copy link
Owner

rfjakob commented Sep 23, 2018

I have created a new ticket for this at #263

@dumblob
Copy link

dumblob commented Oct 16, 2021

What'll happen if the bitrot affected a directory node. Will the whole subtree become unreachable forever (i.e. potentially the whole mountpoint)?

Or is there any way to recover those files in quick/performant way (I don't consider recovery from backup to fall into this category)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants