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

fsck direct file fix #268

Closed
pos42 opened this issue Oct 12, 2018 · 1 comment
Closed

fsck direct file fix #268

pos42 opened this issue Oct 12, 2018 · 1 comment

Comments

@pos42
Copy link

pos42 commented Oct 12, 2018

Hi

I use version 1.6 where the earlier added fsck feature exist in a basic "detect but don't fix" version, but invisible as it is missing from the man page...
[huey@xanadu ~]# gocryptfs --help|grep -i fsck
[huey@xanadu ~]#

But when @rfjakob mentioned it existed, I have used it one time a few weeks back to track and manually fixed what it found. Worked :) During cloud sync with huge files I guess the probability for errors is higher.

I have a 500GB backup volume in the cloud. When I have seen it stall (happened 2-3 times). Then stuff like this could repeatedly be seen in the syslog where I assume we have corruption.
Oct 12 00:13:12 cloud-storage gocryptfs[1695]: #33[33mdoWrite: Write failed: write /data/pcloud/pCloudDrive/gocryptfs-encrypted/fHRWPg9Ai75eCaLHu4mEFA6fWm3WZjziugmLOs6EwBw/MsFsKr9rOze3z6qwzdEVPw/o-Ev2Q3tUSIbVgHtMr9Fuw/Wgre5HkCkvBMQfZPaZZbtA/_nHco9Yz6ijnVoaWzErj4Q/Nw4HagAMnoKrurRV0soPHg/-pVCShvGMjf3TF6tbdcOEBv-v5ToM_JPn4V0qZQFP0M: interrupted system call#033[0m

Running fsck with...
[huey@xanadu ~]$ gocryptfs -fsck /data/xxxx/yyyy/gocryptfs-encrypted
Password:
Decrypting master key

Now wait until you die<<< (it works though...)

Question:
Is it meaningless to be able to do like this to directly specify a sub path if you know where the error is as it told you in syslog? Asking as You don't have to wait for ever when trying to fix errors.
gocryptfs -fsck /data/xxxx/yyyyy/gocryptfs-encrypted/fHRWPg9Ai75eCaLHu4mEFA6fWm3WZjziugmLOs6EwBw/MsFsKr9rOze3z6qwzdEVPw/

This is however not working as it looks for the conf file... But it could easily be solved by looking for the conf file in parent directories..
Cannot open config file: open /data/xxxxx/yyyyy/gocryptfs-encrypted/fHRWPg9Ai75eCaLHu4mEFA6fWm3WZjziugmLOs6EwBw/MsFsKr9rOze3z6qwzdEVPw/gocryptfs.conf: no such file or directory

Just looking for a way to solve corruption in huge file structures faster when I have the info from syslog that gocryptfs wrote there....

As I don't know if I have missed something obvious I would have posted this in a forum first, if you had one for gocryptfs. If I have missed something obvious or so, just close this :)

/Peo

@rfjakob
Copy link
Owner

rfjakob commented May 17, 2020

I think this can now be done as follows:

  1. Mount gocryptfs with -ctlsock /tmp/gocryptfs.sock
  2. Run
echo fHRWPg9Ai75eCaLHu4mEFA6fWm3WZjziugmLOs6EwBw/MsFsKr9rOze3z6qwzdEVPw/o-Ev2Q3tUSIbVgHtMr9Fuw/Wgre5HkCkvBMQfZPaZZbtA/_nHco9Yz6ijnVoaWzErj4Q/Nw4HagAMnoKrurRV0soPHg/-pVCShvGMjf3TF6tbdcOEBv-v5ToM_JPn4V0qZQFP0M \
 |  gocryptfs-xray -decrypt-paths /tmp/gocryptfs.sock

to find the plaintext file
3) Run ddrescue on the plaintext file

@rfjakob rfjakob closed this as completed May 17, 2020
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

2 participants