mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* SCSI removable devices problem
@ 2004-08-01 12:19 Giuliano Pochini
  2004-08-01 16:24 ` Randy.Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: Giuliano Pochini @ 2004-08-01 12:19 UTC (permalink / raw)
  To: Linux-kernel



It seems that 2.6.7 reads the partition table only once: when the scsi unit
is added to the list during boot or when I send the "add-single-device"
command. This is a problem with removable devices because if the drive
hasn't a disk inserted at boot time, attempting to mount a partitioned disk
always results in:

mount: /dev/sdb1 is not a valid block device

Also, bad things may happen (not tested) if a disk was in during boot and I
replace it with another one with a different partitioning.

As a workaround I have to send the "remove-single-device" command after
having unmounted a volume and "add-single-device" after I have inserted a
new one. I don't know when this problem was introduced, sorry.



--
Giuliano.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: SCSI removable devices problem
  2004-08-01 12:19 SCSI removable devices problem Giuliano Pochini
@ 2004-08-01 16:24 ` Randy.Dunlap
  2004-08-01 20:26   ` Toon van der Pas
  2004-08-08  9:39   ` Giuliano Pochini
  0 siblings, 2 replies; 4+ messages in thread
From: Randy.Dunlap @ 2004-08-01 16:24 UTC (permalink / raw)
  To: Giuliano Pochini; +Cc: linux-kernel

On Sun, 1 Aug 2004 14:19:31 +0200 Giuliano Pochini wrote:

| 
| 
| It seems that 2.6.7 reads the partition table only once: when the scsi unit
| is added to the list during boot or when I send the "add-single-device"
| command. This is a problem with removable devices because if the drive
| hasn't a disk inserted at boot time, attempting to mount a partitioned disk
| always results in:
| 
| mount: /dev/sdb1 is not a valid block device
| 
| Also, bad things may happen (not tested) if a disk was in during boot and I
| replace it with another one with a different partitioning.
| 
| As a workaround I have to send the "remove-single-device" command after
| having unmounted a volume and "add-single-device" after I have inserted a
| new one. I don't know when this problem was introduced, sorry.

I think that it's been this way for some time now...

Does using
	blockdev --rereadpt /dev/sdb1
help?

--
~Randy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: SCSI removable devices problem
  2004-08-01 16:24 ` Randy.Dunlap
@ 2004-08-01 20:26   ` Toon van der Pas
  2004-08-08  9:39   ` Giuliano Pochini
  1 sibling, 0 replies; 4+ messages in thread
From: Toon van der Pas @ 2004-08-01 20:26 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: linux-kernel

On Sun, Aug 01, 2004 at 09:24:21AM -0700, Randy.Dunlap wrote:
> On Sun, 1 Aug 2004 14:19:31 +0200 Giuliano Pochini wrote:
> 
> > mount: /dev/sdb1 is not a valid block device
> 
> I think that it's been this way for some time now...
> 
> Does using
> 	blockdev --rereadpt /dev/sdb1
> help?

You probably meant to write:
	blockdev --rereadpt /dev/sdb

Regards,
Toon.
-- 
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: SCSI removable devices problem
  2004-08-01 16:24 ` Randy.Dunlap
  2004-08-01 20:26   ` Toon van der Pas
@ 2004-08-08  9:39   ` Giuliano Pochini
  1 sibling, 0 replies; 4+ messages in thread
From: Giuliano Pochini @ 2004-08-08  9:39 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: linux-kernel

On Sun, 1 Aug 2004 09:24:21 -0700
"Randy.Dunlap" <rddunlap@osdl.org> wrote:

> On Sun, 1 Aug 2004 14:19:31 +0200 Giuliano Pochini wrote:
> 
> | 
> | 
> | It seems that 2.6.7 reads the partition table only once: when the scsi unit
> | is added to the list during boot or when I send the "add-single-device"
> | command. This is a problem with removable devices because if the drive
> | hasn't a disk inserted at boot time, attempting to mount a partitioned disk
> | always results in:
> | 
> | mount: /dev/sdb1 is not a valid block device
> | 
> | Also, bad things may happen (not tested) if a disk was in during boot and I
> | replace it with another one with a different partitioning.
> | 
> | As a workaround I have to send the "remove-single-device" command after
> | having unmounted a volume and "add-single-device" after I have inserted a
> | new one. I don't know when this problem was introduced, sorry.
> 
> I think that it's been this way for some time now...
> 
> Does using
> 	blockdev --rereadpt /dev/sdb1
> help?

Yes, that works.  But IIRC I didn't need that with linux 2.4. The kernel
should reread the table automatically when it receaves an UNIT_ATTENTION
message from the scsi bus.




--
Giuliano.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-08-08  9:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-01 12:19 SCSI removable devices problem Giuliano Pochini
2004-08-01 16:24 ` Randy.Dunlap
2004-08-01 20:26   ` Toon van der Pas
2004-08-08  9:39   ` Giuliano Pochini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®