Mounting USB Flash Drive

I'm having problems mounting my USB flash drive, as I do not know what it is called under freeBSD.

In linux, I would use the command:
Code:
sudo mount /dev/sdb /media/usb
But from the information I have found, in unix it is /dev/da0.
..I can't mount /dev/da0 though.

Could anybody give some insight?
It would be much appreciated.
 
I'd see the thread (Base > Peripheral Hardware > "how to mount panasonic... ) (2009) and others found by searching for "camcontrol"; more information in that thread than if I reposted an answer here.
 
Slices (partitions) are labeled as /dev/<device><device_number>s<slice_number><partition_letter>, unless it is dangerously dedicated. If you are using a flash drive most likely it will show up as /dev/da#s#. You will also need to tell mount(8) what type of filesystem is on the drive if it is not UFS2.

If you are coming from Linux I suggest you thoroughly read through the handbook.
 
ikreos said:
Slices (partitions) are labeled as /dev/<device><device_number>s<slice_number><partition_letter>, unless it is dangerously dedicated. If you are using a flash drive most likely it will show up as /dev/da#s#. You will also need to tell mount(8) what type of filesystem is on the drive if it is not UFS2.

If you are coming from Linux I suggest you thoroughly read through the handbook.

I think this is where I am getting lost.
I had seen mention of this /dev/ notation before, but was confused by how I only had a /dev/da0.
My problem, it seems, would be that it is not formatted correctly; I'll do a quick search and see if I can figure out how to do that.
 

wblock@

Developer
kind said:
I had seen mention of this /dev/ notation before, but was confused by how I only had a /dev/da0.
My problem, it seems, would be that it is not formatted correctly; I'll do a quick search and see if I can figure out how to do that.

There are two common ways for flash drives to be formatted.

1. With an MBR/partition table. There can be up to four partitions, but usually the first takes up the whole drive. This would show up as /dev/da0s1. The s1 means "slice 1". FreeBSD calls MS-DOS partitions slices.

2. Without an MBR. These are less common, but still found. Because there aren't any partitions (slices), it shows up as /dev/da0.

file(1) can check what's on a drive. As root:
Code:
# file -s /dev/da0
/dev/da0: x86 boot sector; partition 1: ID=0xc, active, starthead 1, startsector 
63, 19631367 sectors, code offset 0x31
# file -s /dev/da0s1
/dev/da0s1: x86 boot sector, code offset 0x58, OEM-ID "BSD4.4  ", sectors/cluste
r 64, heads 255, sectors 19631367 (volumes > 32 MB) , FAT (32 bit), sectors/FAT 
2396, Backup boot sector 2, serial number 0xc4f21bf7, label: "NO_NAME    "
 
You can also use fdisk to determine the disk layout:

# fdisk /dev/da0

or even better with gpart:

# gpart show /dev/da0
 
One thing I just encountered today. If you don't have support for the target filesystem compiled into your kernel. You must load the appropriate kernel module for the filesystem. Otherwise mount will fail to mount the device.
 
I'm sorry to revive this old thread, but I'd like to mention a method that worked for me when searching for how to mount a flash drive on a new FreeBSD install. This is what I did:

Code:
mkdir /media/flash
mount_msdosfs /dev/da0s1 /media/flash

And now I can browse /media/flash to see the contents of my flash drive.
 
Top