Kindly give a detailed answer. Suppose I have a laptop and a pen-drive, and I insert the pen-drive into the laptop, how do I determine whether the particular pndrive is being used in the system for the first time or not?
If you're talking about Windows, this is most-likely due to plug-n-play support. When an unrecognized device is detected (I think primarily using Device ID + Hardware IDs + Compatible IDs, though Vendor_ID and Product_ID might also be used), Windows automatically searches for a driver to install. Though most pen drives just use generic mass storage device drivers, it still has to perform this search process.