Gregory Gee
2010-Feb-25 04:08 UTC
[zfs-discuss] Moving dataset to another zpool but same mount?
I need to move a dataset to another zpool, but I need to keep the same mount point. I have a zpool called files and datasets called mail, home and VM. files files/home files/mail files/VM I want to move the files/VM to another zpool, but keep the same mount point. What would be the right steps to create the new zpool, move the data and mount in the same spot? Also, to test this, if I mount to the same spot, will it hide the old dataset or destroy it. I want to test the migration before destroying the old dataset. Or can I? Thanks, Greg -- This message posted from opensolaris.org
Mark J Musante
2010-Feb-25 16:55 UTC
[zfs-discuss] Moving dataset to another zpool but same mount?
On Wed, 24 Feb 2010, Gregory Gee wrote:> files > files/home > files/mail > files/VM > > I want to move the files/VM to another zpool, but keep the same mount > point. What would be the right steps to create the new zpool, move the > data and mount in the same spot?Create the new pool, take a snapshot of files/VM, use zfs send|zfs recv to copy the snapshot over to the new pool. Then you can unmount files/VM without losing any data, and set the mountpoint property of the new dataset to where files/VM was mounted. e.g.: # zfs umount files/VM # zfs set mountpoint=/VM newpool/VM If you want to have access to both datasets at the same time, just use an alternate mountpoint for the original dataset. ''zfs set mountpoint=/old-VM files/VM'' would do the trick.> Also, to test this, if I mount to the same spot, will it hide the old > dataset or destroy it. I want to test the migration before destroying > the old dataset. Or can I?The old dataset will not be destroyed unless you use ''zfs destroy''. Regards, markm
Gregory Gee
2010-Feb-26 03:19 UTC
[zfs-discuss] Moving dataset to another zpool but same mount?
So just to verify, from what you said and searching based on what you said, the following is the commands I would use? # zpool create newpool mirror c8d0 c9d0 # zfs create newpool/VM # zfs snapshot files/VM at beforeMigration # zfs send files/VM at beforeMigration | zfs receive newpool/VM # zfs umount files/VM # zfs set mountpoint=/files/VM newpool/VM # zfs set mountpoint=/old-VM files/VM Then once all has been verified. # zfs destroy files/VM Thanks for the help. Greg -- This message posted from opensolaris.org