I know this question is not going to help anyone, but I am curious. As far as I know, hard links will not break when a file is deleted. Because the file will remain to exist. But what happens when you mount a file system to /mnt (or /media for that matter), create a hard link to a file on that volume, unmount the volume, and then try to open the hard link?

I know it very easy to try and see it for myself, but I got into some pretty serious problems (read: loss of entire C drive) by messing with the internal workings of files in Windows (protip: do not encrypt the key of an encrypted file using that file as its key), and I know that Ubuntu is not Windows (duh) but I don't really want to have that happen to me again. And I know that this doesn't have much to do with encryption, but still.


You cannot create hardlinks across mount boundaries. You'll get something like:

ln: failed to create hard link ‘X’ => ‘Y’: Invalid cross-device link

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.