# eSATA "Hotswap" [camcontrol]



## dndlnx (Apr 17, 2013)

I purchased a Thermaltake dock. I am trying to "hotswap" a single ZFS disk, which is backup for RAIDZ array. With camcontrol I can scan for the disk, and mount with zfs. But I cannot eject:

`# camcontrol eject -n ada -u 4 -v`

```
Error received from stop unit command
(pass4:ahcich0:0:0:0): START STOP UNIT. CDB: 1b 0 0 0 2 0 
(pass4:ahcich0:0:0:0): CAM status: CCB request was invalid
```

I gave up and turned off the dock, but got pool errors. It was not mounted when I did this. A scrub was performed, which made them disappear (but took two hours). 

I'm thinking unmount all datasets, and stop ZFS. I could power off the dock, and ZFS would be none the wiser? Would that be safe though, as far as CAM?

Would my backup disk being UFS instead, make any difference in ejecting properly?


----------



## Savagedlight (Apr 17, 2013)

dnix said:
			
		

> It was not mounted when I did this.


I use the same setup as part of my backup routine, and always `# zpool export BackupPool` before powering down the drive. I never eject it using camcontrol.

PS: You might want to make it a routine to `# zpool scrub BackupPool` after doing a backup, to verify that all data is valid. A backup is no good if it's corrupt. This is especially important if you do incremental transfers of snapshots.


----------



## dndlnx (Apr 17, 2013)

I'm no ZFS expert, I get by. I should probably read up on import/export. Will doing this require pool to be "imported", the next time I connect the disk?


----------



## mav@ (Apr 17, 2013)

camcontrol has no way to disable device. eject subcommand ejects media from the device and stop just stops spindle retation. If eSATA is AHCI port, you can just disconnect device without disabling it first. But exporting ZFS pool (or unmounting filesystem for UFS) is preferably to do first to make sure that all modified data were reliably stored to the media.


----------

