FAT32 格式存储上的文件系统链接
我知道 FAT32 以及 FAT16/12 既不支持符号链接,也不支持硬链接。然而我想到了这个想法:
FAT 规范描述了每个文件都与一个目录条目相关联。根据我的理解,可以说目录中的文件条目以某种方式或其他指向文件的内容。
那么,如何定义两个指向相同文件内容的目录条目?或者,什么可以阻止我这样做?
用例:我的汽车收音机有一个 USB 大容量存储设备,我想使用目录作为播放列表,因为收音机软件不支持播放列表。因此,Windows 在执行此操作时的行为方式对我来说并不重要。
I know FAT32, as well as FAT16/12 neither support symbolic links nor hard-links. However I came up with this idea:
The FAT specification describes that every file is associated with a directory-entry. In my understanding, one could say that a file-entry in a directory somehow or other points to the file's content.
So, how can I define two directory-entries which point to the same file-content? Or, what could prevent me from doing so?
Use case: I have a USB mass storage device for my car radio, and I want to use directories as playlists since the radio software doesn't support playlists. So it isn't important to me how Windows behaves when doing this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您所说的(“两个指向相同文件内容的目录条目”)是硬链接。 chkdsk 会将它们报告为交叉链接并破坏它们,“修复”文件(实际上是制作副本)。
What you are talking about ("two directory-entries which are pointing to the same file-content") are hard links. chkdsk will report them as cross-links and break them, "repairing" the files (in fact making the copies).
这应该适用于简单的问题。即它作为一种黑客/解决方法,我不知道如果您重命名/移动/删除文件会发生什么。因此,您不应该在主硬盘上执行此操作。
我使用十六进制编辑器手动编辑目录条目。我修改了集群和文件大小并成功伪造了硬链接。我的汽车收音机甚至 Windows(7、64 位)在播放我使用的原始文件和“硬链接”mp3 文件时都没有问题。
当我在十六进制编辑器中再次打开设备时,我的任何修改都不会更改回来(请参阅答案#1中的 chkdsk 问题 - 但据我所知,无论如何,chkdsk 必须手动启动。
This should work for simple issues. I.e. it works as a hack / workaround and I don't know what happens if you rename / move / remove files. So, you should not do this on your main hdd.
I edited the directory-entries manually using a hex editor. I modified clusters as well as file-sizes and successfully faked hardlinks. My car-radio and even Windows (7, 64Bit) have no problems with playing back the original and "hard-linked" mp3-Files I used.
When I'm opening the device again in the hex-editor none of my modifications are changed back (See chkdsk issue in answer #1 - but as far as I know chkdsk has to be started manually, anyways.
MichaelPh 在 SuperUser 上发布了说明:
https://superuser.com/a/486829/51237
MichaelPh posted instructions on SuperUser:
https://superuser.com/a/486829/51237