[ltp] scsi vs ata ?

Dan Sawyer linux-thinkpad@linux-thinkpad.org
Sat, 21 Jun 2008 14:39:47 -0700


This is a multi-part message in MIME format.
--------------080505010800030500050606
Content-Type: text/plain; charset=windows-1251; format=flowed
Content-Transfer-Encoding: 7bit

Thanks for the instructions! Those all work, except there is no libata. 
The unload works.

If I execute the echo > /sys/.../delete and then run the script it works.

However if I run the script it hangs. I have put echo writes in and even 
with the hang it completes the script.

Dan

Dmitry E. Mikhailov wrote:
> On Saturday 21 June 2008 07:17:18 am Dan Sawyer wrote:
>   
>> Thanks for the reply,
>>
>> I am using the scripts at:
>>
>> http://www.thinkwiki.org/wiki/How_to_hotswap_UltraBay_devices
>>     
>
> Really nice script!
>
>   
>> The eject gets to the beep at the end of the script. No files have been
>> loaded so the only relevant steps are 4 and 5. Are they part of the scrip?
>>     
>
> I think the best way to test is doing everything by hand.
>
> So, 1st is to connect bay with HDD to the laptop. It doesn't matter what's on 
> that HDD, we wouldn't even try mounting it.
>
> Boot single-user: add option 'single' (with no quotes) to your kernel 
> parameters at boot time. That would allow us to remove any possible 
> interference from automount services etc.
>
> Once you got root commandline, check that you have ata_piix module:
> [root@ibm ~]# lsmod|grep piix
> ata_piix               20996  3
> libata                140752  1 ata_piix
>
> Take an initial look at your /dev/ dir. It could look like this:
> [root@ibm ~]# ls /dev/sd*
> /dev/sda  /dev/sda1  /dev/sda2  /dev/sda3
>
> Then flush caches and instruct kernel (SCSI hostadapter1) to detect the drive.
> [root@ibm ~]# sync
> [root@ibm ~]# echo 0 0 0 > /sys/class/scsi_host/host1/scan
>
> Then take a look at /dev again: it should find new sdb:
> [root@ibm ~]# ls /dev/sd*
> /dev/sda  /dev/sda1  /dev/sda2  /dev/sda3  /dev/sdb  /dev/sdb1
>
> If /dev/sdb exists, then drive is found. It's time to try hot-removing it.
>
> We'll skip the part of script which unmounts filesystems because we don't 
> mount it.
>
> Now instruct kernel to remove the drive.
>
> [root@ibm ~]# echo 1 > /sys/class/scsi_device/1:0:0:0/device/delete
>
> Check /dev to be sure the drive is removed. It should look just like the 
> initial one:
> [root@ibm ~]# ls /dev/sd*
> /dev/sda  /dev/sda1  /dev/sda2  /dev/sda3
>
> If /dev/sdb dissapeared, it's time to pray and trigger dock removal.
> [root@ibm ~]# echo eject > /proc/acpi/ibm/bay
>
> my laptop has no bay device compiled into custom kernel, so I got this:
> -bash: /proc/acpi/ibm/bay: No such file or directory
> If you got the same, you also don't have it so don't try to physically remove 
> the drive. You need to recompile the kernel. Otherwise try undocking. And 
> post the results. After issuing dock eject command, but before physically 
> undocking the drive, save your kernel messages (you can't post them 
> immediately because in single user mode you won't get Xwin or network).
> [root@ibm scsi_host]# dmesg>/dmesg
>
> Of cource, you'd find kernel messages in /dmesg file.
>
> Happy trying,
> 	Dmitry
>
>   
>> Dmitry E. Mikhailov wrote:
>>     
>>> On Friday 20 June 2008 08:17:10 am Dan Sawyer wrote:
>>>       
>>>> Yes, the motivation was ultra bay hot swap. This works on DVD and CD
>>>> drives. Hard drive installs work. However hard drive removal result in a
>>>> hard kernel hang. The script gets to the beep successfully but then the
>>>> hard hang. Unfortunately there are no log entries. (the latest kernel
>>>> patches are installed)
>>>>
>>>> Is there a way to debug this?
>>>>         
>>> Hot remove isn't just hardware. It's software too.
>>>
>>> 1) close files on this drive
>>> 2)unmount filesystems
>>> 3)flush caches
>>> 4)instruct kernel to remove SCSI device
>>> 5)do hardware steps to remove
>>>
>>> If you don't do any of steps 1-4, kernel would wait for HDD forever and
>>> HDD wouldn't respond because it is just not there.
>>>
>>> As you wrote, there's some sort of script. Please let me see it. Post
>>> here as an attachment or provide a link.
>>>
>>>
>>> Best regards, Dmitry
>>>       
>
>
>   

--------------080505010800030500050606
Content-Type: text/html; charset=windows-1251
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=windows-1251"
 http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Thanks for the instructions! Those all work, except there is no libata.
The unload works. <br>
<br>
If I execute the echo &gt; /sys/.../delete and then run the script it
works. <br>
<br>
However if I run the script it hangs. I have put echo writes in and
even with the hang it completes the script. <br>
<br>
Dan <br>
<br>
Dmitry E. Mikhailov wrote:
<blockquote cite="mid:200806220036.12782.sexandvodka@gmail.com"
 type="cite">
  <pre wrap="">On Saturday 21 June 2008 07:17:18 am Dan Sawyer wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Thanks for the reply,

I am using the scripts at:

<a class="moz-txt-link-freetext" href="http://www.thinkwiki.org/wiki/How_to_hotswap_UltraBay_devices">http://www.thinkwiki.org/wiki/How_to_hotswap_UltraBay_devices</a>
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Really nice script!

  </pre>
  <blockquote type="cite">
    <pre wrap="">The eject gets to the beep at the end of the script. No files have been
loaded so the only relevant steps are 4 and 5. Are they part of the scrip?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
I think the best way to test is doing everything by hand.

So, 1st is to connect bay with HDD to the laptop. It doesn't matter what's on 
that HDD, we wouldn't even try mounting it.

Boot single-user: add option 'single' (with no quotes) to your kernel 
parameters at boot time. That would allow us to remove any possible 
interference from automount services etc.

Once you got root commandline, check that you have ata_piix module:
[root@ibm ~]# lsmod|grep piix
ata_piix               20996  3
libata                140752  1 ata_piix

Take an initial look at your /dev/ dir. It could look like this:
[root@ibm ~]# ls /dev/sd*
/dev/sda  /dev/sda1  /dev/sda2  /dev/sda3

Then flush caches and instruct kernel (SCSI hostadapter1) to detect the drive.
[root@ibm ~]# sync
[root@ibm ~]# echo 0 0 0 &gt; /sys/class/scsi_host/host1/scan

Then take a look at /dev again: it should find new sdb:
[root@ibm ~]# ls /dev/sd*
/dev/sda  /dev/sda1  /dev/sda2  /dev/sda3  /dev/sdb  /dev/sdb1

If /dev/sdb exists, then drive is found. It's time to try hot-removing it.

We'll skip the part of script which unmounts filesystems because we don't 
mount it.

Now instruct kernel to remove the drive.

[root@ibm ~]# echo 1 &gt; /sys/class/scsi_device/1:0:0:0/device/delete

Check /dev to be sure the drive is removed. It should look just like the 
initial one:
[root@ibm ~]# ls /dev/sd*
/dev/sda  /dev/sda1  /dev/sda2  /dev/sda3

If /dev/sdb dissapeared, it's time to pray and trigger dock removal.
[root@ibm ~]# echo eject &gt; /proc/acpi/ibm/bay

my laptop has no bay device compiled into custom kernel, so I got this:
-bash: /proc/acpi/ibm/bay: No such file or directory
If you got the same, you also don't have it so don't try to physically remove 
the drive. You need to recompile the kernel. Otherwise try undocking. And 
post the results. After issuing dock eject command, but before physically 
undocking the drive, save your kernel messages (you can't post them 
immediately because in single user mode you won't get Xwin or network).
[root@ibm scsi_host]# dmesg&gt;/dmesg

Of cource, you'd find kernel messages in /dmesg file.

Happy trying,
	Dmitry

  </pre>
  <blockquote type="cite">
    <pre wrap="">Dmitry E. Mikhailov wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">On Friday 20 June 2008 08:17:10 am Dan Sawyer wrote:
      </pre>
      <blockquote type="cite">
        <pre wrap="">Yes, the motivation was ultra bay hot swap. This works on DVD and CD
drives. Hard drive installs work. However hard drive removal result in a
hard kernel hang. The script gets to the beep successfully but then the
hard hang. Unfortunately there are no log entries. (the latest kernel
patches are installed)

Is there a way to debug this?
        </pre>
      </blockquote>
      <pre wrap="">Hot remove isn't just hardware. It's software too.

1) close files on this drive
2)unmount filesystems
3)flush caches
4)instruct kernel to remove SCSI device
5)do hardware steps to remove

If you don't do any of steps 1-4, kernel would wait for HDD forever and
HDD wouldn't respond because it is just not there.

As you wrote, there's some sort of script. Please let me see it. Post
here as an attachment or provide a link.


Best regards, Dmitry
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->

  </pre>
</blockquote>
</body>
</html>

--------------080505010800030500050606--