Cindy Swearingen
2011-Jul-26 14:55 UTC
[zfs-discuss] Adding mirrors to an existing zfs-pool]
Subject: Re: [zfs-discuss] Adding mirrors to an existing zfs-pool Date: Tue, 26 Jul 2011 08:54:38 -0600 From: Cindy Swearingen <cindy.swearingen at oracle.com> To: Bernd W. Hennig <consulting at hennig-consulting.com> References: <342994905.11311662049567.JavaMail.Twebapp at sf-app1> Hi Bernd, If you are talking about attaching 4 new disks to a non redundant pool with 4 disks, and then you want to detach the previous disks then yes, this is possible and a good way to migrate to new disks. The new disks must be the equivalent size or larger than the original disks. See the hypothetical example below. If you mean something else, then please provide your zpool status output. Thanks, Cindy # zpool status tank pool: tank state: ONLINE scan: resilvered 1018K in 0h0m with 0 errors on Fri Jul 22 15:54:52 2011 config: NAME STATE READ WRITE CKSUM tank ONLINE 0 0 0 c4t1d0 ONLINE 0 0 0 c4t2d0 ONLINE 0 0 0 c4t3d0 ONLINE 0 0 0 c4t4d0 ONLINE 0 0 0 # zpool attach tank c4t1d0 c6t1d0 # zpool attach tank c4t2d0 c6t2d0 # zpool attach tank c4t3d0 c6t3d0 # zpool attach tank c4t4d0 c6t4d0 The above syntax will create 4 mirrored pairs of disks. Attach each new disk, wait for it to resilver, attach the next disk, resilver, and so on. I would scrub the pool after resilvering is complete, and check fmdump to ensure all new devices are operational. When all the disks are replaced and the pool is operational, detach the original disks. # zpool detach tank c4t1d0 # zpool detach tank c4t2d0 # zpool detach tank c4t3d0 # zpool detach tank c4t4d0 On 07/26/11 00:33, Bernd W. Hennig wrote:> G''Day, > > - zfs pool with 4 disks (from Clariion A) > - must migrate to Clariion B (so I created 4 disks with the same size, > avaiable for the zfs) > > The zfs pool has no mirrors, my idea was to add the new 4 disks from > the Clariion B to the 4 disks which are still in the pool - and later > remove the original 4 disks. > > I only found in all example how to create a new pool with mirrors > but no example how to add to a pool without mirrors a mirror disk > for each "disk" in the pool. > > - is it possible to add disks to each disk in the pool (they have different > sizes, so I have exact add the correct disks form Clariion B to the > original disk from Clariion B) > - can I later "remove" the disks from the Clariion A, pool is intact, user > can work with the pool > > > ?? > > Sorry for the beginner questions.... > > Tnx for help
David Dyer-Bennet
2011-Jul-28 16:53 UTC
[zfs-discuss] Adding mirrors to an existing zfs-pool]
On Tue, July 26, 2011 09:55, Cindy Swearingen wrote:> > Subject: Re: [zfs-discuss] Adding mirrors to an existing zfs-pool > Date: Tue, 26 Jul 2011 08:54:38 -0600 > From: Cindy Swearingen <cindy.swearingen at oracle.com> > To: Bernd W. Hennig <consulting at hennig-consulting.com> > References: <342994905.11311662049567.JavaMail.Twebapp at sf-app1> > > Hi Bernd, > > If you are talking about attaching 4 new disks to a non redundant pool > with 4 disks, and then you want to detach the previous disks then yes, > this is possible and a good way to migrate to new disks. > > The new disks must be the equivalent size or larger than the original > disks. > > See the hypothetical example below. > > If you mean something else, then please provide your zpool status > output. > > Thanks, > > Cindy > > > # zpool status tank > pool: tank > state: ONLINE > scan: resilvered 1018K in 0h0m with 0 errors on Fri Jul 22 15:54:52 2011 > config: > > NAME STATE READ WRITE CKSUM > tank ONLINE 0 0 0 > c4t1d0 ONLINE 0 0 0 > c4t2d0 ONLINE 0 0 0 > c4t3d0 ONLINE 0 0 0 > c4t4d0 ONLINE 0 0 0 > > > # zpool attach tank c4t1d0 c6t1d0 > # zpool attach tank c4t2d0 c6t2d0 > # zpool attach tank c4t3d0 c6t3d0 > # zpool attach tank c4t4d0 c6t4d0 > > The above syntax will create 4 mirrored pairs of disks.I was somewhat surprised when I first learned of this. In my head, I now remember it as "a single disk in ZFS seems to be treated as a one-disk mirror". Previously, in my head, single disks were very different objects from mirrors! I''m still impressed by the ability to attach and detach arbitrary numbers of disks to mirrors. It makes upgrading mirrored disks very very safe, since I can perform the entire procedure without ever reducing redundancy below my starting point (using the classic attach new, resilver, detach old sequence, repeated for however many disks were in the original mirror). -- David Dyer-Bennet, dd-b at dd-b.net; http://dd-b.net/ Snapshots: http://dd-b.net/dd-b/SnapshotAlbum/data/ Photos: http://dd-b.net/photography/gallery/ Dragaera: http://dragaera.info
Bob Friesenhahn
2011-Jul-28 18:22 UTC
[zfs-discuss] Adding mirrors to an existing zfs-pool]
On Thu, 28 Jul 2011, David Dyer-Bennet wrote:> I''m still impressed by the ability to attach and detach arbitrary numbers > of disks to mirrors. It makes upgrading mirrored disks very very safe,Zfs mirrors are super-cool. They are really flexible and recover quickly. Bob -- Bob Friesenhahn bfriesen at simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer, http://www.GraphicsMagick.org/