I currently have a host that serves as a nominal backup host by receiving nightly differential snapshots of datasets/filesystems from a fileserver. Say that I want to move those snapshots to another system /as they are/ and continue to to do nightly snapshots from the fileserver only to a new host as if nothing has changed...How do I approach this as ''zfs send/recv'' from the manual doesn''t quite work the way I expect, e.g. "zfs send tank/snapshot at today | ssh newbox zfs recv tank/snapshot at today" barfs complaining that the fs already exists on the receiving host. I just want to copy all the snapshots on one host to another without altering them at all. I''m certain this must be do-able and that I''m doing it wrong somehow. -- This message posted from opensolaris.org
Elaine Ashton wrote:> I currently have a host that serves as a nominal backup host by receiving nightly differential snapshots of datasets/filesystems from a fileserver. > > Say that I want to move those snapshots to another system /as they are/ and continue to to do nightly snapshots from the fileserver only to a new host as if nothing has changed...How do I approach this as ''zfs send/recv'' from the manual doesn''t quite work the way I expect, e.g. > > "zfs send tank/snapshot at today | ssh newbox zfs recv tank/snapshot at today" > > barfs complaining that the fs already exists on the receiving host.You are sending a full copy of tank/snapshot.> I just want to copy all the snapshots on one host to another without altering them at all. > >If you just want the snapshots, send them to files. -- Ian.
> You are sending a full copy of tank/snapshot.Well, yes, but it wasn''t the behaviour I was quite expecting. I suspect that a ''zfs copy'' or somesuch would be a nice utility when wanting to shove a parent and all of it''s snapshots to another system.> If you just want the snapshots, send them to files.So, I could just use rsync and it would do the right thing? I''m rather new to zfs so I''m sorry if this seems like a dumb idea or question as the documentation circled around this idea but never really addressed the problem of someone wanting to merely move snapshots from one system to another. I wasn''t sure if rsync would do the right thing or not.> > -- > Ian. > > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discu > ss-- This message posted from opensolaris.org
Elaine Ashton wrote:>> You are sending a full copy of tank/snapshot. >> > > Well, yes, but it wasn''t the behaviour I was quite expecting. > > I suspect that a ''zfs copy'' or somesuch would be a nice utility when wanting to shove a parent and all of it''s snapshots to another system. > >If that''s what you want, do an incremental send (-I). -- Ian.
> If that''s what you want, do an incremental send (-I).Well, if I believe the documentation, -I will send ''all incremental streams from one snapshot to a cumulative snapshot'' which isn''t quite what I want. I more or less want an exact duplicate of the current system with the snapshots on another system. The -R option sounds more promising as it supposedly sends a ''replication stream of all descendent file systems.'' and claims all properties, snapshots, descendent filesystems and clones are preserved. I''ll give that a try and see if that is, indeed, what I''m looking for. Thanks :) -- This message posted from opensolaris.org
Actually, this is pretty cool. If I choose the last/latest/most recent snapshot and do like so: zfs send -R tank/filesystem/foobar at backup_DATE | ssh newsys zfs recv -d tank/test It copies everything over as I had hoped. I suppose this was somewhat obvious after re-reading the options but could maybe be more explicitly mentioned in the doc. Thanks, again. :) -- This message posted from opensolaris.org
Ian Collins <ian at ianshome.com> writes:>> I suspect that a ''zfs copy'' or somesuch would be a nice utility >> when wanting to shove a parent and all of it''s snapshots to >> another system. >> > If that''s what you want, do an incremental send (-I).To be a bit more detailed, first create the file system on the target machine by sending the first snapshot that you want to have replicated in full. After that, send each of the following snapshots incrementally, based on the previous. So if you have this on host a: tank/myfs at snap1 tank/myfs at snap2 tank/myfs at snap3 tank/myfs at snap4 and a pool "data" on host b, do it like this: a# zfs send tank/myfs at snap1 | ssh b zfs recv -d data a# zfs send -i tank/myfs at snap1 tank/myfs at snap2 | ssh b zfs recv data/myfs a# zfs send -i tank/myfs at snap2 tank/myfs at snap3 | ssh b zfs recv data/myfs a# zfs send -i tank/myfs at snap3 tank/myfs at snap4 | ssh b zfs recv data/myfs Regards, Juergen.
Juergen Nickelsen <ni at jnickelsen.de> writes:>> If that''s what you want, do an incremental send (-I). > > To be a bit more detailed, first create the file system on the > target machine by sending the first snapshot that you want to have > replicated in full. After that, send each of the following snapshots > incrementally, based on the previous.Sorry, I was confused. I assumed the "-i" option; the "-I" does, to my knowledge, automatically what I have outlined here in full, but does not yet exist with the Solaris 10 release we use. -- It is easy to be blinded to the essential uselessness of computers by the sense of accomplishment you get from getting them to run at all. -- Douglas Adams