DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 19th April 2011
RJPugh RJPugh is offline
Port Guard
 
Join Date: Jun 2008
Location: Culpeper, VA
Posts: 42
Thanked 0 Times in 0 Posts
Default Populating /dev

My situation:

I have an external hard drive that can be mounted manually as da0s1. No problems there. However, da0s1 is the only USB device available in my /dev bank. So when I want to mount a flash drive, I'm out of luck. In the past I could mount a flash drive on da1s1, but currently I can't do so. Sometimes I've been able to mount the flash drive using the external drive's device file, but I don't like doing that, because often I need both devices mounted at the same time.


What I want to do:

I want to create a /dev entry for the flash drive. If I can do that, a lot of things will clear up. It's my understanding that /dev entries can be generated using command line utilities like dd and the disk label utility, but I can't for the life of me remember where I saw this procedure written out.

So, if anyone in here can point me to an FAQ, HowTo, or other source of documentation on how to generate device entries, I will be most grateful and will do what I can to increase your karma quota. That assumes, of course, that this procedure is still supported by FreeBSD.

I've mentioned this problem in other threads, and I have come to partial solutions for many issues, but so far, not all of them. So I'm looking into a new approach.


For the record, I'm using PC-BSD 8.2. Which is essentially (or rather, it should be) FreeBSD 8.2 with some nice bells and whistles added. My computer is a Dell Dimension 4550 series that has been customized and upgraded so many times that Dell's original diagnostic utility doesn't recognize it any more. (But PC-BSD and Windows-XP both run just fine, so what the heck.)

Thanks in advance,

RJPugh
Reply With Quote
  #2   (View Single Post)  
Old 19th April 2011
tokima tokima is offline
New User
 
Join Date: Apr 2011
Posts: 1
Thanked 0 Times in 0 Posts
Default

/dev should automatically populate when you insert a usb device.
Reply With Quote
  #3   (View Single Post)  
Old 19th April 2011
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 564
Thanked 14 Times in 13 Posts
Default

I don't use FreeBSD, but suspect that MAKEDEV(8) and mknod(8) will be your friends for this task. The former is a script usually located in the /dev directory. Hope that helps.
Reply With Quote
  #4   (View Single Post)  
Old 19th April 2011
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

On most original Unix systems, /dev was not populated automatically by the kernel.. it simply contained previously generated device nodes.

FreeBSD/Linux switched over to the dynamic technique for various reasons, but they typically preserve the ability to generate device nodes using the classic MAKEDEV/makedev script.

It was once second nature for Unix enthusiasts to generate the additional nodes when they were needed, kids these days are so spoiled.

Fortunately, OpenBSD does not have a "devfs" and /dev is simply a directory of files on /.
Reply With Quote
  #5   (View Single Post)  
Old 20th April 2011
jb_daefo jb_daefo is offline
Package Pilot
 
Join Date: May 2008
Posts: 196
Thanked 5 Times in 5 Posts
Default

Any reason you cannot mount /dev/da1s1 ?? Insert the flash drive, and
Code:
cd /dev
ls -lac | grep da 
camcontrol rescan all
# etc...
...
__________________
using /LOOKAT/ with /var/db/pkg files and portmaster/aliases/pipes/find/grep to meteorically speedup port upgrades/installs...
Reply With Quote
  #6   (View Single Post)  
Old 20th April 2011
RJPugh RJPugh is offline
Port Guard
 
Join Date: Jun 2008
Location: Culpeper, VA
Posts: 42
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jb_daefo View Post
Any reason you cannot mount /dev/da1s1 ?? Insert the flash drive, and
Code:
cd /dev
ls -lac | grep da 
camcontrol rescan all
# etc...
I haven't tried the code you list, but the short answer is that there is no da1s1 or da1s0 in /dev. So when I try to mount the device, BSD tells me to go jump in the proverbial lake.

However, will the commands you list help with this issue?

I haven't yet had a chance to try the other suggestions people have given. Please stay tuned.

RJPugh
Reply With Quote
  #7   (View Single Post)  
Old 20th April 2011
shep shep is offline
ISO Quartermaster
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 593
Thanked 9 Times in 9 Posts
Default

I believe that the node should be generated when the device is inserted and it will be listed at the end of your dmesg output within seconds of insertion. In that version of freebsd it is likely controlled by "hal" (This is a different hal than the Space Odyssey but can be just as unfriendly).

More info here:
http://www.freebsd.org/gnome/docs/halfaq.html
Reply With Quote
  #8   (View Single Post)  
Old 20th April 2011
Beastie Beastie is offline
Daemonology student
 
Join Date: Jan 2009
Location: /dev/earth0
Posts: 270
Thanked 23 Times in 23 Posts
Default

Quote:
Originally Posted by RJPugh View Post
I haven't tried the code you list, but the short answer is that there is no da1s1 or da1s0 in /dev.
[...]
However, will the commands you list help with this issue?
I don't know if it's a typo, but just to avoid any confusion, there is no da1s0. Slices start with 1.

The problem you're experiencing is that FreeBSD is apparently unable to detect the device.
Rescanning with camcontrol may help with that.

Check
% tail /var/log/messages
After inserting the pendrive. What does it say?
__________________
May the source be with you!
Reply With Quote
  #9   (View Single Post)  
Old 21st April 2011
jb_daefo jb_daefo is offline
Package Pilot
 
Join Date: May 2008
Posts: 196
Thanked 5 Times in 5 Posts
Default

This is one method I have written down. (For instance, if you mount flashdrives on /flashdrive, you can put how.txt in /flashdrive for instructions before the use of the flash drive
Code:
kldload ehci.ko
(insert flash drive, wait until it's light stops blinking if it has one)
camcontrol rescan all
mount -t msdosfs /dev/da0s1 /flashdrive
mount -t msdosfs /dev/da0  /flashdrive
mount -t msdosfs /dev/da0s1 /flashdrive
(multiple attempts so the system has time, and reason, to probe..)
(that is for fat32 on the flash drive of course, ...)
... and
may change depending upon your v7 v8 v9 version, whether it was an initial install or an upgrade, etc.
__________________
using /LOOKAT/ with /var/db/pkg files and portmaster/aliases/pipes/find/grep to meteorically speedup port upgrades/installs...
Reply With Quote
Old 22nd April 2011
shep shep is offline
ISO Quartermaster
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 593
Thanked 9 Times in 9 Posts
Default

I think the OP is using PC-BSD 8.2
Quote:
For the record, I'm using PC-BSD 8.2. Which is essentially (or rather, it should be) FreeBSD 8.2 with some nice bells and whistles added.
I have not tried PC-BSD but my guess is that he has hal and dbus enabled in the same manner that the Gnome desktop does in FreeBSD. The link in my previous post goes into how to deal with unrecognized devices.
Reply With Quote
Old 23rd April 2011
RJPugh RJPugh is offline
Port Guard
 
Join Date: Jun 2008
Location: Culpeper, VA
Posts: 42
Thanked 0 Times in 0 Posts
Default

Update:

I went through the various pointers people gave me, and after a "camcontrol rescan", I can now see the flash drive. Or rather, a flash drive. The drive I generally use still isn't visible in FreeBSD, but other ones are. That says to me that something is wrong with that particular flash drive. I'll clean it out in Windows-XP, then try to reformat it. If that doesn't work, then I'll just replace it. Those things aren't that expensive, all things considered.



Still, I can now probe and mount other flash drives using the manual mount procedure, which is what I was after in the first place. Note that before I went through all of this, my system couldn't see *any* flash drives, so your pointers ultimately did work.

It looks like the FreeBSD portion of this problem has been solved. That being said, I want to thank everyone for their help and pointers.

RJPugh
Reply With Quote
Old 7th May 2011
sharris sharris is offline
Package Pilot
 
Join Date: Jun 2010
Posts: 146
Thanked 0 Times in 0 Posts
Default

Glad you solved the issue RJPugh, I got to come back to read-how. Anyway, add this and see what happen is it's not said already. Last week I decided to dd out one of my flash-drive because I got sick of the DOS 4GB limit. I was ready to suffer the consequences but when I re-booted and plugged my UFS formatted, the first place I looked was in the /dev directory. It had da0 and not da0s1... so now I only have to:

Code:
mount /dev/da0 /mnt
and no more mount_msdosfs or mount -t

and I been using it every since. ...

I been meaning to read this thread for a week... If you try it I bet the da0s1 is still there waiting for your HDD. but if you dd from the head of the HDD someday it may not work anymore because it to may becomes da0.

PS: I had to do:
Code:
newfs -U /dev/da0
before mounting
...

Last edited by sharris; 7th May 2011 at 06:42 PM.
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


All times are GMT. The time now is 11:02 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick