cppcryptfs
cppcryptfs copied to clipboard
File names not valid or too long
Hello,
First of all sorry if this was documented before, i did search but could not find anything.
I succesfully can use the reverse mode but every time i try to copy the reverse mounted volume to another location i get an error on some files that the file name is too long or not valid. Mounting in reverse gives no problems. I use Windows 7 and NFTS filesystem. I tried fiddling with the "long names setting" but this did not help. Does anyone have an idea on how to fix this? I read the documents again and it seems reverse mode was meant exactly for what i'm trying to do.
Many thanks in advance, Phil
EDIT: i think it's more "not valid" than "too long". I just searched for a file that gave the error. There were longer names that copied fine. Tried also other ways of copying (robocopy, fastcopy etc) but thet generate these errors also.
I'm sorry for the delay in replying.
I think there are two problems.
The first problem seems to be that named streams don't work in reverse mode.
A named stream is like a file within a file. They're not used that much in Windows, and I've never encountered any application that uses them for storing useful data. The only use of them that I'm aware of is for tagging files as downloaded from the internet so applications can open them in "safe mode". Browsers add this tag to some downloaded file types. PDF's for sure, and I think also MS Office files.
E.g. on this PDF I downloaded from nasa.
C:\tmp>streams64 nasa.pdf
streams v1.60 - Reveal NTFS alternate streams. Copyright (C) 2005-2016 Mark Russinovich Sysinternals - www.sysinternals.com
C:\tmp\nasa.pdf: :Zone.Identifier:$DATA 87
The Zone.Identifer named stream indicates where it was downloaded from
C:\tmp>type nasa.pdf:Zone.Identifier [ZoneTransfer] ZoneId=3 HostUrl=https://www.hq.nasa.gov/alsj/a17/A17_FlightPlan.pdf
If you lose all the named streams, it probably won't hurt anything.
When you create a cppcryptfs filesystem (forward or reverse), you can specify if you want to disable named streams. It's a check box on the create filesystem tab.
To solve this on your reverse filesystem, go to the root of it and delete .gocryptfs.reverse.conf
e.g. mine is in c:\tmp, so in a CMD console window do (change C: to the drive letter and \tmp to the path where your reverse fs is
c: cd \tmp attrib -h -r .gocryptfs.reverse.conf del .gocryptfs.reverse.conf
Then re-create the reverse filesystem with disable named streams checked.
Another way would be to use the attrib command above to make .gocryptfs.reverse.conf not hidden and not read only, then edit with notepad and change the line that says
"FsFeatureDisableMask": "00000",
To be
"FsFeatureDisableMask": "40000",
The 40000 will disable named streams the next time the filesystem is mounted.
The second problem is that the names do in fact get too long for Windows Explorer. NTFS supports individual file names up to 256 characters long. It also supports entire paths of up to 32,000 chars. But Windows Explorer is still limited to the old path length limit of 260 characters.
To copy the reverse filesystem where the paths get too long, you need to use a copy program that handles long NTFS paths. Robocopy is one such tool. It comes with Windows. I searched and it says it came with Windows 7.
If you use Robocopy, then you can copy the long paths. e.g. I copied the mounted reverse filesystem on n: to c:\revtestcopy
robocopy /S /E n:\ c:\revtestcopy
The filesystem had disable named streams, and it was still failing in to copy in Windows Explorer but Robocopy worked.
Note: if the reverse filesystem doesn't have disable named streams on, then robocopy will silently fail to copy the files with named streams.
There are other file manager programs for Windows that handle long paths.
Thank you Bailey. Will try again!