Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Sometimes when I hotplug a SATA device to/from say /dev/sdb, it malfunctions/times out, and cannot be detected. Then when I plug in another SATA device, it gets detected as /dev/sdc even though /dev/sdb is no longer there. How can I reclaim /dev/sdb in this case?
If your removing a device and it's not umounted properly or something is still accessing it the device will malfunction like that. It's the same concept in this thread:
I'm aware of /dev/sdx being a raw node, but as in the usb drive if you have anything using the raw node even to your liking or not it won't cleanly be removed just as not unmounting does the same problem. I'm just saying if you used programs that accessed the node you might want to check and make sure the program is done running/not using the node any more.
I'm saying this because I used to work with ipods/usb/removable media a lot when I was in college and this problem was a lot more annoying back then. USB media is mounted as a hdx, if for some reason it didn't unmount properly I would get hda/hdb/hdc/hdd/hde..... untill I rebooted. If I wanted to keep it from doing so I had to be extra carefull and make sure it wasn't mounted and all programs were done using the device. Though this happened more with Ipods it's the same subject, they aren't anything more than a small HDD.
[edit] just thought about the no fs, you might have something running that's trying to automount or detect the fs while your unplugging the device hence making it in use and not being removed properly?
Last edited by mushroomboy; 08-14-2009 at 06:01 AM.
I don't have anything that accesses it/mounting it. The only application that accesses the drive does it directly via ioctl calls or write()/read() calls.
In any case, this isn't a USB drive, but rather a SATA drive that I'm hot-swapping. From my experience this works fine as long as I give the system enough time to realize that the old drive was unplugged, before I plug in a new(or same) drive. If I don't wait for this to happen, the new drive will get the next alphabet, i.e. /dev/sdc in this case. However, the problem I have now is that even with sufficient time, /dev/sdb is unavailable, and the device is not being detected at all(fdisk and udevmonitor both show nothing) until I reboot the system. It seems that the system has some volatile memory of that device and is disallowing it from being detected.
Having to restart your computer gives the idea of 2 things, either your hardware isn't working up to par or your scripts that access the drive aren't running proper any more due to some hickup. And again I state something is accessing the drive. If something is being activly accessed in it linux locks it, and I know you know this. Why don't you see what happens if you don't run any of your scrips or anything and plug in a drive for a while then unplug it and see if the /dev node dissapears. If so you'll have your answer, it's as simple as that. Unless the only application your refrencing to would be the nix itself, but somehow I doubt that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.