OpenBSD: Mounting a USB stick

November 11, 2008
Filed under: BSD 

In the previous post, I wrote about mounting a USB stick on FreeBSD 7.0-RELEASE. Here’s how you do it on OpenBSD. OS version is 4.3-current; the pen drive is still the same 2Gb Imation stick used in the last post.


Plug the stick in, and check dmesg(8) output. Here’s how dmesg on OpenBSD sees the drive:










umass0 at uhub0 port 2 configuration 1 interface 0 "Imation Nano" rev 2.00/1.10 addr 2
umass0: using SCSI over Bulk-Only
scsibus1 at umass0: 2 targets
sd0 at scsibus1 targ 1 lun 0: <Imation, Nano, PMAP> SCSI0 0/direct removable
sd0: 1911MB, 243 cyl, 255 head, 63 sec, 512 bytes/sec, 3913728 sec total

Note that the system attaches the drive to the sd driver, and denotes it sd0.

su to root:

[mish@blah ~]$ su
Password:
[root@blah /home/mish]#

Use disklabel(8) to check how the drive is configured:

[root@blah /home/mish]# disklabel sd0
disklabel: warning, DOS partition table with no valid OpenBSD partition
# /dev/rsd0c:
type: SCSI
disk: SCSI disk
label: Nano
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 243
total sectors: 3913728
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0
 
16 partitions:
#                size           offset  fstype [fsize bsize  cpg]
  c:          3913728                0  unused      0     0
  i:          3905664             8064   MSDOS
[root@blah /home/mish]#

Here you can see that the letter i denotes the relevant partition.

We’ve got the information we need. Now, mount it:

[root@blah /home/mish]# mount -t msdos /dev/sd0i /mnt
[root@blah /home/mish]#

Done.

Addendum: Here’s how dmesg reports it when you unplug the stick:

sd0 detached
scsibus1 detached
umass0 detached

#####
References:
dmesg(8)
sd(4)
disklabel(8)
mount(8)





Related Posts:

  • FreeBSD: Mounting a USB stick
  • “LOL”
  • OpenBSD: Making changes to the stock Sendmail configuration
  • OpenBSD: Making “pkg_add” even easier
  • Been in “Draft” mood for a while now
  • OpenBSD: Updating ZoneEdit records automatically
  • Yet another “What is OpenBSD?” article
  • OpenBSD: Hosting multiple domains using Name-based Virtual Hosts
  • OpenBSD: Traffic monitoring with trafshow
  • OpenBSD needs our help


  • << Previous | Next >>

    « FreeBSD: Mounting a USB stick
    PATATAG: Nov. 21 reunion concert at 70s Bistro »