mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] SCSI disk won't spinup, so boot hangs
@ 2006-07-12 14:14 Paul Slootman
  2006-07-12 14:48 ` Erik Mouw
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Slootman @ 2006-07-12 14:14 UTC (permalink / raw)
  To: linux-kernel

I was recently confronted by a SCSI disk that had crashed somehow
("mechanical positioning error" during the first signs of trouble). The
kernel hung after that, despite the fact that everything was on RAID-1
and the first disk still was working...

I rebooted the system (remote powerboot, as I was 150km away). Now the
SCSI BIOS hung on scanning the SCSI bus. "No problem", I thought, and
disabled the BIOS scan for ID 1. Now grub appeared, and the kernel got
loaded. However, now the "Spinning up disk..." message failed after 100s
with the message "not responding...". The scan proceeded to try to read
the capacity, and that hung indefinitely. Only by driving to the
location and physically pulling the disk could I get the machine up and
running again.

I reasoned that if the spinup fails, it doesn't make much sense to try
and read the capacity, the partition tables, etc..  Hence I came up with
the patch below that sets media_present to 0 when the spinup doesn't
respond. It works for me (TM); there may be a better way, however the
current behaviour sucks big time.

Patch is against 2.6.17.4, although that code doesn't seem to have been
changed much recently.


Paul Slootman

Signed-Off-By: Paul Slootman <paul@wurtel.net>

--- a/drivers/scsi/sd.c.orig	2006-07-06 20:02:28.000000000 +0000
+++ a/drivers/scsi/sd.c	2006-07-12 13:53:26.000000000 +0000
@@ -1139,8 +1139,15 @@
 	if (spintime) {
 		if (scsi_status_is_good(the_result))
 			printk("ready\n");
-		else
+		else {
 			printk("not responding...\n");
+			/*
+			 * if unit is not responding, assume there's no media
+			 * either; this prevents endless delays in reading
+			 * capacity later on (BTDT)
+			 */
+			sdkp->media_present = 0;
+		}
 	}
 }
 

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

* Re: [PATCH] SCSI disk won't spinup, so boot hangs
  2006-07-12 14:14 [PATCH] SCSI disk won't spinup, so boot hangs Paul Slootman
@ 2006-07-12 14:48 ` Erik Mouw
  2006-07-18 12:47   ` Paul Slootman
  0 siblings, 1 reply; 3+ messages in thread
From: Erik Mouw @ 2006-07-12 14:48 UTC (permalink / raw)
  To: linux-kernel

On Wed, Jul 12, 2006 at 04:14:41PM +0200, Paul Slootman wrote:
> I was recently confronted by a SCSI disk that had crashed somehow
> ("mechanical positioning error" during the first signs of trouble). The
> kernel hung after that, despite the fact that everything was on RAID-1
> and the first disk still was working...

Sounds like a worn bearing or a head crash.

> I rebooted the system (remote powerboot, as I was 150km away). Now the
> SCSI BIOS hung on scanning the SCSI bus. "No problem", I thought, and
> disabled the BIOS scan for ID 1. Now grub appeared, and the kernel got
> loaded. However, now the "Spinning up disk..." message failed after 100s
> with the message "not responding...". The scan proceeded to try to read
> the capacity, and that hung indefinitely. Only by driving to the
> location and physically pulling the disk could I get the machine up and
> running again.
> 
> I reasoned that if the spinup fails, it doesn't make much sense to try
> and read the capacity, the partition tables, etc..  Hence I came up with
> the patch below that sets media_present to 0 when the spinup doesn't
> respond. It works for me (TM); there may be a better way, however the
> current behaviour sucks big time.

I've seen disks where the 100s timeout is not enough and which only
came into a useful state after 10 minutes or even longer. Your patch
would make those disks useless, even though they can be used. Also I'm
not sure your patch is the right approach: a disk doesn't have
removable media and yet it reports that there's no media present.


Erik

-- 
+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands

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

* Re: [PATCH] SCSI disk won't spinup, so boot hangs
  2006-07-12 14:48 ` Erik Mouw
@ 2006-07-18 12:47   ` Paul Slootman
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Slootman @ 2006-07-18 12:47 UTC (permalink / raw)
  To: linux-kernel

Erik Mouw  <erik@harddisk-recovery.com> wrote:
>On Wed, Jul 12, 2006 at 04:14:41PM +0200, Paul Slootman wrote:
>> I was recently confronted by a SCSI disk that had crashed somehow
>> ("mechanical positioning error" during the first signs of trouble). The
>> kernel hung after that, despite the fact that everything was on RAID-1
>> and the first disk still was working...
>
>Sounds like a worn bearing or a head crash.

Probably a head crash, this was a 5 month old 15krpm 73GB scsi disk.

>> I reasoned that if the spinup fails, it doesn't make much sense to try
>> and read the capacity, the partition tables, etc..  Hence I came up with
>> the patch below that sets media_present to 0 when the spinup doesn't
>> respond. It works for me (TM); there may be a better way, however the
>> current behaviour sucks big time.
>
>I've seen disks where the 100s timeout is not enough and which only
>came into a useful state after 10 minutes or even longer. Your patch

I'd consider disks that take 10 minutes or more to become ready
extremely obsolete :-)

>would make those disks useless, even though they can be used. Also I'm

Not really, wait your 10 minutes, echo "scsi remove-single-device a b c
d" > /proc/scsi/scsi; echo "scsi add-single-device a b c d" >
/proc/scsi/scsi; and there it is.

>not sure your patch is the right approach: a disk doesn't have
>removable media and yet it reports that there's no media present.

For all intents and purposes, the media isn't there...
Do you really think that the current behaviour (wait until eternity for
the drive to become ready on read capacity) to be the correct behaviour?
If so, why bother with the delay (of max. 100s) until spinup? Simply
issue the spinup command, and start trying to read the capacity would be
enough then.


Paul Slootman


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

end of thread, other threads:[~2006-07-18 12:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-12 14:14 [PATCH] SCSI disk won't spinup, so boot hangs Paul Slootman
2006-07-12 14:48 ` Erik Mouw
2006-07-18 12:47   ` Paul Slootman

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

Powered by JetHome