Giter Club home page Giter Club logo

Comments (3)

msuhanov avatar msuhanov commented on July 28, 2024 1

You can use Arsenal Image Mounter to emulate a 4Kn device for a given disk image.

from ntfs.

ColinFinck avatar ColinFinck commented on July 28, 2024

Thanks for the report! I confirm that this is a bug in the current code.
While tightening record and sector sizes for #2, I also looked into cluster sizes again and found https://dfir.ru/2019/04/23/ntfs-large-clusters/. That basically confirms your analysis and your PR #13.
Back then, I lacked a test image with 2 MiB clusters and Windows didn't want to format my VHD image with 2 MiB clusters. Perhaps my VHD was simply too small. Anyway, thanks for also attaching a test image so I can reproduce.
I also just stumbled upon https://github.com/msuhanov/ntfs-samples. More images for testing :)

I currently have some local changes in my code for #2 and #10 and want to finish them before I can deal with #13.

I'm also looking for NTFS filesystems with non-standard sector sizes. Windows always creates NTFS filesystems with 512-byte sectors for me. NTFS-3G has code to support other sector sizes, but Windows does not accept my NTFS-3G formatted images with non-standard sector sizes.
If you manage to create an NTFS image with an unusual sector size that is accepted by Windows, I would be highly interested :)

from ntfs.

leofidus avatar leofidus commented on July 28, 2024

The ntfs-samples repository looks really useful, that's a great find. I was thinking of doing basically the same thing for the test images I now have lying around (mine are far more harmless, just cluster sizes, a couple hardlinks, softlinks etc).

I'm also looking for NTFS filesystems with non-standard sector sizes

I just went down the rabbit hole of other-than-512-byte sector sizes. I also failed creating a file system that is recognized by Windows. Diving a bit deeper, it seems Windows imposes three limits on the sector size: it has to be at most the page size of the system (not sure how this interacts with large pages), be a multiple of 256, and it must match the sector size of the device.

The last requirement is the crux of the matter: every device emulates a 512 byte sector size, so that's the only value that works. Seemingly the only exception from this century are 4k native/512e drives that expose a 4096 byte sector size. It's mostly an enterprise thing, but apparently some consumer NVMe SSDs can be configured to run that way. I expect if one sets an SSD to a 4096 byte sector size and formats it with NTFS one would get a 4096 byte sector size in the BiosParameterBlock, and that would also be the only value that allows Windows to mount that file system from that disk.

I don't have any modern spare NVMe SSD lying around, so I can't readily test it in the real world.

from ntfs.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.