I have recently been using 2" spinning hard drives in USB carriers for archiving data.
When the drive is attached, the drive is recognized, and a device is automatically added to /dev.
I can then mount the drive either with the mount command or KDE’s device manager.
This is the expected behavior.
However, after I umount the drive, and disconnect the USB cable, the device STILL continues to show up
in the /dev list (and in the /dev/disk/by-label directory).
This does NOT happen when hot-plugging/unplugging SATA drives.
It is not a big problem, but the “phantom” drive left behind does cause some issues with a few scripts.
Is there some magic that I can do to have the /dev entry automatically removed when the drive is unplugged?
I am running Suse 12.3 64 bit & KDE on an ASUS Sabertooth motherboard. The USB ports used are USB-3.
As we are allways very suspicious about stories told by humans, but not backed by computer facts (after all we humans are not infallible, but computers are ), my question is: did you check it was realy unmounted before you disconnected?
So I normally connect using Dolphin and when done eject using Dolphin. I do not just unplug it. It is a two part process when followed seems to not leave you in a bad condition. Have you considered it is how you are doing it?
Device manager open with filemanager. Then select “Safely remove device” from Dolphin.
Command Line:mount /dev/sdf1 /mnt umount /dev/sdf1
(I tend to make use of the command line a bit more than the GUI).
Doesn’t matter what the procedure is.
The device stays in the /dev/ (and /dev/disk/by-label) directory when the power is removed.
> I’ve tried:
> Device manager open with filemanager. Then select “Safely remove
> device” from Dolphin.
> Command Line:mount /dev/sdf1 /mnt umount /dev/sdf1
> (I tend to make use of the command line a bit more than the GUI).
An umount should not remove the device from /dev. using the eject
command on the browser might. I do not know what is the CLI equivalent.
As long as the usb stick is plugged in, the device should be there.
> Doesn’t matter what the procedure is.
> The device stays in the /dev/ (and /dev/disk/by-label) directory when
> the power is removed.
But the USB socket provides power, and the device might be using it, and
thus, the system would still detect a device present.
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)
The “disconnect” message appears when the drive is re-powered. I’m assuming that somewhere some
code figured it had to disconnect the last connection before establishing a new one.
Some additional experimentation shows this to be a USB3 problem only.
Attaching and removing the same drive from a USB2 port performs as expected.
dmesg shows a USB disconnect when the cable is pulled. No such message shows up
for the USB3 port. Some important signal is not being acknowledged…
Since this system has more than one USB3 port, I’ve tried several of them, with the same results.
I’ve also played around with the few BIOS USB settings on the Motherboard, and none of them seem to change anything.
On Sun, 27 Oct 2013 22:46:02 +0000, richardrosa wrote:
> Some additional experimentation shows this to be a USB3 problem only.
That’s interesting. I’ve got a USB3 drive here (but it’s not connected
at the moment to my laptop, which has a USB3 port on it), but I wonder if
anyone else can reproduce that.
It could be you found a bug - in which case, you’ll want to report it
through bugzilla.novell.com. Login with the same credentials you use for
To work around it with scripts you’ve got that depend on checking the
existence, you might instead look at /etc/mtab or parse the output of the
mount command to see if the drive is mounted. Not a perfect solution,
but it should prove to be reliable until the issue is addressed.
I followed your excellent instructions, and loaded the latest & greatest kernel (3.12.0-rc6-1.gdb1113e-debug), and
voila! USB3 hard drive goes away when unplugged!
Unfortunately, my video driver (nvidia) doesn’t work so well with this kernel,
so I guess I’ll have to wait for the fix to go mainstream…
As I indicated, this is NOT a major problem, just a minor annoyance.