From owner-freebsd-fs@FreeBSD.ORG Fri Aug 16 13:56:24 2013 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0AF08BDC for ; Fri, 16 Aug 2013 13:56:24 +0000 (UTC) (envelope-from matt.home@userve.net) Received: from smtp-outbound.userve.net (smtp-outbound.userve.net [217.196.1.22]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9D179288A for ; Fri, 16 Aug 2013 13:56:23 +0000 (UTC) Received: from webmail.userve.net (db3.userve.net [217.196.1.19]) (authenticated bits=0) by smtp-outbound.userve.net (8.14.5/8.14.5) with ESMTP id r7GDuLnR042434 for ; Fri, 16 Aug 2013 14:56:21 +0100 (BST) (envelope-from matt.home@userve.net) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 16 Aug 2013 14:56:26 +0100 From: Matt Churchyard To: Subject: Re: what is the "correct" way to "replicate" mem stick with ZFS on =?UTF-8?Q?it=3F?= Message-ID: <82fb7b70d47ad58db2b2f0b803bf5160@users.userve.net> X-Sender: matt.home@userve.net User-Agent: Roundcube Webmail/0.8.0 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Aug 2013 13:56:24 -0000 > hi all, > > please, advice > > what is the "correct" way to "replicate" mem stick with ZFS on it? > > what I mean: > > we have mem stick with ZFS pool `mypool' on it > > how to get copy of the mem stick (including the name of the pool)? > > - `zfs send ... | zfs receive ...' ? > > is not what will help untill pool names > on both mem sticks are the same (it is not what I want) > > - to make mirror and to detach second mem stick after resilvering? > > I have bad experience with detaching (perhapse I do it wrong way) > > - dd ? I personally would be wary of completely cloning the filesystem due to it having completely identical GUID's etc. I'm not sure how the system will behave when given two disks with identical pools. You may be OK if you don't import the pools and there's no chance of two of the mem sticks being in the same machine again. Obviously dd should work to completely clone the memory stick. You could also use dd to create an image file of one memory stick and use that in future to provision other memory sticks. Detach is not a possible choice as it literally removes the device from ZFS, so that device is not marked as part of a ZFS pool anymore. You could attach the new device as a mirror, then use the 'zfs split' command to split the second mem stick off into a new pool. This will require the new pool to have a unique name though, as with the ZFS send/recv option. Personally I would prefer one of these options, and to then use 'zpool import new-pool-name required-pool-name' to import the pool with the correct name when beginning to use it.