How does PC know what kind of file system the mass storage device has?

Apr 26, 2005 4 Replies

After reading the "USB Mass Storage Class Bulk-Only Transport" specification, I got a concept about the transmission protocol between my desktop PC and some portable USB devices such as external HDD and external DVD-RW. Despite this, I have no idea about how my desktop can understand the content in the storage media of the mass storage device. We know the file system is different between HDD and DVD-RW. Moreover, the file system of a optical disc maybe one of ISO9660, UDF or UDF bridge...etc. I think after the USB cable is attached, the device firmware can tell desktop its manufactory information to let desktop know it is a HDD, CD-RW or DVD-RW. But, how does PC know what kind of file system the device has?



Could anybody give me any hint or reference document?


It reads the important sector locations from the disk and tries to recognize the filesystem.

Maxim Shatskih, Windows DDK MVP StorageCraft Corporation maxim@storagecraft.com http://www.storagecraft.com

The USB bulk-only transport is used to carry SCSI commands and responses. The SCSI INQUIRY command returns information about the type of device, as well as manufacturer and product information.

dpANS Project T10/1236-D SCSI Primary Commands - 2

Once you crank it up, its just reading blocks (typically 512 bytes each).

The MBR (Master Boot Record) describes the partitioning and individual partitions contain various file-systems,

Michael N. Moran (h) 770 516 7918 5009 Old Field Ct. (c) 678 521 5460 Kennesaw, GA, USA 30144 http://mnmoran.org "So often times it happens, that we live our lives in chains and we never even know we have the key." The Eagles, "Already Gone" The Beatles were wrong: 1 & 1 & 1 is 1

But, as my understanding, the "important sector" is different between HDD and optical disc. For HDD, we can get file system parameters from sector 0 but for disc, we might need sector 16 to recognize its file system. Because PC only can use UFI commands(like SCSI commands) to communicate with device, does PC know which sector it should request after it knows what kind of peripheral the device is? I guess there should be a scheme which defines what data PC should request at first. However, I don't know how to find related articles efficiently by Google yet.

The OS kernel - be it Windows or UNIX - enumerates all filesystems and asks each one to mount. If the FS returned OK - then all is done. If the FS returned error - then the next FS is tried.

UNIX also supports only trying a particular filesystem, Windows does not.

So, FSs execute the recognition sequence themselves, and are free to issue any reads they want. CDFS will read sector 16. UDF will read sectors 256, N and N -

256. FAT will read sector 0, and so on.

All of this is the issue of the OS kernel, not of the hardware. Hardware can only execute CDBs.

Maxim Shatskih, Windows DDK MVP StorageCraft Corporation maxim@storagecraft.com http://www.storagecraft.com

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required