Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Jun 2017 09:08:49 -0600
From:      Alan Somers <asomers@freebsd.org>
To:        Ronald Klop <ronald-lists@klop.ws>
Cc:        FreeBSD <freebsd-stable@freebsd.org>
Subject:   Re: mdconfig zpool from copied partition?
Message-ID:  <CAOtMX2hjy6F%2BvjPfrdnzFsuHytk_SDXOfBcVhdAfTLpYGkKnLw@mail.gmail.com>
In-Reply-To: <op.y1cuza01kndu52@53556c9c.cm-6-6b.dynamic.ziggo.nl>
References:  <op.y1cuza01kndu52@53556c9c.cm-6-6b.dynamic.ziggo.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jun 5, 2017 at 4:19 AM, Ronald Klop <ronald-lists@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOtMX2hjy6F%2BvjPfrdnzFsuHytk_SDXOfBcVhdAfTLpYGkKnLw>