> From: zfs-discuss-boun...@opensolaris.org [mailto:zfs-discuss-
> boun...@opensolaris.org] On Behalf Of Chris Josephes
> 
> I have a host running svn_133 with a root mirror pool that I'd like to
> rebuild with a fresh install on new hardware; but I still have data on
> the pool that I would like to preserve.

So, after rebuilding, you don't want to restore the same OS that you're
currently running.  But there are some files you'd like to save for after
you reinstall.  Why not just copy them off somewhere, in a tarball or
something like that?


> Given a rpool with disks c7d0s0 and c6d0s0, I think the following
> process will do what I need:
> 
> 1. Run these commands
> 
> # zpool detach rpool c6d0s0
> # zpool create preserve c6d0s0

The only reason you currently have the rpool in a slice (s0) is because
that's a requirement for booting.  If you aren't planning to boot from the
device after breaking it off the mirror ... Maybe just use the whole device
instead of the slice.

zpool create preserve c6d0


> # zfs create export/home
> # zfs send rpool/export/home | zfs receive preserve/home
> # zfs send (other filesystems)
> # zpool export preserve

These are not right.  It should be something more like this:
zfs create -o readonly=on preserve/rpool_export_home
zfs snapshot rpool/export/h...@fubarsnap
zfs send rpool/export/h...@fubarsnap | zfs receive -F
preserve/rpool_export_home

And finally
zpool export preserve


> 2. Build out new host with svn_134, placing new root pool on c6d0s0 (or
> whatever it's called on the new SATA controller)

Um ... I assume that's just a type-o ... 
Yes, install fresh.  No, don't overwrite the existing "preserve" disk.

For that matter, why break the mirror at all?  Just install the OS again,
onto a single disk, which implicitly breaks the mirror.  Then when it's all
done, use "zpool import" to import the other half of the mirror, which you
didn't overwrite.


> 3. Run zpool import against "preserve", copy over data that should be
> migrated.
> 
> 4. Rebuild the mirror by destroying the "preserve" pool and attaching
> c7d0s0 to the rpool mirror.
> 
> Am I missing anything?

If you blow away the partition table of the 2nd disk (as I suggested above,
but now retract) then you'll have to recreate the partition table of the
second disk.  So you only attach s0 to s0.

After attaching, and resilvering, you'll want to installgrub on the 2nd
disk, or else it won't be bootable after the first disk fails.  See the ZFS
Troubleshooting Guide for details.

_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to