Skip to content

Comment on Mounting partitions from a dd image

Comments

OpenBSD uses vnconfig (also FreeBSD; on NetBSD it's vndconfig). An example:

  # vnconfig vnd0 install63.fs
Then you can treat vnd0 as if it was a disk:
  # disklabel vnd0
  # /dev/rvnd0c:
  type: vnd
  disk: vnd device
  label: fictitious
  duid: 138b4f2a2e184426
  flags:
  bytes/sector: 512
  sectors/track: 100
  tracks/cylinder: 1
  sectors/cylinder: 100
  cylinders: 7382
  total sectors: 738240
  boundstart: 1024
  boundend: 737280
  drivedata: 0 
  
  16 partitions:
  #                size           offset  fstype [fsize bsize   cpg]
    a:           736256             1024  4.2BSD   2048 16384 16142 
    c:           738240                0  unused                    
    i:              960               64   MSDOS                    
For instance, to mount the 'a' partition:
  # mount /dev/vnd0a /mnt
You can also associate an encryption key with the device. All data written to the diskimage will then be encrypted.

FreeBSD does not use vnconfig, FreeBSD uses mdconfig:

    # mdconfig -f smartos-latest-USB.img
    md0
    # gpart list md0
    ...
    scheme: MBR
    Providers:
    1. Name: md0s1
       ...
    # mount -o ro -t msdosfs /dev/md0s1 /mnt
    // (or, use labels)
    # mount -o ro -t msdosfs /dev/msdosfs/SMARTOSBOOT /mnt
Or for ISOs, in one line:
    # mount -t cd9660 /dev/$(mdconfig -f image.iso) /mnt

I was just about to correct your correction, because I can quite clearly recall using vnconfig on FreeBSD.

Apparently that's been a little while, however. According to vnconfig(8):

The mdconfig utility first appeared in FreeBSD 5.0 as a cleaner replacement for the vn(4) and vnconfig(8) combo.

5.0 was released just over 15 years ago.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.