cryfs icon indicating copy to clipboard operation
cryfs copied to clipboard

Hard Links

Open gsimondssd opened this issue 10 years ago • 7 comments

Is it possible to support hard links? This would be useful for applications such as rsnapshot.

Currently, when I try:

cryfs backend mount echo "test" > mount/test.txt ln mount/test.txt mount/link.txt

I get the following error:

ln: failed to create hard link 'mount/link.txt' => 'mount/test.txt': Numerical result out of range

If it matters, I'm running CryFS Version 0.9.3-alpha+38.g7b5970a

gsimondssd avatar Mar 31 '16 16:03 gsimondssd

Supporting hard links would need some redesign, but should be possible. I don't think CryFS will support it in the near future though.

smessmer avatar Mar 31 '16 22:03 smessmer

+1 to this feature. I perform backups to my NAS using Back In Time which very heavily uses hardlinks.

tgharib avatar May 04 '16 19:05 tgharib

However, is there any chance that we drop FUSE and use native directory instead? Cryfs can work like a sync client between plaintext-directory and ciphertext-directory. In my opinion,

  1. This simplified cryfs and addresses problems like: timestamp, hard link.
  2. Native directory is much more robust and share benefits of specific filesystem.
  3. This method keeps a plain backup on disk, thus leaves some room for critical errors (both user side and cryfs side). Since the point of cryfs is to keep sensitive data confidential on the cloud, the design should keep as much as data accessibility on the local side.

atYuguo avatar May 05 '16 04:05 atYuguo

That's an interesting idea and didn't occur to me before. I definitely see the advantages you're mentioning. A disadvantage would be that CryFS could then only be used for cloud synchronization and not for local encryption where you don't want the plaintext to be on your hard drive (e.g. to protect sensitive data against hard drive theft). It's also quite different from the current implementation and would need huge code rewrites. It's probably not worth it. Feel free to open a separate issue if you want to discuss further, let's keep this one for the hard links.

smessmer avatar May 05 '16 07:05 smessmer

One other thing I should add: if you ever do implement this feature, do you think you could implement it without using hardlinks in the encrypted mountpoint? encfs uses hardlinks on the encrypted side which makes the feature useless because very few cloud providers support hardlinks.

tgharib avatar May 09 '16 01:05 tgharib

Yes, an implementation would not have hard links in the base directory, because CryFS stores all file system information (also hard links) in encrypted ciphertext blocks. Storing these blocks in files on the local file system is only one possibility of doing that.

On 08.05.2016 18:21, Taha Gharib wrote:

One other thing I should add: if you ever do implement this feature, do you think you could implement it without using hardlinks in the encrypted mountpoint? encfs uses hardlinks on the encrypted side which makes the feature useless because very few cloud providers support hardlinks.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/cryfs/cryfs/issues/44#issuecomment-217758641

smessmer avatar May 09 '16 01:05 smessmer

Looks like there is a PR to fix this, although it was made from an older copy.

michael-ts avatar Jul 26 '20 19:07 michael-ts