Find the answer to your Linux question:
Results 1 to 6 of 6
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Apr 2008
    Posts
    127

    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

  2. #2
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    I'm not sure, but wonder if restarting udev would do it?
    oz

  3. #3
    Linux Newbie
    Join Date
    Apr 2008
    Posts
    127
    How would I do that? Thanks.

  4. #4
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    Different distributions use different methods for restarting udev. What distro are you running?

    You might also be able to setup some custom udev rules so that you don't loose any devices along the way.
    oz

  5. #5
    Linux Newbie
    Join Date
    Apr 2007
    Posts
    214
    I may be wrong, but I think that creating specific udev rules may help. I don't know much about how to go about doing it though. Here's how it works for an external USB hdd:

    Code:
    BUS=="usb", KERNEL=="sd?1", ATTRS{manufacturer}=="Sunplus Technology Inc.", ATTRS{serial}=="0", NAME="%k", SYMLINK="usbhdd1"
    or alternatively

    Code:
    BUS=="usb", KERNEL=="sd?1", SYSFS{manufacturer}=="", NAME="%k", SYMLINK+="usbhdd1"
    You don't copy it as it is, but you rather have to set the proper values according to the output of a command like:

    udevinfo -a -p $(udevinfo -q path -n /dev/sdc)

    Or whatever is the "name" it gets at the time instead of sdc.
    Source.

    This is saved at /etc/udev/rules.d/10-local.rules



    But if it does not look crispy clear to you, "how I didn't think of this before", wait for someone else more knowedgeable than me to comment on it.

  6. #6
    Linux Newbie
    Join Date
    Apr 2008
    Posts
    127
    OK, how would I also quicken the process of the kernel finding out that a SATA device has been unplugged?

    Let's say I have a SATA drive that I connect to 1 of the SATA ports. The kernel will see it(a popup appears) and fdisk will be able to see it as well. When I unplug it, it takes a few seconds for fdisk to register that it's not there anymore. Is there anything I can command I can run to speed this up?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •