1-first you need to get the bios setup to allocate the sd**,s consistently whether the removable drive is seated or not during boot, i had set the bios setting for the sata controller to “enhanced mode”
you need to do this so the following command scsiadd will consistantly point to the correct hardware port to load/unload the hardware.
2- install scsiadd
sudo apt-get install scsiadd
during scsiadd,s install enable not root access.
3-determine where on the bus the drive will pop up (in our case the removable is WDC WD1200JD-00G). do this by booting the machine with the drive in and then run
scsiadd -s
which will return an output like this
Attached devices: Host: scsi0 Channel: 00 Id: 05 Lun: 00 Vendor: Color Model: FlatbedScanner_4 Rev: 0181 Type: Scanner ANSI SCSI revision: 02 Host: scsi1 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: WDC WD3200JB-00K Rev: 08.0 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi1 Channel: 00 Id: 01 Lun: 00 Vendor: PIONEER Model: DVD-RW DVR-110D Rev: 1.41 Type: CD-ROM ANSI SCSI revision: 05 Host: scsi3 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: WDC WD10EACS-00Z Rev: 01.0 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi4 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: WDC WD1200JD-00G Rev: 02.0 Type: Direct-Access ANSI SCSI revision: 05
as we can see our discs scsi address is “Host: scsi4”
4- remove the device next we want to test if we can remove the device from the bus, to do this we will run
scsiadd -r 4 0 0 0
the 4 in the first numerical column denotes the host address of our drive. after running this we should hear the drive power down and to check run
scsiadd -s
again to scan the bus and the WDC WD1200JD-00G should be missing.
to add it back we simply run
scsiadd -a 4 0 0 0
after which we should hear the drive power up and then
scsiadd -s
to scan the bus and add the device again.
5- power up system with drive disconnected and hot connect the device. we should now be able to power up the machine without the drive connected and add/remove it when when we like.
given we know the address the sata port occupies on the scsi bus we simply have to integrate it for the drive once its installed.
scsiadd -a 4 0 0 0
after which we should hear the drive power up and then
scsiadd -s
to scan the bus and add the device again.
and we can remove it in the same manner as before,
scsiadd -r 4 0 0 0
then
scsiadd -s
again to scan the bus and the WDC WD1200JD-00G should be missing.
you can either manually mount the newly added hardware or edit HAL to automount the drive
if you choose the second option make sure all your perminant drives have a fstab entry so hal wont maoult them automaticly.
to get hal to automount the plugged in disc under /media/ you have to comment out ( by inserting ”<! - - and - - >” )the section in /etc/hal/fdi/preferences.fdi that say not to automount non-removable volumes:
<!--
<device>
<match key="storage.hotpluggable" bool="false">
<match key="storage.removable" bool="false">
<merge key="storage.automount_enabled_hint" type="bool">false</merge>
</match>
</match>
</device>
-->
Once all that were done, the disc would be mount under /media/<PARTITION_LABEL>
to remove the drive remember to UNMOUNT the drive befor runnig “scsiadd -r”
this quick guide made up from a couple of edwards posts on the chat thread, and the following links, http://ubuntuforums.org/showthread.php?t=691862&highlight=hotswap+sata
http://ubuntuforums.org/showthread.php?t=355179&highlight=hotswap+sata