5
2
I have a 200 gig Encfs encrypted file system living in my Dropbox and being accessed by multiple machines, and I've never had any problems with it until now.
I moved about 10 gigs of data around on one (ubuntu) computer X, and 2 days later when the sync had finished on another (ubuntu) computer Y there were some problems: some of the files cannot be read on Y and give me Input/Output errors, e.g.
$ file myfile.txt
myfile.txt: ERROR: cannot read `myfile.txt' (Input/output error)
So somehow the file system has been corrupted. All the files can be read fine on computer X. I've run into about 20 files with this property; there could be more. In a directory typically only a few files will fail with this error, and many more will be fine.
I also have the system running on a Windows machine Z; I looked at the files in Z and I also got IO errors (although the Windows error messages were rather more cryptic). So in some sense the problem is almost certainly "at X's end".
I have managed to navigate to a directory in the actual encrypted Dropbox directory which corresponds to a directory where the input/output errors are occurring. All the (encrypted) files can be read fine, so the problem doesn't seem to be an actual IO error with the physical disc, the problem seems to be with encfs.
I have all the data backed up and I could simply delete it all and rewrite it, but the non-corrupted copy is on a system that has a very slow upload speed (it's in my home) and it took 2 days to sync; I'm reluctant to restart (not because I don't have 2 days, but because I don't want to basically make my home internet sluggish for 2 days).
Google has not led me to anything. I am at a loss to know what to do next, short of "restart and try again" which as I say I'm currently hoping to avoid. I don't really understand how a file system can be stored in a directory so I don't know how to start debugging the problem.
If I do have to restart can someone tell me a nice way to check which files in a directory have IO errors?? Edit: in the end I used a horrible way -- run file
on each file, using find
, and then hacking my way to a list of bad files using grep and emacs using a method which won't work if any files are called things like "output error" :-)
EDIT (one year later): I have lived with this issue for over a year now. I have been using malte's workaround. However last week, for the first time ever, I actually lost data. I made substantial changes in an encfs directory, I did nothing weird other than moving data around, and then my nightly script (which, I might add, takes over an hour to run with a lot of disc reading, every night, on both the ubuntu machines where I have Dropbox and Encfs running) told me that certain files were giving I/O errors at both ends. I had to restore the files using Dropbox's "restore deleted files" functionality, which was a pain because of course all the filenames are encrypted so I had to use encfsctl
etc.
This prompted me into action. So I bit the bullet and set up a second Encfs directory, this time with different global settings (I do not know how to change these settings in a given encfs directory and I am pretty sure it's impossible, so the only way I could do this, as far as I could see, was to copy the now 300 gigs from one directory to another; I had to do this now because when I get up to 500 gigs I won't be able to store two copies in my dropbox which has a limit of 1000 gigs).
So what did I do? I set up another encrypted file storage system using no filename initialisation vector chaining, no per-file initialisation vectors and no external IV chaining. Yes I know this is less secure! Yes I know this doesn't work for everyone! Yes I even know that a security audit on Encfs came to the conclusion that I should not store 100,000 userids, passwords and credit card details using Encfs! But this is not what I am using encfs for. All I want to do is to use Dropbox but to ensure that if Dropbox is hacked, or there is a disgruntled Dropbox employee who leaks data, then my data is not the stuff being sold on. I do not have munitions-grade secrets here, I just have photos of my family and work-related stuff like references which I don't want to be randomly leaked.
While I am here, let me mention some other links that I have found in the last year which may, or may not, be relevant to this issue. I do not understand enough about how FUSE works to know. But given that this is my question and this has been a major problem for me for 1 year now, I thought I would use this question as a personal collection of what I had discovered about his and possibly related issues.
https://stackoverflow.com/questions/24966676/transport-endpoint-is-not-connected
https://github.com/vdudouyt/mhddfs-nosegfault
https://github.com/vgough/encfs/issues/109
And also the suggestion to use fsck
on the encfs directory.
I am not enough of an expert to know whether any of these are relevant. What I do know is that as of yesterday I have "started again" with Encfs, and I will report back in a couple of months about whether this has fixed the problem for me.
UPDATE Two years later I can now confidently state that changing these Encfs file settings has fixed the problem, at the cost of possibly weakening my security. I've had no I/O errors since I made these changes in my set-up.
EncFS has some logging that could be helpful, and possibly look into hard drive bad sectors or possible failure on the problem computer ("Y" maybe?) – Xen2050 – 2015-10-01T12:59:59.817
1I still live in fear of this problem :-( and am still none the wiser of what causes it. – eric – 2015-12-23T14:03:02.617
@eric I find it frustrating too, hence the bounty. Still not sure how to fix. – Andrew Ferrier – 2015-12-26T17:43:19.240
Due to security vulnerabilities found in the current version, using Encfs in a Dropbox is not secure. See https://www.cryfs.org/comparison#encfs for details.
– Heinzi – 2016-02-13T18:09:47.097@Heinzi: that might be true, but this is not the question. I don't want my data to be munitions grade secure, I just want it to be much less interesting to a random person who hacked Dropbox and wants to sell stuff on, than all the unencrypted stuff. – eric – 2016-10-25T21:40:04.063