Ben Rockwood
2006-Jan-30 00:15 UTC
[zfs-discuss] Adding a mirror to an existing single disk zpool
Hello All, I''m transitioning data off my old UFS partitions onto ZFS. I don''t have a lot of duplicate space so I created a zpool, rsync''ed the data from UFS to the ZFS mount and then repartitioned the UFS drive to have partitions that match the cylinder count of the ZFS. The idea here is that once the data is over I wipe out UFS and then attach that partition to the zpool as a mirror. Problem is, I can''t see how to do this. I can add the drive in a concat fashion but can''t see how to add it as a mirror. So how do I turn a ZFS concat into a ZFS mirror without having to start from scratch? benr. This message posted from opensolaris.org
Eric Schrock
2006-Jan-30 00:23 UTC
[zfs-discuss] Adding a mirror to an existing single disk zpool
On Sun, Jan 29, 2006 at 04:15:23PM -0800, Ben Rockwood wrote:> Hello All, > > I''m transitioning data off my old UFS partitions onto ZFS. I don''t > have a lot of duplicate space so I created a zpool, rsync''ed the > data from UFS to the ZFS mount and then repartitioned the UFS drive > to have partitions that match the cylinder count of the ZFS. The > idea here is that once the data is over I wipe out UFS and then > attach that partition to the zpool as a mirror. > > Problem is, I can''t see how to do this. I can add the drive in a > concat fashion but can''t see how to add it as a mirror. So how do I > turn a ZFS concat into a ZFS mirror without having to start from > scratch?If you want to do something like: diskA -> mirror(diskA, diskB) You can use the ''zpool attach'' command. If, however, you want to do something like: diskA, diskB -> mirror(diskA, diskB) Where ''A'' and ''B'' are in a dynamic stripe, this isn''t currently possible. Once we support device removal, you will be able to remove one drive or the other, and then re-attach it using ''zpool attach''. - Eric -- Eric Schrock, Solaris Kernel Development http://blogs.sun.com/eschrock
Jonathan Adams
2006-Jan-30 00:32 UTC
[zfs-discuss] Adding a mirror to an existing single disk zpool
On Sun, Jan 29, 2006 at 04:15:23PM -0800, Ben Rockwood wrote:> Hello All, > > I''m transitioning data off my old UFS partitions onto ZFS. I don''t > have a lot of duplicate space so I created a zpool, rsync''ed the > data from UFS to the ZFS mount and then repartitioned the UFS drive > to have partitions that match the cylinder count of the ZFS. The > idea here is that once the data is over I wipe out UFS and then > attach that partition to the zpool as a mirror. > > Problem is, I can''t see how to do this. I can add the drive in a > concat fashion but can''t see how to add it as a mirror. So how do > I turn a ZFS concat into a ZFS mirror without having to start from > scratch?You want "zpool attach": % zpool create foo c0t0d0s7 % zfs create foo/data (copy data to /foo/data, freeing up c0t1d0s7 (or whatever)) % zpool attach foo c0t0d0s7 c0t1d0s7 which will start a scrub (to copy over the data on c0t0d0s7). You can watch the progress using "zpool status". The end result will be: foo mirror c0t0d0s7 c0t1d0s7 Make sense? Cheers, - jonathan -- Jonathan Adams, Solaris Kernel Development
Ben Rockwood
2006-Jan-30 03:34 UTC
[zfs-discuss] Re: Adding a mirror to an existing single disk zpool
Perfect, thanks guys! I thought attach only worked for existing mirrors. benr. This message posted from opensolaris.org
Ben Rockwood
2006-Jan-30 03:36 UTC
[zfs-discuss] Re: Adding a mirror to an existing single disk zpool
Just for the record and all, I thought I''d add some syntax for the archives: root at aeon storage2$ zpool status pool: storage2 state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM storage2 ONLINE 0 0 0 c3d1s0 ONLINE 0 0 0 root at aeon storage2$ zpool attach -f storage2 c3d1s0 c1d0s0 root at aeon storage2$ zpool status pool: storage2 state: ONLINE status: One or more devices is currently being resilvered. The pool will continue to function, possibly in a degraded state. action: Wait for the resilver to complete. scrub: resilver in progress, 0.00% done, 161h26m to go config: NAME STATE READ WRITE CKSUM storage2 ONLINE 0 0 0 mirror ONLINE 0 0 0 c3d1s0 ONLINE 0 0 0 c1d0s0 ONLINE 0 0 0 1.03M resilvered The -f was only needed because the parition (or the at least the first couple bits of it) I''m mirroring to previously had a UFS filesystem on it. benr. This message posted from opensolaris.org