mdconfig zpool from copied partition?

Alan Somers asomers at freebsd.org
Mon Jun 5 15:08:51 UTC 2017


On Mon, Jun 5, 2017 at 4:19 AM, Ronald Klop <ronald-lists at klop.ws> wrote:
> Hi,
>
> I'm trying something like this:
> # dd if=/dev/da0p2 of=/somefile
> # mdconfig -f /somefile
> # zpool import md0
>
> da0p2 comes from my external usb-disk:
> =>        34  1953458109  da0  GPT  (931G)
>           34        2014       - free -  (1.0M)
>         2048   536870912    1  ms-basic-data  (256G)
>    536872960  1416583168    2  freebsd-zfs  (675G)
>   1953456128        2015       - free -  (1.0M)
>
> Is this possible? Or will I miss some partion info in the end?
>
> I already have this:
> # mdconfig -lv
> md0     vnode     104G  /mnt/files/ronald/freebsd-zfs.da0p2
>
> NB: my dd was interrupted after 104GB, but I'm making a new copy already.
>
> Regards,
> Ronald.

Provided that the external usb disk isn't already mounted, it ought to
work, but performance may suck for various reasons.  However, your
zpool syntax is wrong.  The correct invocation is "zpool import
<poolname>".  But since ZFS supports file-backed vdevs, you could skip
a step and omit the mdconfig.  Just do "zpool import -d
/mnt/files/ronald <poolname>" instead.

-Alan


More information about the freebsd-stable mailing list