这很奇怪!我用udisks --detach /dev/sdb
它来安全移除我的硬盘。2 秒后硬盘自动安装,并弹出 nautilus 窗口。
这是 的输出udevadm monitor --udev
。
UDEV [67744.241650] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host7/target7:0:0/7:0:0:0/bsg/7:0:0:0 (bsg)
UDEV [67744.242272] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host7/target7:0:0/7:0:0:0/scsi_device/7:0:0:0 (scsi_device)
UDEV [67744.242308] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host7/target7:0:0/7:0:0:0/scsi_disk/7:0:0:0 (scsi_disk)
UDEV [67744.243365] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host7/target7:0:0/7:0:0:0/scsi_generic/sg2 (scsi_generic)
UDEV [67744.243399] remove /devices/virtual/bdi/8:16 (bdi)
UDEV [67744.243545] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host7/target7:0:0/7:0:0:0/block/sdb/sdb1 (block)
UDEV [67744.248425] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host7/target7:0:0/7:0:0:1/bsg/7:0:0:1 (bsg)
UDEV [67744.248520] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host7/target7:0:0/7:0:0:0/block/sdb (block)
UDEV [67744.248566] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host7/target7:0:0/7:0:0:0 (scsi)
UDEV [67744.248596] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host7/target7:0:0/7:0:0:1/enclosure/7:0:0:1 (enclosure)
UDEV [67744.248625] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host7/target7:0:0/7:0:0:1/scsi_device/7:0:0:1 (scsi_device)
UDEV [67744.248660] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host7/target7:0:0/7:0:0:1/scsi_generic/sg3 (scsi_generic)
UDEV [67744.248689] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host7/scsi_host/host7 (scsi_host)
UDEV [67744.252526] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host7/target7:0:0/7:0:0:1 (scsi)
UDEV [67744.252563] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host7/target7:0:0 (scsi)
UDEV [67744.252594] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host7 (scsi)
UDEV [67744.317378] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0 (usb)
UDEV [67744.339889] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3 (usb)
UDEV [67751.203840] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3 (usb)
UDEV [67751.205913] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0 (usb)
UDEV [67751.207203] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host8 (scsi)
UDEV [67751.208287] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host8/scsi_host/host8 (scsi_host)
UDEV [67752.183035] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host8/target8:0:0 (scsi)
UDEV [67752.183988] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host8/target8:0:0/8:0:0:0 (scsi)
UDEV [67752.184022] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host8/target8:0:0/8:0:0:1 (scsi)
UDEV [67752.184944] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host8/target8:0:0/8:0:0:0/scsi_device/8:0:0:0 (scsi_device)
UDEV [67752.184959] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host8/target8:0:0/8:0:0:1/scsi_device/8:0:0:1 (scsi_device)
UDEV [67752.185348] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host8/target8:0:0/8:0:0:0/scsi_generic/sg2 (scsi_generic)
UDEV [67752.185365] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host8/target8:0:0/8:0:0:1/scsi_generic/sg3 (scsi_generic)
UDEV [67752.185381] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host8/target8:0:0/8:0:0:0/bsg/8:0:0:0 (bsg)
UDEV [67752.185392] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3:1.0/host8/target8:0:0/8:0:0:0/scsi_disk/8:0:0:0 (scsi_disk)
UDEV [67755.138374] add /devices/virtual/bdi/8:16 (bdi)
UDEV [67755.140810] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.
如您所见,HDD 从系统中分离出来,然后又返回到系统中。在我移除它之后,内核添加了此设备。
任何想法都值得赞赏。
答案1
遗憾的是,没有解决方案!这是一个漏洞到目前为止还没有提出任何解决方案:(。
我研究了udev
规则,但一无所获。幸运的是,Ubuntu 10.04 中不存在此问题。