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