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
.
Best Answer
"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.