On a USB Mass Storage Class device, is the block size equals to the cluster size? How to determine the cluster size of a usb drive?

StackOverflow https://stackoverflow.com/questions/13846174

  •  07-12-2021
  •  | 
  •  

سؤال

On a USB Mass Storage Class device (usb stick e.g. 4gb), how do you determine the 'cluster' size.

The cluster here, is taken from the context of Fat32 file system.

Using SCSI commands, I could determine the logical block size, i.e. 512 bytes. Is this the same as the cluster size? Can this be considered as cluster size?

For a diskless device like this, is cluster size still relevant?

Finally, what is the relationship between a logical block and a cluster, in this context?

هل كانت مفيدة؟

المحلول

  1. Logical block is whatever the device/device driver decides to expose to the operating system as the fundamental unit of transfer. NB: in the case of SSD's, this is hugely inefficient.
  2. Filesystems for the purpose of bookkeeping/performance manage allocation in terms of clusters which are typically power-of-two groups of logical sectors. Larger clusters means less bookkeeping but greater internal fragmentation.
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top