USB hard drive not showing up under /dev/
One way to resolve this issue would be to trigger udev to rescan devices. Here's an example of the command and an excerpt of the relevant output. (the -v
is for verbose)
If you've changed any of the udev rules you should begin with:
sudo udevadm control --reload-rules
sudo udevadm trigger -v
/sys/devices/pci0000:00/0000:00:1d.0/usb2
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-0:1.0
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host6
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host6/scsi_host/host6
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host6/target6:0:0
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host6/target6:0:0/6:0:0:0
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host6/target6:0:0/6:0:0:0/block/sdd
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host6/target6:0:0/6:0:0:0/block/sdd/sdd1
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host6/target6:0:0/6:0:0:0/block/sdd/sdd2
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host6/target6:0:0/6:0:0:0/bsg/6:0:0:0
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host6/target6:0:0/6:0:0:0/scsi_device/6:0:0:0
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host6/target6:0:0/6:0:0:0/scsi_disk/6:0:0:0
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/host6/target6:0:0/6:0:0:0/scsi_generic/sg4
/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.0
Note that your actual output will by far exceed this as udev will rescan everything in /sys/devices/
Note: According to my tests (watching the output of udevadm monitor
), sudo
is required. No errors will appear if you leave it out, but nothing will happen either.
Further note: Tests were conducted on a mostly idle system and no ill effects were detected. I have not tested this approach on a system under heavy load. Full disclosure as I've seen strange results on systems under heavy load in the past.
You can narrow the effects to a specific device utilizing the --attr-match=
switch.
To obtain the attributes that you can use for your specific device issue the command udevadm info -q all -n /dev/sXY
where /dev/sXY
is your block device. mine was /dev/sdd
.
Another more targeted approach is to echo change | sudo tee /sys/block/sdd/sdd1/uevent
(where sdd is your drive and sdd1 is your partition).
The positive side of this approach is the precise targeting of the device. The negative side being that you have to actually know what device you are targeting.
Sources:
https://unix.stackexchange.com/questions/39370/how-to-reload-udev-rules-without-reboot
https://unix.stackexchange.com/questions/124817/udev-how-do-i-find-out-which-subsystem-a-device-belongs-to