Skip to content
March 3, 2010 / ffstefan

SATA Hot swap on Linux

This worked for us on gentoo, borrowed from Ubuntu Forums:

I was able to hot-swap my esata drive by using a command-line tool called scsiadd. What I did is I booted the system with the drive plugged in and ran ‘scsiadd -p’ which prints out info on all the drives. The one i wanted to hotswap was a Hitachi 1TB drive which showed up like this:

Host: scsi3 Channel: 00 Id: 00 Lun: 00
Vendor: ATA Model: Hitachi HDS72101 Rev: GKAO
Type: Direct-Access ANSI SCSI revision: 05

I unmounted it and ran ‘scsiadd -r 3 0 0 0’ (host channel id lun) and shut off the drive. I checked /dev just to make sure, and sure enough /dev/sdb didn’t exist anymore. I proceeded to start the drive back up, and I’m pretty sure /dev/sdb was there again but not /dev/sdb1, so I wouldn’t be able to mount it. Then I ran ‘scsiadd -a 3 0 0 0’ followed by ‘scsiadd -s’ and I was able to mount the drive. Hope this helps.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: