From owner-freebsd-stable@freebsd.org Mon Jun 5 15:08:50 2017 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2CF8AFB400 for ; Mon, 5 Jun 2017 15:08:50 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-yb0-x22b.google.com (mail-yb0-x22b.google.com [IPv6:2607:f8b0:4002:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F7768324A for ; Mon, 5 Jun 2017 15:08:50 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-yb0-x22b.google.com with SMTP id 202so33755946ybd.0 for ; Mon, 05 Jun 2017 08:08:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=/BdAp38Loj2fw9QzjyS2vWIh2kdH2/4hCjxeJFEUQqs=; b=UAmaED+kXsX+tLfoaYbJN2tZnSBiARVGP4AXfmEdYv9pb6+Ku2KlySQSjGper1leDZ sA4Y7qM1jXccSwiqy+TrZKanwNzlrEhnX1fRKIgmu9xmlDJ15TkQVdQITkJ8qhS+4HIX sf9CZKh1ljEFGn1yOwpMnhX6ioCIk9ZENMpx2VJT65nJr6p8/IVrbEQPpvt22oZFuR+A 06EcC2s1Dkv7YYRtD1r4bUbTmaek5+9bEvONOw+IuUK34BsPSRyWEg6+w4G//wpriZfa mNWmWx8bTo2ReI1e0XEPN4HBmLlFlfmmYlarkxJCMfLSjO7QFPOwJsF7QlkLTlmEzKAO YKLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=/BdAp38Loj2fw9QzjyS2vWIh2kdH2/4hCjxeJFEUQqs=; b=j5D/zODV3YXnqdvA6fGvaxZrDf0zoTb6gBgutOWgWf3xXGVOAhDlpVYa/K70RlwXrM 8qZOuHYavTAUwzKOgfx4SrXBL7cfBfBAC3i8OWQ7TUBvI22S7RCAqKd3qfeXEd8ip5ds foWmPzC1nxLWez8SKKo278rzKm3/UPREGGudHhh+ybZNCLbFHMr/NOgiraUyS+rtKTlu CFXVcelihJeMhrJkBefos7tolQRYr7Avpa2KleCdUvuir98TmBHqV3Yd8TYJ7bOIdT5w 5kZh7ZTIYjqmz4XN9AV37AqPtu0qBcLj7+TgrricYQ/VZVRkhEHTPhCm9bQWAYUVR21i 3EeA== X-Gm-Message-State: AODbwcD3XTpa3Z5H89W/HRrQggxEd1KQTSGT1mTwwXpesvt1i/w7gb7h MSTW7/QLGMNoXdOh286Ouu+7EOAPlgCU X-Received: by 10.37.163.130 with SMTP id e2mr1595434ybi.248.1496675329755; Mon, 05 Jun 2017 08:08:49 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.13.206.199 with HTTP; Mon, 5 Jun 2017 08:08:49 -0700 (PDT) In-Reply-To: References: From: Alan Somers Date: Mon, 5 Jun 2017 09:08:49 -0600 X-Google-Sender-Auth: QJr346RYwwkcoWNRGY74jnNhPKY Message-ID: Subject: Re: mdconfig zpool from copied partition? To: Ronald Klop Cc: FreeBSD Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jun 2017 15:08:51 -0000 On Mon, Jun 5, 2017 at 4:19 AM, Ronald Klop 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 ". But since ZFS supports file-backed vdevs, you could skip a step and omit the mdconfig. Just do "zpool import -d /mnt/files/ronald " instead. -Alan