ZFS Remove an incorrectly added disk or create new pool from single mirrored disk

I made a mistake and I can't figure out the best way to back out. Simplifying names to keep this easy, I had a pool with mirrored disks disk1 and disk2. I detached disk2 with intent to replace it with disk3 (plan was to resilver to this larger disk and then replace disk1 with a larger disk and therefore increase the size of this mirrored pool and retire disk1 and disk2). I successfully detached disk2 which then removed the mirror from this pool and instead of doing an attach disk3 I did an add disk3. now i have a pool with disk1 and disk3 but since it's not a mirror I can't remove or detach disk3 and I don't know how I'd now mirror disk1 to disk3. Alternately, I thought I could destroy this pool and create a new pool with this name from disk2, but now I'm paranoid of compounding my failures and losing the data that's on disk1 and disk2. since disk1 and disk2 are from a former mirror, I think I have flexibility in best path forward, but I'd like some advice from someone who knows what the heck their doing more than me. I'm a novice and this is on my home server so no business impact fortunately. Thanks!
 
I couldn't find a way around this, since zfs won't allow remove of disk3 since it believes there's data on there to lose. I ensured all data from this disk1/disk3 pool was fully backed up and then destroyed and re-created the pool, then copied everything over. A bit of grunt work - especially for the disks - but it could have been worse.
 
Not entirely your scenario, but still: If I remember correctly, you need to zero out (use dd for example) the zfs label on the disk if you want to re-use it in another pool. If you have new enough zfs on your machine the # zfs labelclear ... command can be used.
 
Back
Top