# Lost access to /dev/da0 through "gpart destroy"



## Goose997 (Sep 11, 2011)

Hi

I have a USB external hard disk that was NTFS formatted.  I wanted to create a ZFS pool on the drive to use for backups.

To get rid of the NTFS, I tried: `# gpart destroy -f /dev/da0`. Then, it seems /dev/da0 has completely disappeared from my devices.  After a reboot, /dev/da0 is back in my device list.  However, I cannot create anything on the disk via `# gpart create -s mbr /dev/da0`.

_Edit:I seem to be able to mount the zpool and still use it without creating any partition._ 

Question: What is the correct way to mount/unmount the USB device that I am using for a zpool?

Thanks
Malan


----------



## wblock@ (Sep 11, 2011)

Disconnect, then reconnect.  Well, there's also
`# true > /dev/da0`


----------



## Goose997 (Sep 11, 2011)

Hi

Further to this, I can now again not see the USB drive after a reboot.  But I can see it in the camcontrol command:

```
<ST2000DL003-9VT166 CC32>          at scbus0 target 0 lun 0 (pass0,ada0)
<ST31000524AS JC45>                at scbus1 target 0 lun 0 (pass1,ada1)
<HL-DT-ST DVDRAM GH22NS50 TN04>    at scbus3 target 0 lun 0 (cd0,pass2)
<ST2000DL003-9VT166 CC32>          at scbus4 target 0 lun 0 (pass3,ada2)
<ST2000DL003-9VT166 CC32>          at scbus5 target 0 lun 0 (pass4,ada3)
<ST2000DL003-9VT166 CC32>          at scbus6 target 0 lun 0 (pass5,ada4)
<ST2000DL003-9VT166 CC32>          at scbus7 target 0 lun 0 (pass6,ada5)
<Toshiba External USB HDD >        at scbus8 target 0 lun 0 (probe0)
```
How do I get the last mapping back to /dev/da0?

regards
Malan


----------



## wblock@ (Sep 11, 2011)

Toshiba... seems like I've seen that before in the "weird USB drives" category.
`# camcontrol rescan all`
might help.  Or, as above, there's forcing a pretend write.

If it's a problem with the USB part, there might be a particular incantation of usbconfig(8) needed.


----------



## Goose997 (Sep 11, 2011)

wblock said:
			
		

> Disconnect, then reconnect.  Well, there's also
> `# true > /dev/da0`




```
# true > /dev/da0
/dev/da0: Operation not supported.
```

regards
Malan


----------



## Goose997 (Sep 11, 2011)

wblock said:
			
		

> Toshiba... seems like I've seen that before in the "weird USB drives" category.
> `# camcontrol rescan all`
> might help.  Or, as above, there's forcing a pretend write.
> 
> If it's a problem with the USB part, there might be a particular incantation of usbconfig(8) needed.



hi

I tried the [cmd=]camcontrol rescan all[/cmd] but with no luck.  I found the following in dmesg:

```
ugen0.3: <Toshiba> at usbus0 (disconnected)
umass0: at uhub2, port 2, addr 3 (disconnected)
(da0:umass-sim0:0:0:0): lost device
(da0:umass-sim0:0:0:0): got CAM status 0xa
(da0:umass-sim0:0:0:0): fatal error, failed to attach to device
(da0:umass-sim0:0:0:0): removing device entry
```

Each time I plug in/out only it yields this now:

```
ugen0.3: <Toshiba> at usbus0
umass0: <Bulk Only Interface> on usbus0
umass0:  SCSI over Bulk-Only; quirks = 0x0000
umass0:8:0:-1: Attached to scbus8
ugen0.3: <Toshiba> at usbus0 (disconnected)
umass0: at uhub2, port 2, addr 3 (disconnected)
```

I am lost.

regards
Malan


----------



## jb_fvwm2 (Sep 11, 2011)

Does it have its own power supply? If not, it may need one to work reliably with the usb ports and FreeBSD.


----------



## Goose997 (Sep 11, 2011)

jb_fvwm2 said:
			
		

> Does it have its own power supply? If not, it may need one to work reliably with the usb ports and freebsd.



If that is the case it would be sad since it definitely worked very well on two Windows PC's.  Is there any further documentation on the camcontrol command, especially the fact that it recognizes the drive under probe0?

thanks
Malan


----------



## jb_fvwm2 (Sep 11, 2011)

Might work without one with the new v9 usb 3.0 drivers, but not something I'd want to take a chance with; the filesystem could irrevocably disappear from the disk; and remain unreadable without a forced mount.


----------



## da1 (Sep 12, 2011)

You could try dd-ing the whole disk and then create a FS on it.


----------



## wblock@ (Sep 12, 2011)

That "lost device" says it's hardware.  If a powered hub or external supply on the drive doesn't fix it, a trip to the freebsd-usb mailing list is in order.


----------

