OpenBSD Mount And Use a USB Flash Drive

by on May 27, 2007 · 5 comments· LAST UPDATED May 27, 2009

in , ,

How do I mount and use a USB pen or hard disk under OpenBSD operating systems?

OpenBSD does supports USB storage devices such as pen and hard disk via emulated SCSI drives.

First, insert your your USB flash drive in USB socket.

Next type the following command to create a directory (mount point), enter:
# mkdir /mnt/pen

Mount the flash drive using mount command at /mnt/pen, enter:
# mount /dev/sd0i /mnt/pen

You may need to replace /dev/sd0i with actual device name.

Now you can access the files at /mnt/pen:
# cd /mnt/pen
# ls -l
# cp filename /path/to/dir

Finally, unmount the flash filesystem using the following command:
# umount /mnt/pen

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 5 comments… read them below or add one }

1 Allan June 30, 2009 at 4:51 pm

“You may need to replace /dev/sd0i with actual device name.”

For people new to OpenBSD, how do you find the actual device name?


2 nixCraft June 30, 2009 at 7:34 pm

Use dmesg. The device shows up in dmesg output after plugging it in. You can also use usbdevs.


3 100 June 7, 2010 at 12:59 am

How did you know the ‘i’ in sd0i? Dmesg only shows ‘sd0′ with no ending.


4 100 August 7, 2010 at 12:44 pm

Answering my own question:

$ disklabel sd0

At the end, you will see the partitions. The i-label denotes a partition.


5 dean October 3, 2010 at 3:37 pm

another way
# sysctl hw.disknames

will show (example)
$ sysctl hw.disknames


Leave a Comment

Tagged as: , , , , , , , , ,

Previous Faq:

Next Faq: