Whenever I plug an USB mass storage device into the system, I get uevents like these from the kernel. (as shown by udevadm monitor)
KERNEL[104397.739313] add /devices/pci0000:00/0000:00:14.0/usb3/3-6 (usb)
KERNEL[104397.740141] add /devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6:1.0 (usb)
KERNEL[104397.740787] add /devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6:1.0/host48 (scsi)
KERNEL[104397.741362] add /devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6:1.0/host48/scsi_host/host48 (scsi_host)
KERNEL[104399.210661] add /devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6:1.0/host48/target48:0:0 (scsi)
KERNEL[104399.211095] add /devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6:1.0/host48/target48:0:0/48:0:0:0 (scsi)
KERNEL[104399.211502] add /devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6:1.0/host48/target48:0:0/48:0:0:0/scsi_disk/48:0:0:0 (scsi_disk)
KERNEL[104399.211757] add /devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6:1.0/host48/target48:0:0/48:0:0:0/scsi_device/48:0:0:0 (scsi_device)
KERNEL[104399.212464] add /devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6:1.0/host48/target48:0:0/48:0:0:0/scsi_generic/sg1 (scsi_generic)
KERNEL[104399.212743] add /devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6:1.0/host48/target48:0:0/48:0:0:0/bsg/48:0:0:0 (bsg)
KERNEL[104399.215444] add /devices/virtual/bdi/8:16 (bdi)
KERNEL[104399.220099] add /devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6:1.0/host48/target48:0:0/48:0:0:0/block/sdb (block)
KERNEL[104399.220181] add /devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6:1.0/host48/target48:0:0/48:0:0:0/block/sdb/sdb1 (block)
I need to attach the USB device to a KVM as soon as possible, and while udev rules allows me to call a script that does the attaching, the kernel processing still takes place automatically. I'd like to prevent that from happening. Would this be possible with udev or some other mechanism?