mounting USB devices on OpenBSD

i’ve been trying to mount a USB device on the openBSD system, after struggling alot i found out the way to mount it correctly.

The following message is taken from the dmesg as i inserted my usb pendrive :
uhub2: Prolific Technology Inc. USB Embedded Hub, class 9/0, rev 2.00/1.00, addr 2
uhub2: 1 port with 0 removable, self powered
umass0: Prolific Technology Inc. USB Mass Storage Device, rev 2.00/1.00, addr 3
da0 at umass-sim0 bus 0 target 0 lun 0
da0: Removable Direct Access SCSI-0 device
da0: 1.000MB/s transfers
da0: 248MB (507904 512 byte sectors: 64H 32S/T 248C) 

as u can see, the device is loaded in to the da0 … so to mount the device type:

# mkdir /mnt/usb
# mount_msdosfs /dev/da0s1 /mnt/usb 

and to un mount it type:

# umount /mnt/usb
if it says that it cannot be unmounted, you can still umount it by using the -f flag, which is to force it.
# umount -f /mnt/usb

You can add an entry to /etc/fstab to mount it, so it can be mounted by default at boot time. Here is my entery of the fstab file:

fstab
i have given the options to be read and write, the dump column tells if it should back up this file system. If this field equals 0, dump will not back up the system. Otherwise, the number given is the minimum dump level needed to back up the system. The last field, the pass number, tells fsck when it should check the system during the boot process. The file systems with a 1-pass number are checked first, file systems with a 2-pass number are checked second, and so forth. If you set this to zero fsck will assume that the file system does not need to be checked.

well there you go, for more information on mount(8), use the manpages – its a gr8 help 🙂 hope this helps any of you.. CIAO

Advertisements

About this entry