mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Slootman <paul@wurtel.net>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] SCSI disk won't spinup, so boot hangs
Date: Wed, 12 Jul 2006 16:14:41 +0200	[thread overview]
Message-ID: <20060712141441.GA16473@wurtel.net> (raw)

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;
+		}
 	}
 }
 

             reply	other threads:[~2006-07-12 14:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-12 14:14 Paul Slootman [this message]
2006-07-12 14:48 ` Erik Mouw
2006-07-18 12:47   ` Paul Slootman

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=20060712141441.GA16473@wurtel.net \
    --to=paul@wurtel.net \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome