Wednesday, June 12, 2013

Mount FAT-32 External Drive in OpenBSD

Enter a virtual console by shutting down any X11 sessions, then insert your external drive. Watch the messages that come up; from here, you'll get the partition name assigned to it. Then, assuming our drive has been assigned "sd1":
$ sudo disklabel sd1
# /dev/rsd1c:
type: SCSI
disk: SCSI disk
label: Elements 1023   
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:       1953517568             2048   MSDOS  

The "c" partition indicates the entire device, so we won't try to mount that. That leaves the "i" partition. From the output above, using the highlighted field as a guide (since we want to mount MSDOS):
$ sudo mount -t msdos /dev/sd1i /mnt

Verification:
$ df -lh
(or)
$ mount

Scroll down to see the partition /dev/sd1i listed as one of our mounted partions.

No comments:

Post a Comment