# Hotplugging SATA disks

## manleyd

I have a SATA drive installed in a mobile rack.

If I boot with the disk present it appears as /dev/sda, /dev/sda1, /dev/sda2 ... and I can access it with no trouble. However if I insert it after booting the OS doesn't recognise it.

Is there some way of getting the kernel to rescan for new drives after booting? Should the hotplug scripts recognise the device? Is SATA hotplugging supported by Lunix?

Any help would be appreciated.

----------

## MacMasta

I've seen a scsi bus scanning script out there somewhere...I needed it to access my iPod for a while.

If the driver for your sata controller is smart enough to know how to do hotplugging, that might do the trick.

I think it's called scsi_bus_rescan or something similar...google for it, or for using an iPod with linux...

~Mac~

----------

## Jake

Do you use devfs or udev? I think udev would be the way to go, assuming you're on 2.6.

----------

## manleyd

Thanks for the suggestions.

Jake wrote :

 *Quote:*   

> Do you use devfs or udev? I think udev would be the way to go, assuming you're on 2.6

 

Yes I'm using the gentoo-dev-sources-2.6.7-r12 kernel, udev-025-r1 and hotplug-20040401.

MacMasta wrote :

 *Quote:*   

> I've seen a scsi bus scanning script out there somewhere...I needed it to access my iPod for a while. .... I think it's called scsi_bus_rescan or something similar...google for it, or for using an iPod with linux

 

I think I found the script you mean at .http://www.justlinux.com/forum/showthread.php?s=&threadid=117825&highlight=ipod. It seams to work well with my USB bus. However it doesn't detect my SATA PCI card.

Maybe I'll just have to wait for SATA support in Linux to mature a while longer.

----------

## zublurke

I too need to be able to hot plug my sata drive

is it possible for us to make modules instead of including (support for sata) in the kernel and then modprobe  or wateva the modules after boot? (im a half year linux noob.... don't kick me too hard if i'm wrong)

----------

## cylgalad

Maybe try with http://www.garloff.de/kurt/linux/rescan-scsi-bus.sh

But I still think sata hotplug is not very mature yet (I wouldn't try it anyway)

----------

## zublurke

thanks i skipped that part when i read through the other post

that rescan script looks like it might work for me

----------

