Filesystem links on a FAT32 formatted storage

前端 未结 3 1118
耶瑟儿~
耶瑟儿~ 2021-02-05 03:58

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

相关标签:
3条回答
  • 2021-02-05 04:46

    MichaelPh posted instructions on SuperUser:

    https://superuser.com/a/486829/51237

    It's possible to use Disk Probe (on XP only, I've yet to get it to write the changes on Win7) to modify the cluster a FAT Directory references. This method can be used to redirect the DCIM folder (or a subfolder) to point to the folder used by a different scan device.

    Whether this is a good idea or not is a different matter and you use this at your own risk.

    1. Insert the Eye-Fi card either in it's USB Card Reader or directly into an SSD slot and note the drive letter it's installed as (assumed to be F:\ for simplicity)
    2. Ensure all Windows Explorer windows for the card and sub-directories are closed.
    3. Run Disk Probe
    4. Select Drives->Logical Volume
    5. In the Open Logical Volume dialog double-click F:\ in the Logical Volumes list
    6. Click the Set Active button for the Handle F: has been selected as. You can leave the handle as read-only for now.
    7. Select Tools->Search Sectors...
    8. Check Exhaustive Search, enter DCIM in Enter characters to search for and Search
    9. You should find a match (mine is at 8192). Select No on the "Found match..." dialog to cancel the rest of the search.
    10. Select Sectors->Read and increase Number of Sectors to at least two so that the whole directory table is included.
    11. Find DCIM in the ASCII on the right of the Disk Probe screen, this is the start of the FAT entry for the directory. Make a note of the hex value of the 27th byte of the record (each entry is 32bytes), this is the directory cluster reference. This value is require to revert the DCIM directory back to normal use if required.
    12. Find the entry for the directory you want to redirect DCIM to and again make a note of the 27th byte in the record.
    13. Go back to the 27th byte of the DCIM record and change it to the value noted in step 11.
    14. Select Sectors->Write and then click Write it on the Write Sector dialog. A warning will come up if you opened the sectors as read-only. Yes to overwrite if you're happy to make the change.

    Opening the DCIM directory in Windows Explorer will now show the contents of the target directory.

    0 讨论(0)
  • 2021-02-05 04:49

    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).

    0 讨论(0)
  • 2021-02-05 04:50

    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.

    0 讨论(0)
提交回复
热议问题