# External USB Drive Doesn't Mount



## CarlManCity (Jan 20, 2015)

Hello, I am using FreeBSD 10.0-RELEASE and trying to mount my WD 320GB hard drive via USB. I have searched for answers since this is a common procedure but I am getting errors I don't understand. I had previously used a live CD to format the drive with a fat32 file system so that I could use it in Windows but I would like to use the drive with FreeBSD also as I already do with my USB sticks. These are the commands I am using and the results:


```
# ls /dev/da*
/dev/da0    /dev/da0s1

# mount -o large -t msdosfs /dev/da0s1 /mnt_point

(da0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 00 01 00 00 00 02 00
(da0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(da0:umass-sim0:0:0:0): SCSI status: Check Condition
(da0:umass-sim0:0:0:0): SCSI sense: UNIT ATTENTION asc:28,0 (Not ready to ready change, medium may have changed)
(da0:umass-sim0:0:0:0): Retrying command (per sense data)
mount_msdosfs: /dev/da0s1: Invalid argument
```

One thing I should mention is that at the moment I do not have a hard drive enclosure so I have the drive hooked up to an external power source and using a SATA-to-USB adapter to connect it to my FreeBSD machine. I don't know if that should matter. I'm getting an enclosure but just wanted to see in the meantime if the drive would mount. Any help please?


----------



## SirDice (Jan 20, 2015)

It looks like either the drive itself or the SATA->USB adapter is a little buggy. Have you tried connecting it directly to SATA? Or tried a different adapter? It's also possible the power source isn't capable enough.


----------



## CarlManCity (Jan 20, 2015)

SirDice said:


> It looks like either the drive itself or the SATA->USB adapter is a little buggy. Have you tried connecting it directly to SATA? Or tried a different adapter? It's also possible the power source isn't capable enough.



Thanks. Well I hope it's not the drive because it's brand new and besides it's working fine with my Windows machine. It's attached to the Windows machine with the SATA-USB adapter so I guess the adapter is ok (it's my only one) but maybe FreeBSD doesn't like it. I did not try connecting directly to SATA since my FreeBSD machine is a laptop and I will be getting a USB drive enclosure shortly. I am sure the power source is enough because it's a 5.0V adapter connected directly to the power port on the drive.

Well as I said in my original post, I'm going to get a proper drive enclosure and this was just a temporary setup to see if I could mount the drive. I will get one shortly and hopefully it will turn out alright. I will update the result if there are no more suggestions for now. Thanks!


----------



## kpa (Jan 20, 2015)

The drive very possibly needs an usb_quirk(4) set on it to make it work on FreeBSD. Play around the ones mentioned in the manual page and if you can't get it to work you should ask on the freebsd-usb mailing list for more assistance.


----------



## CarlManCity (Jan 21, 2015)

kpa said:


> The drive very possibly needs an usb_quirk(4) set on it to make it work on FreeBSD. Play around the ones mentioned in the manual page and if you can't get it to work you should ask on the freebsd-usb mailing list for more assistance.



Oh ok, I never had to deal with USB quirks before so this is  new to me. Before I go to the freebsd-usb mailing list may I ask for a little more guidance on this? When I plug in the drive I get:


```
# ugen2.2: <JMicron> at usbus2
umass0: <MSC Bulk-Only Transfer> on usbus2
umass0: SCSI over Bulk-Only; quirks = 0x4000
umass0:4:0:-1: Attached to scbus4
da0: at umass-sim0 bus0 scbus4 target 0 lun 0
da0: <WDC WD32 ******-******* > Fixed Direct Access SCSI-2 device
da0: Serial Number ************
...
da0: quirks=0xa<NO_6_BYTE,4K>
```

I've been reading about quirks and there's a lot of info on adding quirks through a patch, but am I correct in following usb_quirk(4) that in my case I could enter a quirk manually such as


```
# usbconfig -d ugen2.2 add_quirk UQ_MSC_FORCE_PROTO_UFI
```

After trying this, the situation was a little improved in that the result from my attempt to mount the drive was only


```
# mount_msdosfs: /dev/da0s1: Invalid argument
```
without all the extra verbose output as shown in my original post.

The output from plugging in the device displays "JMicron" which seems to be a popular problem in this regard. Anyway, I guess I'm just asking if I'm adding the quirk correctly (or must it be done through a patch) and is there anything in my outputs that indicates which quirk(s) should be added or am I just supposed to blindly try all of them? Thanks.


----------



## pemdas (Jan 25, 2015)

Hi, You may have already arrived at a solution. I see where you've formatted the drive as Fat32 but as a double double check what does `sbin/gpart show da0` display? Or, what file system does Windows show it as?


----------



## CarlManCity (Jan 27, 2015)

pemdas said:


> Hi, You may have already arrived at a solution. I see where you've formatted the drive as Fat32 but as a double double check what does `sbin/gpart show da0` display? Or, what file system does Windows show it as?


Both `gpart show da0` and Windows reported the file system as FAT32.

I just picked up a hard drive enclosure today. When I attached it and tried to mount it in the same way I've been trying, the result was:

```
# mount_msdosfs: /dev/da0s1: Invalid argument
```
I then tried attaching to my Windows machine but it wasn't being recognized properly (it was before when attached via the SATA->USB adapter). I was not even able to reformat it in Windows. I then reformatted using my live CD, this time in the enclosure and again with FAT32 file system. Now it is mounting on both FreeBSD and Windows with no problems! I am glad it is working for me now although I wouldn't really say the problem is solved since I was not having any luck getting the drive to work with the SATA->USB adapter.


----------

