6

For example, I have a volume with the following info extracted from ntfsinfo:

$ sudo ntfsinfo -m /dev/sdb1
Volume Information
        Name of device: /dev/sdb1
        Device state: 11
        Volume Name: Photos 250GB
        Volume State: 27
        Volume Version: 3.1
        Sector Size: 512
        Cluster Size: 65536
        Index Block Size: 4096
        Volume Size in Clusters: 3815583

which was previously created via:

$ sudo mkfs.ntfs -c 65536 -Q -L "Photos 250GB" /dev/sdb1

I've read that cluster size is the same as allocation unit size in Windows. And so I'm expecting files to take up at least 64KB, as it would in Windows. However, this doesn't seem to be apparent from invoking stat on a small file:

$ stat lsfsdf
  File: `lsfsdf'
  Size: 9               Blocks: 1          IO Block: 4096   regular file
Device: 811h/2065d      Inode: 80          Links: 1

I'm trying to make sense out of it all, and so wish know what sector size, cluster size and index block size are in the volume information output by ntfsinfo.

4

"Sector size" describes the size of the atomic unit of the storage device itself. "Cluster size" descries the atomic unit of NTFS allocation for non-resident streams (see below). Index blocks are used to store directories. "Index block size" describes the size of the atomic unit of index block storage.

You're seeing sub-cluster allocation for small files because of resident streams. Small files are stored directly in the master file table (MFT) (a "resident stream") and do not require a cluster to be allocated.

2
  • Thank you for the explanation. I've verified that the number of blocks do become 128 (128*512=65536) upon reaching a file size of 600+, and interestingly 2 just right before the threshold. By the way, is the index block size of 4096 a fixed parameter for any given device (or specific to ntfs maybe)? I don't see any parameter for changing it in mkfs.ntfs. – silvernightstar Oct 3 '13 at 6:08
  • 1
    The index block size is a stored parameter that could be changed but I'm not aware of any mechanism in Windows (the canonical NTFS implementation) to do so. I think you'd be risking compatibility w/ Windows if you did tweak it. – Evan Anderson Oct 3 '13 at 16:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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