LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-13-2009, 09:11 PM   #1
galapogos
Member
 
Registered: May 2008
Posts: 227

Rep: Reputation: 30
How to reclaim device name after malfunction?


Hi

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?

Thanks
 
Old 08-13-2009, 09:20 PM   #2
vishesh
Member
 
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661

Rep: Reputation: 66
Are you sure that your hardware is ok ?
use
#udevmonitor
to monitor device node assignment

thnks
 
Old 08-13-2009, 10:40 PM   #3
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by vishesh View Post
Are you sure that your hardware is ok ?
use
#udevmonitor
to monitor device node assignment

thnks
Once the device malfunctions, I get no add notifications when I connect it. However once I restart the PC it works again.
 
Old 08-14-2009, 12:02 AM   #4
mushroomboy
Member
 
Registered: Jan 2006
Distribution: Debian Testing ALWAYS!!!
Posts: 363

Rep: Reputation: 43
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:

http://www.linuxquestions.org/questi...t-icon-747385/
 
Old 08-14-2009, 05:20 AM   #5
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
The drive wasn't mounted in the first place. It's a raw drive with no data/file system in it.
 
Old 08-14-2009, 05:59 AM   #6
mushroomboy
Member
 
Registered: Jan 2006
Distribution: Debian Testing ALWAYS!!!
Posts: 363

Rep: Reputation: 43
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.
 
Old 08-14-2009, 08:59 AM   #7
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
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.
 
Old 08-14-2009, 09:23 AM   #8
mushroomboy
Member
 
Registered: Jan 2006
Distribution: Debian Testing ALWAYS!!!
Posts: 363

Rep: Reputation: 43
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
reclaim disk space darasen Linux - General 1 12-04-2007 03:38 PM
space reclaim yusufs Linux - Newbie 2 11-28-2007 11:45 AM
Linux space reclaim yusufs Linux - General 2 10-28-2007 04:15 AM
Reclaim HD space. muskrat SUSE / openSUSE 3 07-07-2007 11:08 PM
How to reclaim ethernet card monte Linux - Newbie 3 06-12-2003 02:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 09:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration