Connecting/disconnecting an usb hard-drive from the console
I have an usb external hdd connected to my mac mini. Sometimes the disk is physically connected to the machine but the usb subsystem hasn't made it available to the rest of the OS. This is what you can do:
drio@snowball:~ $ disktool -m disk1s1
disk1s1 device will attempt to be mounted ...
***Disk Appeared ('disk1',Mountpoint = '', fsType = '', volName = '')
***Disk Appeared ('disk1s1',Mountpoint = '', fsType = 'hfs', volName = 'wdbackup')
Disk Mounting Completed
drio@snowball:~ $ disktool -e disk1s1
disk1s1 device will attempt to be ejected ...
***Notifications Complete for type 1
***Disk Unmounted('disk1')
***Notifications Complete for type 4
***Responding yes to eject - disk1
***Responding yes to eject - disk1s1
***Disk Ejected('disk1s1')