NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Access partitions on a file in NetBSD (kpartx alternative)



On Sun, Mar 17, 2013 at 08:19:11PM +0100, tech mailinglists wrote:
> 
> I am searching for a tool or method to access paritions from a file. So for
> example I have a simple file or logical volume which contains a partition
> table and multiple partitions. So I normally can't mount this partitions
> with mount.
> 
> In Linux for example I would simply use kpartx to get dummy/pointer-devices
> for the partitions in /dev/mapper/ so is there a tool which do the same on
> NetBSD to get access to the partitions within the file or logical volume?

In case of an image/file, you could probably use vnconfig(8):

        vnconfig -c device file

and dkctl(8):

        dkctl device addwedge name startblk blkcnt

which "defines a ``wedge'' on the specified disk starting at block
number startblk and spanning blkcnt blocks."

In order to get startblk and blkcnt you could use fdisk(8):

        fdisk device

assuming the image/file contains an mbr.

                Petar Bogdanovic


Home | Main Index | Thread Index | Old Index