Cheap Linux Hardware - Hotswap SATA II drives Ubuntu Linux

This is Interesting: Free IT Magazines  
Home > Archive > Cheap Linux Hardware > November 2006 > Hotswap SATA II drives Ubuntu Linux





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Hotswap SATA II drives Ubuntu Linux
jon

2006-11-13, 8:28 am

I am looking for a way to hotswap a SATA II drive in Ubuntu. I have
the drives in a SATA II unit that allows me to power down the drives
and safely remove them. The problem is when I insert the same drive or
another drive and power it back up Ubuntu hangs.

I have not been able to figure out how to get this to work or even how
to find out exactly what is causing the problem.

Thanks

Jon

John-Paul Stewart

2006-11-13, 1:14 pm

jon wrote:
>
> I am looking for a way to hotswap a SATA II drive in Ubuntu. I have
> the drives in a SATA II unit that allows me to power down the drives
> and safely remove them.


Have you told the kernel that you've removed the drive? Given that SATA
drives appear to the kernel as SCSI devices, you might want to look into
the 'rescan-scsi-bus.sh' script (Google for it if your distro doesn't
include it) to automatically scan for new/removed devices, or figure out
the proper numbers and enter (as root):

echo "scsi-remove-single-device a b c d" >/proc/scsi/scsi

where a b c and d are the SCSI bus identifiers of your SATA drive. You
can probably obtain them by doing 'cat /proc/scsi/scsi' before you
remove the drive.

Debian also provides a package called 'scsiadd' which you should be able
to apt-get in Ubuntu, too. While I have no hands-on experience with it,
it may do just what you need.

> The problem is when I insert the same drive or
> another drive and power it back up Ubuntu hangs.


When you re-insert a drive, you'll have to echo 'scsi-add-single-device'
or use rescan-scsi-bus.sh again to tell the kernel you've put in a new
drive. Without the remove and add commands, I would expect the kernel
to get confused.

Note that I haven't tried this with SATA drives, but I use it all the
time with real SCSI hot swap drives. But since SATA is using the same
kernel subsystems, I expect it to work with SATA.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com