Date: Wed, 30 Jan 2013 10:43:26 +0100 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= <uqs@FreeBSD.org> To: Fabian Keil <freebsd-listen@fabiankeil.de> Cc: Peter Jeremy <peter@rulingia.com>, Dan Nelson <dnelson@allantgroup.com>, current@freebsd.org, fs@freebsd.org Subject: Re: Zpool surgery Message-ID: <20130130094326.GT35868@acme.spoerlein.net> In-Reply-To: <20130129155250.29d8f764@fabiankeil.de> References: <20130127103612.GB38645@acme.spoerlein.net> <1F0546C4D94D4CCE9F6BB4C8FA19FFF2@multiplay.co.uk> <20130127201140.GD29105@server.rulingia.com> <20130128085820.GR35868@acme.spoerlein.net> <20130128205802.1ffab53e@fabiankeil.de> <20130128214111.GA14888@dan.emsphone.com> <20130129155250.29d8f764@fabiankeil.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 2013-01-29 at 15:52:50 +0100, Fabian Keil wrote: > Dan Nelson <dnelson@allantgroup.com> wrote: > > > In the last episode (Jan 28), Fabian Keil said: > > > Ulrich Spörlein <uqs@FreeBSD.org> wrote: > > > > On Mon, 2013-01-28 at 07:11:40 +1100, Peter Jeremy wrote: > > > > > On 2013-Jan-27 14:31:56 -0000, Steven Hartland <killing@multiplay.co.uk> wrote: > > > > > >----- Original Message ----- > > > > > >From: "Ulrich Spörlein" <uqs@FreeBSD.org> > > > > > >> I want to transplant my old zpool tank from a 1TB drive to a new > > > > > >> 2TB drive, but *not* use dd(1) or any other cloning mechanism, as > > > > > >> the pool was very full very often and is surely severely > > > > > >> fragmented. > > > > > > > > > > > >Cant you just drop the disk in the original machine, set it as a > > > > > >mirror then once the mirror process has completed break the mirror > > > > > >and remove the 1TB disk. > > > > > > > > > > That will replicate any fragmentation as well. "zfs send | zfs recv" > > > > > is the only (current) way to defragment a ZFS pool. > > > > > > It's not obvious to me why "zpool replace" (or doing it manually) > > > would replicate the fragmentation. > > > > "zpool replace" essentially adds your new disk as a mirror to the parent > > vdev, then deletes the original disk when the resilver is done. Since > > mirrors are block-identical copies of each other, the new disk will contain > > an exact copy of the original disk, followed by 1TB of freespace. > > Thanks for the explanation. > > I was under the impression that zfs mirrors worked at a higher > level than traditional mirrors like gmirror but there seems to > be indeed less magic than I expected. > > Fabian To wrap this up, while the zpool replace worked for the disk, I played around with it some more, and using snapshots instead *did* work the second time. I'm not sure what I did wrong the first time ... So basically this: # zfs send -R oldtank@2013-01-22 | zfs recv -F -d newtank (takes ages, then do a final snapshot before unmounting and send the incremental) # zfs send -R -i 2013-01-22 oldtank@2013-01-29 | zfs recv -F -d newtank Allows me to send snapshots up to 2013-01-29 to the "archive" pool from either oldtank or newtank. Yay! Cheers, Uli
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130130094326.GT35868>