开发者

Is creating hardlinks from linux on a ntfs partition viable?

开发者 https://www.devze.com 2023-02-04 10:23 出处:网络
I have found a program that can make you save space by hardlinking files that are actually the same, thus leaving only one copy of the file on the file system with more than one hardlink pointing to i

I have found a program that can make you save space by hardlinking files that are actually the same, thus leaving only one copy of the file on the file system with more than one hardlink pointing to it. The program is called hardlink.

This is very nice as I have at last found a way to save space on my backup disk for old backups I have made before I knew about 开发者_Python百科rsync and incremental backups.

After such a lengthy introduction, any reader would expect a question, so here it is:

Would it be safe to use hardlinks to save space on a ntfs partition? The hardlinks would of course be created from Linux, using the hardlink program mentioned above. More precisely, will Windows (any version) be able to then use the files that would have been replaced by hardlinks?

Many thanks


There are hardlinks on Windows. They are created by the CreateHardLink system call in kernel32.dll. As to whether your hardlink program would work over remote shares, I wouldn't know, but a native one or one from cygwin would.

Now the real question is whether or not Windows programs handle them. Even Windows Explorer fails to calculate disk space used for hardlinks correctly.


I did a small test. Creating a hardlink (using 'ln TargetName LinkName') yields the same file at creation time, but after that the file and the hardlink content change independently. I would therefore discourage any use of unix based hard links on an NTFS partition. Use either an Ext4 partition (linux only) or software adapted for windows-like links on NTFS partitioning (windows software or perhaps some linux software if explicitly mentioned).


I guess that the program hardlink will either fail because hard links doesn’t exists on Windows or create Windows shortcuts.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号