12900 Mounting USB Flash Drive - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Base System > Peripheral Hardware

Peripheral Hardware Stuff that plugs in via USB, FireWire, eSATA, PS/2, etc.

Reply
 
Thread Tools Display Modes
  #1  
Old July 16th, 2011, 13:08
kind kind is offline
Junior Member
 
Join Date: Jul 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.
Reply With Quote
  #2  
Old July 16th, 2011, 13:16
jb_fvwm2 jb_fvwm2 is offline
Senior Member
 
Join Date: Nov 2008
Posts: 1,385
Thanks: 60
Thanked 145 Times in 130 Posts
Default

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.
Reply With Quote
  #3  
Old July 16th, 2011, 13:18
ikreos's Avatar
ikreos ikreos is offline
Junior Member
 
Join Date: Mar 2011
Location: Stuck between subatomic particles in quantum space.
Posts: 78
Thanks: 7
Thanked 9 Times in 9 Posts
Default

Slices (partitions) are labeled as /dev/<device><device_number>s<slice_number><partition_l etter>, 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 reject your reality and substitute my own!" -- Adam Savage, Mythbusters
iBlast! I use vi so much I keep wanting to enter commands when I type in a forum!<ESC>:wAGah!
Proud user of the FreeBSD Operating System. http://www.FreeBSD.org/
Reply With Quote
  #4  
Old July 16th, 2011, 13:34
kind kind is offline
Junior Member
 
Join Date: Jul 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by ikreos View Post
Slices (partitions) are labeled as /dev/<device><device_number>s<slice_number><partition_l etter>, 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.
Reply With Quote
  #5  
Old July 16th, 2011, 16:37
sverreh's Avatar
sverreh sverreh is offline
Member
 
Join Date: Nov 2008
Location: Norway
Posts: 124
Thanks: 25
Thanked 14 Times in 13 Posts
Default

You can see your da-devices by

# ls /dev/da*

If you see e.g. /dev/da0s1 listed, try mounting with

# mount_msdosfs /dev/da0s1 /media/usb

If you have set up sudo correctly you can do it as an ordinary user

% sudo mount_msdosfs /dev/da0s1 /media/usb

Last edited by DutchDaemon; July 17th, 2011 at 21:37.
Reply With Quote
  #6  
Old July 16th, 2011, 18:06
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,701
Thanks: 429
Thanked 1,757 Times in 1,456 Posts
Default

Quote:
Originally Posted by kind View Post
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    "
Reply With Quote
  #7  
Old July 19th, 2011, 21:34
matoatlantis's Avatar
matoatlantis matoatlantis is offline
Member
 
Join Date: Mar 2009
Location: bratislava, slovakia
Posts: 401
Thanks: 23
Thanked 58 Times in 49 Posts
Default

You can also use fdisk to determine the disk layout:

# fdisk /dev/da0

or even better with gpart:

# gpart show /dev/da0
__________________
..when you do things right, people won't be sure you've done anything at all..
Reply With Quote
  #8  
Old July 20th, 2011, 23:14
ikreos's Avatar
ikreos ikreos is offline
Junior Member
 
Join Date: Mar 2011
Location: Stuck between subatomic particles in quantum space.
Posts: 78
Thanks: 7
Thanked 9 Times in 9 Posts
Default

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 reject your reality and substitute my own!" -- Adam Savage, Mythbusters
iBlast! I use vi so much I keep wanting to enter commands when I type in a forum!<ESC>:wAGah!
Proud user of the FreeBSD Operating System. http://www.FreeBSD.org/
Reply With Quote
  #9  
Old December 19th, 2011, 00:23
jwmollman jwmollman is offline
Junior Member
 
Join Date: Jun 2011
Location: Cincinnati, OH, USA
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #10  
Old December 19th, 2011, 01:14
SNK SNK is offline
Member
 
Join Date: May 2011
Location: The Netherlands
Posts: 130
Thanks: 6
Thanked 32 Times in 28 Posts
Default

There is an interesting volume manager in the works: http://forums.freebsd.org/showthread.php?t=27233. It works quite well.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] Mounting usb drive (NTFS) Vib3 General 6 December 24th, 2011 08:29
Mounting USB Hard Drive on boot. nmahadkar Peripheral Hardware 5 March 9th, 2011 09:45
USB Device Mounting/USB Drive for use with Apache VicTwenty Peripheral Hardware 2 October 23rd, 2010 19:02
[Solved] USB flash drive woes Eponasoft Peripheral Hardware 22 January 22nd, 2010 01:30
Installing on a USB Flash drive? diskman Installing & Upgrading 4 January 4th, 2010 17:18


All times are GMT +1. The time now is 06:54.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0