Zpool surgery

Fabian Keil freebsd-listen at fabiankeil.de
Mon Jan 28 20:04:51 UTC 2013


Ulrich Spörlein <uqs at 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 at multiplay.co.uk> wrote:
> > >----- Original Message ----- 
> > >From: "Ulrich Spörlein" <uqs at 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.

> But are you then also supposed to be able send incremental snapshots to
> a third pool from the pool that you just cloned?

Yes.

> I did the zpool replace now over night, and it did not remove the old
> device yet, as it found cksum errors on the pool:
> 
> root at coyote:~# zpool status -v
>   pool: tank
>  state: ONLINE
> status: One or more devices has experienced an error resulting in data
>         corruption.  Applications may be affected.
> action: Restore the file in question if possible.  Otherwise restore the
>         entire pool from backup.
>    see: http://illumos.org/msg/ZFS-8000-8A
>   scan: resilvered 873G in 11h33m with 24 errors on Mon Jan 28 09:45:32 2013
> config:
> 
>         NAME           STATE     READ WRITE CKSUM
>         tank           ONLINE       0     0    27
>           replacing-0  ONLINE       0     0    61
>             da0.eli    ONLINE       0     0    61
>             ada1.eli   ONLINE       0     0    61
> 
> errors: Permanent errors have been detected in the following files:
> 
>         tank/src at 2013-01-17:/.svn/pristine/8e/8ed35772a38e0fec00bc1cbc2f05480f4fd4759b.svn-base
[...]
>         tank/ncvs at 2013-01-17:/ports/textproc/uncrustify/distinfo,v
> 
> Interestingly, these only seem to affect the snapshot, and I'm now
> wondering if that is the problem why the backup pool did not accept the
> next incremental snapshot from the new pool.

I doubt that. My expectation would be that it only prevents
the "zfs send" to finish successfully.

BTW, you could try reading the files to be sure that the checksum
problems are permanent and not just temporary USB issues.

> How does the receiving pool known that it has the correct snapshot to
> store an incremental one anyway? Is there a toplevel checksum, like for
> git commits? How can I display and compare that?

Try zstreamdump:

fk at r500 ~ $sudo zfs send -i @2013-01-24_20:48 tank/etc at 2013-01-26_21:14 | zstreamdump | head -11
BEGIN record
	hdrtype = 1
	features = 4
	magic = 2f5bacbac
	creation_time = 5104392a
	type = 2
	flags = 0x0
	toguid = a1eb3cfe794e675c
	fromguid = 77fb8881b19cb41f
	toname = tank/etc at 2013-01-26_21:14
END checksum = 1047a3f2dceb/67c999f5e40ecf9/442237514c1120ed/efd508ab5203c91c

fk at r500 ~ $sudo zfs send lexmark/backup/r500/tank/etc at 2013-01-24_20:48 | zstreamdump | head -11
BEGIN record
	hdrtype = 1
	features = 4
	magic = 2f5bacbac
	creation_time = 51018ff4
	type = 2
	flags = 0x0
	toguid = 77fb8881b19cb41f
	fromguid = 0
	toname = lexmark/backup/r500/tank/etc at 2013-01-24_20:48
END checksum = 1c262b5ffe935/78d8a68e0eb0c8e7/eb1dde3bd923d153/9e0829103649ae22

Fabian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20130128/c57f4243/attachment.sig>


More information about the freebsd-fs mailing list