# I can't get the USB thumb drive to work



## mrredeyeflight (Aug 1, 2018)

Hello
 I can't get the USB thumb drive to work. The external usb drive doesnt work either. Don't refer me to the handbook please. What was the possible reason that support for hte USB drive is not installed by default?


Thanks


----------



## alexseitsinger (Aug 1, 2018)

Are you mounting the drive after you insert it into the computer? Are you mounting it with the correct filesystem type? You haven't explained what the error is that you're receiving so I can only guess. If its a flash drive that you just bought or havent used, try  mounting it with `mount -t msdosfs /dev/da0 /mnt`, assuming that your device is located at /dev/da0, and /mnt isn't already occupied.


----------



## balanga (Aug 1, 2018)

mrredeyeflight said:


> Hello
> I can't get the USB thumb drive to work. The external usb drive doesnt work either.
> Thanks



Define *doesnt work.*


----------



## balanga (Aug 1, 2018)

Phishfry said:


> If balanga  is asking him to refine his question you know it's vague!!!JK!!
> 
> I will say that 99 percent of USB devices work for me. Sounds like operator error.



The problem is you don't know whether it's a physical problem or it's a problem being unable to mount a device.

I have numerous laptops and some usb devices work with some and not with others, so the first question which need to be asked is what does `dmesg` say about the device, and if it's recognised then what does `gpart show` display, and even then I have some USB sticks which Windows reads OK, but FreeBSD doesn't. Those sticks usually have a filesystem on, but are not partitioned so `gpart` doesn't see anything. I still don't know how to access data on them from FreeBSD.


----------



## SirDice (Aug 1, 2018)

mrredeyeflight said:


> What was the possible reason that support for hte USB drive is not installed by default?


What makes you think it was removed in the first place? Don't you think that a lot more people would have complained about that? And you may not know this but FreeBSD actually automatically loads kernel modules if/when needed. So even if it was removed from the kernel it would have been dynamically loaded as soon as you started using it. 

In any case. Unplug the stick or USB drive or whatever. Run `tail -F /var/log/messages` and plug it in. What messages are you seeing?


----------



## mrredeyeflight (Aug 2, 2018)

balanga said:


> Define *doesnt work.*[/
> 
> 
> 
> ...


----------



## mrredeyeflight (Aug 2, 2018)

balanga said:


> Define *doesnt work.*


I can't read or write to the USB thumb drive.


balanga said:


> The problem is you don't know whether it's a physical problem or it's a problem being unable to mount a device.
> 
> I have numerous laptops and some usb devices work with some and not with others, so the first question which need to be asked is what does `dmesg` say about the device, and if it's recognised then what does `gpart show` display, and even then I have some USB sticks which Windows reads OK, but FreeBSD doesn't. Those sticks usually have a filesystem on, but are not partitioned so `gpart` doesn't see anything. I still don't know how to access data on them from FreeBSD.


Thats insteresting.


----------



## mrredeyeflight (Aug 2, 2018)

I installed the fuse addon, from Ports. I was able to view that the USB thumb drive was connected, I was still unable to red the contents


----------



## mrredeyeflight (Aug 2, 2018)

I cann read some NTFS formated USB drives but not all?


----------



## Chris_H (Aug 2, 2018)

mrredeyeflight said:


> I can't read or write to the USB thumb drive.
> 
> Thats insteresting.


OK this is crazy. mrredeyeflight , please take a moment to provide some useful information. What you're (currently) doing; is the equivalent of calling a mechanic on the phone, and saying "my car is broken". How do I fix it?
Do you think that mechanic can tell you how to fix it, without a reasonable amount of additional information?
Anyway. You've already been given some good advice, and suggestions. But I'll ask you some specific questions. That the answers to, will give you *specific* answers that'll get you through your trouble, with little to no effort on your part.
1) Does you're (FreeBSD) system seem to _see_ the drive. If not. As root, please open /boo/loader.conf and place this: `boot_verbose="YES"` in it. Then reboot, and post the output in /var/run/dmesg.boot to this thread.
2) Have you already formatted this drive, in say, Windows? If so, then take the advice above by Phishfry , so you can read it.
3) If you _haven't_ already formatted it, and your (FreeBSD) system _does_ appear to see it. Then (assuming the drive is USB, and the ONLY (USB) drive) do the following:

```
gpart destroy -F da0

gpart create -s GPT da0

gpart add -t freebsd-ufs -l usbdrive da0

newfs -Ujo time /dev/gpt/usbdrive

mount /dev/gpt/usbdrive /mnt/
```
Done!

Have a nice day!

--Chris
*EDIT*
You appear to have responded while I was writing this.
Oh well. I tried.


----------



## ShelLuser (Aug 2, 2018)

Please make sure to do some proper quoting. Sorry, but this is pretty silly and it will probably result in plenty of people overlooking important stuff. Not to mention that in many cases it can be considered rude to put words in someone elses mouth. Your post almost makes it look as if someone else said that.



mrredeyeflight said:


> I can't get the USB thumb drive to work.


Well, that appears to be incorrect, because if this were true you wouldn't see mention of da5 which you shared in the message I linked to.

So, next stop is to determine the actual partitions on that drive. For that you'd use: `gpart show da5`. This will show something like:

```
peter@zefiris:/home/peter/minecraft/snapshot $ gpart show da0
=>     63  7818121  da0  MBR  (3.7G)
       63  7817985    1  fat32  [active]  (3.7G)
  7818048      136       - free -  (68K)
```
The number before the partition is important. Although it says fat32 here that is really no proof at all that the filesystem actually is fat32 as well. What does give proof is the file command:

```
root@zefiris:/home/peter/minecraft/snapshot # file -s /dev/da0
/dev/da0: DOS/MBR boot sector; partition 1 : ID=0xb, active, start-CHS (0x0,1,1), end-CHS (0x325,31,63), startsector 63, 7817985 sectors
```
This is proof that I most likely am dealing with fat32 here.

Once you know the filesystem then you'll also know how to mount it so you can access it.


----------



## mrredeyeflight (Aug 3, 2018)

Chris_H said:


> OK this is crazy. mrredeyeflight , please take a moment to provide some useful information. What you're (currently) doing; is the equivalent of calling a mechanic on the phone, and saying "my car is broken". How do I fix it?
> Do you think that mechanic can tell you how to fix it, without a reasonable amount of additional information?
> Anyway. You've already been given some good advice, and suggestions. But I'll ask you some specific questions. That the answers to, will give you *specific* answers that'll get you through your trouble, with little to no effort on your part.
> 1) Does you're (FreeBSD) system seem to _see_ the drive. If not. As root, please open /boo/loader.conf and place this: `boot_verbose="YES"` in it. Then reboot, and post the output in /var/run/dmesg.boot to this thread.
> ...


Hello Thanks, 
When I pluged in a usb thumbdrive, I get the error message "Cannot Mount Volume. Unable to mount the volume,  Cannot obtain lock on /media/.hal-mtab  Has anyone had this message before?


----------



## mrredeyeflight (Aug 3, 2018)

mrredeyeflight said:


> Hello Thanks,
> When I pluged in a usb thumbdrive, I get the error message "Cannot Mount Volume. Unable to mount the volume,  Cannot obtain lock on /media/.hal-mtab  Has anyone had this message before?


SOrry, I willl try your seguestions.


----------



## mrredeyeflight (Aug 3, 2018)

mrredeyeflight said:


> SOrry, I willl try your seguestions.


Thank you for your help


----------



## mrredeyeflight (Aug 3, 2018)

Chris_H said:


> OK this is crazy. mrredeyeflight , please take a moment to provide some useful information. What you're (currently) doing; is the equivalent of calling a mechanic on the phone, and saying "my car is broken". How do I fix it?
> Do you think that mechanic can tell you how to fix it, without a reasonable amount of additional information?
> Anyway. You've already been given some good advice, and suggestions. But I'll ask you some specific questions. That the answers to, will give you *specific* answers that'll get you through your trouble, with little to no effort on your part.
> 1) Does you're (FreeBSD) system seem to _see_ the drive. If not. As root, please open /boo/loader.conf and place this: `boot_verbose="YES"` in it. Then reboot, and post the output in /var/run/dmesg.boot to this thread.
> ...



I added boot_verbose="YES"  to /boo/loader.conf
I was able to see the SanDisk as  da5
the output of /var/run/dmesg.boot is :
https://pastebin.com/JRdhL009


----------



## mrredeyeflight (Aug 4, 2018)

Phishfry said:


> 'HAL' in your message is needed for automount.
> 
> To fix it add this to /etc/rc.conf then reboot and try.
> 
> ...


hald_enable="YES"   is already enabled.


----------



## mrredeyeflight (Aug 4, 2018)

Phishfry said:


> After reading alexseitsinger  post he is probably on the right path.
> You must use sysutils/fusefs-ntfs for NTFS filesystems. So like he mentions msdos is supported natively,
> NTFS will require some work. Some types of NTFS partitions are not supported. Dynamic Volumes and some others.
> 
> ...


I will try that. I wont be able to read the thumb drive with the Windows machine


----------



## balanga (Aug 4, 2018)

I have a thumb drive which I use as a Windows XP repair disk. I could never understand why I couldn't access under FreeBSD.

When inserted, I get this when running `[B]dmesg[/B]`:-


> ugen3.2: <Integral Courier> at usbus3
> umass0 on uhub2
> umass0: <Integral Courier, class 0/0, rev 2.00/1.00, addr 2> on usbus3
> umass0:  SCSI over Bulk-Only; quirks = 0x8100
> ...


`[B]gpart show da0[/B]` shows nothing.

`[B]camcontrol devlist[/B]` shows:-


> <Integral Courier PMAP>            at scbus4 target 0 lun 0 (da0,pass1)


`[B]file -s /dev/da0[/B]` shows:-


> /dev/da0: DOS/MBR boot sector; partition 1 : ID=0x7, active 0x81, start-CHS (0x0,32,33), end-CHS (0xf2,254,63), startsector 2048, 3909632 sectors



I have yet to find a way of mounting this thumb drive on FreeBSD, but I believe the problem is due to it not having a partition table.


----------



## mrredeyeflight (Aug 5, 2018)

Thank you for your help. I appreicate it.


----------

