Find the answer to your Linux question:
Results 1 to 5 of 5
Greetings, everyone. I have a question which may not seem very practical but nevertheless piqued my curiousity - is there a way to reintroduce a block device (e.g. an external ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2012
    Posts
    3

    Reintroduce a block device to Linux without reattaching it manually


    Greetings, everyone. I have a question which may not seem very practical but nevertheless piqued my curiousity - is there a way to reintroduce a block device (e.g. an external HDD) to Linux kernel without reattaching it manually? What I mean is not just umount and mount it again but rather go deeper - make the kernel "think" that the device is detached from the system and is attached again. Thanks in advance.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    Is there any particular reason why you want to do this? So, you want it to release the /dev/name such as /dev/sdn, and then reassign it at your command?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Jul 2012
    Posts
    3
    Thank you for reply, Rubberman.
    Is there any particular reason why you want to do this?
    It's a mere curiosity. Also, I'd like to understand better how the kernel discovers new hardware and configures it.
    So, you want it to release the /dev/name such as /dev/sdn, and then reassign it at your command?
    Well, sort of. Since I'm not familiar very well with Linux kernel's way of doing this work, I can't say if your words are exact paraphrase of my question. Simply put, I'm interested in "simulating" disconnection of a hardware using shell command or system call so it would appear to the OS as I physically reattached the device. Besides, it'd be convenient to make the kernel rediscover and automatically remount my external HDD without having to reattach it manually. I know that I can just remount it, but I'm looking for another way. In other words, I want more control over this process. It's always good to have more than 1 option.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    You might want to look at these resources for more information about this subject:

    1. Chapter*8.*Dynamic Kernel Device Management with udev
    2. http://www.kernel.org/doc/ols/2002/o...es-368-375.pdf

    FWIW, two sites that are very useful for learning about low-level Linux cruft are these:

    www.kernel.org
    www.tldp.org
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #5
    Just Joined!
    Join Date
    Jul 2012
    Posts
    3
    Much appreciated, Rubberman.

Posting Permissions

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