All of lore.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: Harald Seipp <SEIPP@de.ibm.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: remove-single-device removes mounted HDDs (kernel 2.6)
Date: Thu, 11 Aug 2005 21:55:41 +1000	[thread overview]
Message-ID: <42FB3CBD.6040006@torque.net> (raw)
In-Reply-To: <OFBC81092C.89B6F4D5-ONC125705A.00365E9F-C125705A.0037CB40@de.ibm.com>

Harald Seipp wrote:
> [ Please CC any replies; I am not on this list]
> 
> I have two systems, each with at least two SCSI HDDs attached&mounted:
> SLES 9 (2.6.5-7.151-smp)
> Knoppix 3.9 (2.6.11.10)
> If I execute echo "scsi remove-single-device h b t l" > /proc/scsi/scsi on
> a mounted HDD target, the device will be _removed_. A subsequent echo "scsi
> add-single-device h b t l" > /proc/scsi/scsi on the same target will cause
> the device to be re-added, but it will appear at a different (next free)
> device file (e.g. /dev/sda will become /dev/sdc when two HDDs are
> attached).
> This behavior does not appear when running kernel 2.4-based systems on the
> same machines, the mounted HDDs will not be touched.
> 
> I assume this is a bug? How can I prevent that behavior? 

Harald,
I just tried remove-single-device followed by
add-single-device and I got /dev/sda back again.
I also placed the two commands in a script file
so they were executed with a very short delay between
the two commands.

The test was with lk 2.6.13-rc6 and a multicard
reader (4 luns) via the usb-storage driver.

BTW in lk 2.6 a SCSI device can be removed with:
echo "anything" >
    /sys/class/scsi_device/<h>:<b>:<t>:<l>/device/delete

and re-added with:
echo "<b> <t> <l>" > /sys/class/scsi_host/host<h>/scan


> Can I easily query
> if a device on "h b t l" is mounted to work-around?

ls /sys/class/scsi_device/<h>:<b>:<t>:<l>

will indicate (in the lk 2.6 series) that SCSI device
"h b t l" is present or not. As for mounted file systems
on (partitions of) a disk when its is removed and re-added,
I'm not so sure: seems like a questionable procedure IMO.

Doug Gilbert

  reply	other threads:[~2005-08-11 11:55 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-11 10:09 remove-single-device removes mounted HDDs (kernel 2.6) Harald Seipp
2005-08-11 11:55 ` Douglas Gilbert [this message]
2005-08-11 16:57   ` Harald Seipp
2005-08-11 13:59 ` James Bottomley
2005-08-11 14:32   ` Harald Seipp
2005-08-11 14:46     ` Matthew Wilcox
2005-08-11 14:51     ` James Bottomley
2005-08-11 15:44       ` Harald Seipp
2005-08-11 16:40         ` Christoph Hellwig
2005-08-11 16:50           ` Harald Seipp
2005-09-06 11:43             ` Christoph Hellwig
2005-08-11 17:47         ` Bryan Henderson
2005-08-12  8:59           ` Harald Seipp
  -- strict thread matches above, loose matches on Subject: below --
2005-08-11 15:51 Salyzyn, Mark
2005-08-11 16:07 ` James Bottomley
2005-08-11 17:40   ` Bryan Henderson
2005-08-11 22:06     ` Stefan Richter
2005-08-11 16:37 Salyzyn, Mark
2005-08-11 16:53 ` James Bottomley
2005-08-11 17:05 Salyzyn, Mark
2005-08-11 17:52 ` James Bottomley
2005-08-12 11:36 Salyzyn, Mark
2005-08-12 15:07 corene
2005-09-06 21:28 [RFC] SCSI target for IBM Power5 LPAR Dave C Boutcher
2005-09-07 10:49 ` Christoph Hellwig
2005-09-07 12:45   ` Dave C Boutcher
2005-09-07 12:58     ` FUJITA Tomonori
2005-09-07 17:17       ` Mike Christie
2005-09-07 17:48         ` remove-single-device removes mounted HDDs (kernel 2.6) Steve Byan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42FB3CBD.6040006@torque.net \
    --to=dougg@torque.net \
    --cc=SEIPP@de.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.