Thursday, November 19, 2015

ZFS: destroy and recreate mirrored zpool without losing any data. Possible?



I've got an existing Solaris ZFS NAS/SAN device and for a couple of reasons I'm looking to effectively destroy and re-create the zpool. The catch is that I don't have anywhere to put the data elsewhere, so it effectively has to stay on the box while I do this.



There's 12x1TB 7.2k SATA drives which make up the zpool in 6 mirrored pairs. My plan is as follows:





  1. In mirrored pair one, remove one of the drives from the pool completely.

  2. Create a new zpool containing only this drive

  3. Repeat (1) for each of the other mirrored pairs, adding them to the new zpool.

  4. By this point, I'm left with two zpools of the same size, with no redundancy, but containing 6 drives each.

  5. Copy the data over to the new pool and verify (with a scrub, I guess?)

  6. Once the data is copied, destroy the old pool, and add the 6 drives to the new pool as mirrors to the existing 6 drives.

  7. Ensure all the filesystems are correct and have the right attributes




Is there any reason why this wouldn't work? If not, is there a different/better way I could be doing this?


Answer



Why do you need to rebuild the pool? How much data is actually contained in the pool? That will have a greater effect on your migration strategy than anything else. If it is possible to place the data on a single disk (e.g. 1 or 2 Terabytes), I'd do that rather than risk a stripe of unmirrored disks. But again, it depends on how much data needs to move.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...