Wiki2
MountUSBDrive

Mount USB drive in OpenBSD

First check which device the drive has been allocated to.

# dmesg
...
sd1 at scsibus1 targ 1 lun 0: <WD, Ext HDD 1021, 2021> SCSI2 0/direct fixed serial.10581021313133393932
sd1: 953867MB, 512 bytes/sector, 1953519616 sectors
...

Then check available partitions

# fdisk sd1      
Disk: sd1	geometry: 121600/255/63 [1953519616 Sectors]
Offset: 0	Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]

 0: EE      0   0   2 -     25 127  14 [           1:      409639 ] EFI GPT     
 1: AF     25 127  15 - 109456 108  12 [      409640:  1758007816 ] MacOS X HFS+
 2: 0B 109472 212  53 - 121600 215  23 [  1758681088:   194836480 ] Win95 FAT-32
 3: 00      0   0   0 -      0   0   0 [           0:           0 ] unused

# disklabel sd1
# /dev/rsd1c:
type: SCSI
disk: SCSI disk
label: Ext HDD 1021    
duid: 0000000000000000
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 121600
total sectors: 1953519616
boundstart: 0
boundend: 1953519616
drivedata: 0 

16 partitions:
#                size           offset  fstype [fsize bsize  cpg]
  c:       1953519616                0  unused                   
  i:           409639                1 unknown                   
  j:       1758007816           409640 unknown                   
  k:        194836480       1758681088   MSDOS

Select which partition to mount and the mount it. Assumes that mount path under /mnt/usbdisk already is created.

# mount_msdos /dev/sd1k /mnt/usbdisk/

Don’t forget to unmount the disk before it is removed.

# umount /mnt/usbdisk/