How does the kernel chooses the 'vfat' module for fat32 partitions?

Sudheer Divakaran inbox1.sudheer at gmail.com
Tue May 10 00:48:42 EDT 2011


Hi List,

I have one doubt regarding the component which determines that 'vfat'
module is the correct module to be used for accessing fat32 file
systems and how does vfat.ko  became the ideal candidate for accessing
fat32 partition? For example, even though my /etc/fstab doesn't
contain any entry for my usbstick, which is having a fat32 partition,
when I issued the command 'mount /dev/sdb1 /mnt/usb' after inserting
the usbstick,  I could see the following events in udevadm monitor
--kernel --udev' s output.  Pls note the lines

"KERNEL[1304999552.510965] add      /module/fat (module)
KERNEL[1304999552.516633] add      /module/vfat (module)"

[Questions]

1. Who makes the decision that vfat.ko is to be used for fat32
partitions? Is it kernel/udev or some other component?

2. How does the kernel or the module loader determines that 'vfat' is
the correct module to be used for accessing fat32 partition? AFAIK,
there is nothing similar to 'MODULE_DEVICE_TABLE' in vfat.ko's
sources, which maps partition type 'c' (partition type id for W95
FAT32) to vfat.ko (CMIIW) as in pci/usb drivers.

[udevadm monitor output]

KERNEL[1304999552.510965] add      /module/fat (module)
KERNEL[1304999552.512169] add      /kernel/slab/fat_cache (slab)
UDEV  [1304999552.512212] add      /module/fat (module)
KERNEL[1304999552.512239] add      /kernel/slab/fat_inode_cache (slab)
UDEV  [1304999552.512263] add      /kernel/slab/fat_cache (slab)
UDEV  [1304999552.512289] add      /kernel/slab/fat_inode_cache (slab)
KERNEL[1304999552.516633] add      /module/vfat (module)
UDEV  [1304999552.516861] add      /module/vfat (module)
KERNEL[1304999552.542026] add      /module/nls_cp437 (module)
UDEV  [1304999552.542267] add      /module/nls_cp437 (module)
KERNEL[1304999552.545320] add      /module/nls_iso8859_1 (module)
UDEV  [1304999552.545566] add      /module/nls_iso8859_1 (module)
[more entries...]

TIA,
-- 
Thanks
Sudheer



More information about the Kernelnewbies mailing list