How to mount USB drive in FreeBSD 5.0?

Frank Lee frank at franklee.net
Sun Sep 28 13:25:59 PDT 2003


On Sunday 28 September 2003 19:46, Andreas Kohn wrote:
> On Mon, 2003-09-29 at 06:27, Frank Lee wrote:
> > Hi all. My first FreeBSD post. :-)
> >
> > I have a USB drive (Win95 formatted) that I'm trying to dd data off of.
> >
> > - FreeBSD 5.0-Release
> > - USB 2.0/1.1 drive.
> > - laptop is 1.1
> >
> > How do I mount this USB drive? I done it on 4.7 with MAKEDEV and all, but
> > can't find any info on getting it to mount in 5.0 (no MAKEDEV and all).
> >
> > Thank you,
> > Frank Lee
>
> Hello,
>
> add umass (and scbus + da) to your kernel configuration (if not there
> already), and it should be autodetected. Mounting should work like in
> 4.7.
>
> In FreeBSD 5, devfs makes MAKEDEV unneccessary.
>
> If that still doesn't work, please post relevant messages to the list.

Thank you for your quick reply!

- The kernel is generic. So umass, scbus, and da are already in there.
- "usbd" is running.
  # ps auxw | grep usbd
  root    330  0.0  0.2  1144  680  ??  Ss    3:40AM   0:00.01/usr/sbin/usbd
- I noticed that the "USB modules" section in /boot/loader.conf was set to 
"NO". So I copied that over to /boot and set them to "YES":
  usb_load="YES"                  # USB subsystem
  udbp_load="YES"                 # USB double bulk pipe host 2 host cables
  ugen_load="YES"                 # USB generic device, if all else fails ...
  umass_load="YES"                        # Mass Storage Devices
- rebooted and got (from dmesg):
<snip>
Preloaded elf kernel "/boot/kernel/kernel" at 0xc0689000.
Preloaded elf module "/boot/kernel/udbp.ko" at 0xc06890a8.
Preloaded elf module "/boot/kernel/ugen.ko" at 0xc0689154.
Preloaded elf module "/boot/kernel/umass.ko" at 0xc0689200.
Preloaded elf module "/boot/kernel/uscanner.ko" at 0xc06892ac.
Preloaded elf module "/boot/kernel/acpi.ko" at 0xc068935c.
link_elf: symbol ng_newtype undefined
KLD file udbp.ko - could not finalize loading
module_register: module uhub/ugen already exists!
Module uhub/ugen failed to register: 17
module_register: module uhub/umass already exists!
Module uhub/umass failed to register: 17
module_register: module uhub/uscanner already exists!
Module uhub/uscanner failed to register: 17
Timecounter "i8254"  frequency 1193182 Hz
<snip> 

So i guess I didn't need to set them to "YES"... :-\  And later in dmesg:
<snip>
uhci0: <Intel 82371AB/EB (PIIX4) USB controller> port 0xfce0-0xfcff irq 10 at 
de
vice 7.2 on pci0
usb0: <Intel 82371AB/EB (PIIX4) USB controller> on uhci0
usb0: USB revision 1.0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
<snip>

It may have detected that there's a drive...
# usbdevs -v
Controller /dev/usb0:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), 
Intel(0x0000), rev 1.00
 port 1 powered
 port 2 powered
# usbdevs -d
addr 1: UHCI root hub, Intel
  uhub0
#

but if FreeBSD autodetected it, I, myself, am not detecting it. :( I guess I 
forgot I how did it in 4.7 :(

But how do I mount it? I've tried:

# mkdir /mnt/usb
# mount -t msdos /dev/usb /mnt/usb
msdosfs: /dev/usb: Block device required
# mount -t msdos /dev/usb0 /mnt/usb
msdosfs: /dev/usb0: Block device required
# mount -t msdos /dev/ad0s1a /mnt/usb
msdosfs: /dev/ad0s1a: Device busy
# mount -t msdos /dev/ad0s1b /mnt/usb
msdosfs: /dev/ad0s1b: Device busy
# mount -t msdos /dev/ad0s1c /mnt/usb
msdosfs: /dev/ad0s1c: Invalid argument
# mount_msdosfs /dev/ad0s1b /mnt/usb
mount_msdosfs: /dev/ad0s1b: Device busy
#

# cat /etc/fstab
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/ad0s1b             none            swap    sw              0       0
/dev/ad0s1a             /               ufs     rw              1       1
/dev/acd0               /cdrom          cd9660  ro,noauto       0       0
#

Thanks for your help. The winning command itself would be nice :)



More information about the freebsd-questions mailing list