Orvar Korvar
2009-Jan-07 16:14 UTC
[zfs-discuss] Possible to copy a zpool safely? rsync? zfs send?
I have a ZFS raid with 4 samsung 500GB disks. I now want 5 drives samsung 1TB instead. So I connect the 5 drives, create a zpool raidz1 and copy the content from the old zpool to the new zpool. Is there a way to safely copy the zpool? Make it sure that it really have been copied safely? Ideally I would like a tool that copies from source to destination and checks that the copy went through. A night mare would be if the copy get interrupted, and I have to copy again. How can I be sure that the new invocation has copied everything, from the interruption? Using gnu commander feels a bit unsafe. It will only copy blindly(?), and no more. Will it tell me if something went wrong? How do you make sure the copy has been correct? Is there any utility that does exactly that? (Does cp warn if there was any error?) -- This message posted from opensolaris.org
[a quick reply to the beloved Orvar, on my lunch hour...] economy is bad, save some $ -- don''t pay for tools, do your own open solution for this. know JAVA? Hash your data and see if they are cool. http://oceanstore.sourceforge.net/javadoc/pond/ostore/dataobj/DataObject.DataBlock.html#computeVhash() best, SuperUser, z ----- Original Message ----- From: "Orvar Korvar" <knatte_fnatte_tjatte at yahoo.com> To: <zfs-discuss at opensolaris.org> Sent: Wednesday, January 07, 2009 11:14 AM Subject: [zfs-discuss] Possible to copy a zpool safely? rsync? zfs send?>I have a ZFS raid with 4 samsung 500GB disks. I now want 5 drives samsung >1TB instead. So I connect the 5 drives, create a zpool raidz1 and copy the >content from the old zpool to the new zpool. > > Is there a way to safely copy the zpool? Make it sure that it really have > been copied safely? Ideally I would like a tool that copies from source to > destination and checks that the copy went through. A night mare would be > if the copy get interrupted, and I have to copy again. How can I be sure > that the new invocation has copied everything, from the interruption? > Using gnu commander feels a bit unsafe. It will only copy blindly(?), and > no more. Will it tell me if something went wrong? > > How do you make sure the copy has been correct? Is there any utility that > does exactly that? (Does cp warn if there was any error?) > -- > This message posted from opensolaris.org > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
Cindy.Swearingen at Sun.COM
2009-Jan-07 18:27 UTC
[zfs-discuss] Possible to copy a zpool safely? rsync? zfs send?
Orvar, Two choices are described below, where safety is the priority. I prefer the first one (A). Cindy A. Replace each 500GB disk in the existing pool with a 1 TB drive. Then, add the 5th 1TB drive as a spare. Depending on the Solaris release you are running, you might need to export/import the pool to see the expanded capacity (as a step 8) due to an existing bug. 1. Physically connect the new disks. 2. Replace the first disk. # zpool replace pool 500GB-1 1TB-1 3. Let resilver complete, then scrub. # zpool scrub pool 4. Replace the second disk. # zpool replace pool 500GB-2 1TB-2 5. Let resilver complete, then scrub. # zpool scrub pool 6. Repeat steps 2-5 until 4 disks are replaced. 7. Add 1TB-5 as a spare: # zpool add pool spare 1TB-5 B. Use zfs send/receive to copy ZFS datasets to new pool. 1. Physically connect the new disks. 2. Create the new pool with new disks. 3. Use zfs send/receive to copy ZFS datasets from old pool to new pool. 4. Make sure all data is available in the new pool between each zfs send/receive operation. Don''t destroy the old pool until all data is verified. Orvar Korvar wrote:> I have a ZFS raid with 4 samsung 500GB disks. I now want 5 drives samsung 1TB instead. So I connect the 5 drives, create a zpool raidz1 and copy the content from the old zpool to the new zpool. > > Is there a way to safely copy the zpool? Make it sure that it really have been copied safely? Ideally I would like a tool that copies from source to destination and checks that the copy went through. A night mare would be if the copy get interrupted, and I have to copy again. How can I be sure that the new invocation has copied everything, from the interruption? Using gnu commander feels a bit unsafe. It will only copy blindly(?), and no more. Will it tell me if something went wrong? > > How do you make sure the copy has been correct? Is there any utility that does exactly that? (Does cp warn if there was any error?)
Richard Elling
2009-Jan-07 18:42 UTC
[zfs-discuss] Possible to copy a zpool safely? rsync? zfs send?
Additional comment: zfs receive verifies the data sent. It also can maintain the snapshots, which is handy. rsync will also verify the data sent between source and destination. rsync doesn''t know anything about snapshots, though it might be a best practice to use a snapshot as an rsync source. I would consider both zfs send/receive and rsync to do a reasonable job of verifying data. rsync''s --checksum option will work, if you double-pump the rsync. If you are truly paranoid, you can also create your own digests (eg. md5) of the files for comparison. -- richard Cindy.Swearingen at Sun.COM wrote:> Orvar, > > Two choices are described below, where safety is the priority. > I prefer the first one (A). > > Cindy > > A. Replace each 500GB disk in the existing pool with a 1 TB drive. > Then, add the 5th 1TB drive as a spare. Depending on the Solaris > release you are running, you might need to export/import the > pool to see the expanded capacity (as a step 8) due to an existing > bug. > > 1. Physically connect the new disks. > > 2. Replace the first disk. > > # zpool replace pool 500GB-1 1TB-1 > > 3. Let resilver complete, then scrub. > > # zpool scrub pool > > 4. Replace the second disk. > > # zpool replace pool 500GB-2 1TB-2 > > 5. Let resilver complete, then scrub. > > # zpool scrub pool > > 6. Repeat steps 2-5 until 4 disks are replaced. > > 7. Add 1TB-5 as a spare: > > # zpool add pool spare 1TB-5 > > B. Use zfs send/receive to copy ZFS datasets to new pool. > > 1. Physically connect the new disks. > > 2. Create the new pool with new disks. > > 3. Use zfs send/receive to copy ZFS datasets from old pool > to new pool. > > 4. Make sure all data is available in the new pool between each > zfs send/receive operation. Don''t destroy the old pool until > all data is verified. > > > > > Orvar Korvar wrote: > >> I have a ZFS raid with 4 samsung 500GB disks. I now want 5 drives samsung 1TB instead. So I connect the 5 drives, create a zpool raidz1 and copy the content from the old zpool to the new zpool. >> >> Is there a way to safely copy the zpool? Make it sure that it really have been copied safely? Ideally I would like a tool that copies from source to destination and checks that the copy went through. A night mare would be if the copy get interrupted, and I have to copy again. How can I be sure that the new invocation has copied everything, from the interruption? Using gnu commander feels a bit unsafe. It will only copy blindly(?), and no more. Will it tell me if something went wrong? >> >> How do you make sure the copy has been correct? Is there any utility that does exactly that? (Does cp warn if there was any error?) >> > > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss >
Orvar Korvar
2009-Jan-07 19:37 UTC
[zfs-discuss] Possible to copy a zpool safely? rsync? zfs send?
Cindy and you all, thanx for your answers! I have got us several more OpenSolaris converts meanwhile. One guy said, "Why didnt I try ZFS before??" :o) A quick question, in scenario A) My old 4 samsung 500GB is a raidz1. If I exchange each drive and finally add a hot spare, it is not the same result as if I create a raidz1 out of all the 5 samsung 1TB? It is more, a raidz1 + a hot spare? That is not really what I want. Therefore I will try the zfs send and receive. Thanx! :o) I will do something like # zfs snapshot mypool/myfs at now # zfs send mypool/myfs at now | zfs receive anotherpool/anotherfs at anothersnap -- This message posted from opensolaris.org
Cindy.Swearingen at Sun.COM
2009-Jan-07 21:31 UTC
[zfs-discuss] Possible to copy a zpool safely? rsync? zfs send?
Hi Orvar, Option A effectively doubles your existing pool (500GB x 4-->1TB x 4) *and* provides increased reliability. This is the difference between options A and B. I also like the convenience of just replacing the smaller disks with larger disks in the existing pool and not having to create a new pool to move data around. Replace disks and done! Next question... Cindy Orvar Korvar wrote:> Cindy and you all, thanx for your answers! I have got us several more OpenSolaris converts meanwhile. One guy said, "Why didnt I try ZFS before??" :o) > > A quick question, in scenario A) > My old 4 samsung 500GB is a raidz1. If I exchange each drive and finally add a hot spare, it is not the same result as if I create a raidz1 out of all the 5 samsung 1TB? It is more, a raidz1 + a hot spare? That is not really what I want. > > Therefore I will try the zfs send and receive. Thanx! :o) > > I will do something like > > # zfs snapshot mypool/myfs at now > # zfs send mypool/myfs at now | zfs receive anotherpool/anotherfs at anothersnap
Ok, Cindy, Next question is, let me do this for Orvar -- any of the existing snapshot settings need to be changed for the new disks, before they corrupt the baby data? :-) best, z ----- Original Message ----- From: <Cindy.Swearingen at Sun.COM> To: "Orvar Korvar" <knatte_fnatte_tjatte at yahoo.com> Cc: <zfs-discuss at opensolaris.org> Sent: Wednesday, January 07, 2009 4:31 PM Subject: Re: [zfs-discuss] Possible to copy a zpool safely? rsync? zfs send?> Hi Orvar, > > Option A effectively doubles your existing pool (500GB x 4-->1TB x 4) > *and* provides increased reliability. This is the difference between > options A and B. > > I also like the convenience of just replacing the smaller disks with > larger disks in the existing pool and not having to create a new pool > to move data around. > > Replace disks and done! Next question... > > Cindy > > > > Orvar Korvar wrote: >> Cindy and you all, thanx for your answers! I have got us several more >> OpenSolaris converts meanwhile. One guy said, "Why didnt I try ZFS >> before??" :o) >> >> A quick question, in scenario A) >> My old 4 samsung 500GB is a raidz1. If I exchange each drive and finally >> add a hot spare, it is not the same result as if I create a raidz1 out of >> all the 5 samsung 1TB? It is more, a raidz1 + a hot spare? That is not >> really what I want. >> >> Therefore I will try the zfs send and receive. Thanx! :o) >> >> I will do something like >> >> # zfs snapshot mypool/myfs at now >> # zfs send mypool/myfs at now | zfs receive >> anotherpool/anotherfs at anothersnap > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss