I have Ubuntu 12.04 with ZFS installed. There are two pools: rpool (the root filesystem) and rdata (all the data). rdata was built with 2 x 1TB WD EADS drives (with 512 byte physical sectors) in a ZFS mirror. rdata has many datasets on it in a hierarchy.

rdata is running out of space so I have purchased 2 x Seagate 3TB drives. Unfortunately, when I tried to add one the the new drives to the mirror, so that it would resilver, zpool attach failed saying

cannot attach /dev/disk/by-id/scsi-SATA_ST3000DM001-1CH_W1F1EE1G-part1 to /dev/disk/by-id/scsi-SATA_WDC_WD10EADS-00_WD-WCAU47275172-part1: devices have different sector alignment

I now know this is because the new drives ave 4k physical sectors and the only recovery path is to rebuild the pool. I am proposing to do the following:

  1. Ensure there is a snapshot of all datasets on rdata.
  2. Remove 1 element of the rdata mirror (so I have a known good backup and to free up a SATA port)
  3. Connect one of the new drives to the machine
  4. create a new pool called rdata1 with 4k sectors and a single physical device
  5. use zpool recv to restore the snapshots of rdata's datasets to rdata1
    • At this point, rdata1 should be identical to rdata
  6. export the device on which rdata1 is located
  7. destroy rdata
  8. import the device that contained rdata1 as rdata
  9. remove the old physical disk and replace it with the other new disk
  10. attach the other new disk to the newly created rdata to re-create the mirror

Does this sound reasonable? I'll still have the second old disk if it goes wrong and as a final resort, I have another FreeNAS server that has a full backup of all the snapshots; just in case.



In the end, the matter was forced by an error on my part. The procedure I used in the end was:

  1. Shutdown system and disconnect one element of the original pool; replacing it with one on the new disks.
  2. Power on and create a new pool with the single new disk
  3. use rsync to move the data across rather than zpool recv
  4. export both pools
  5. import the new pool using the old name
  6. power off and replace the other old drive with a new one
  7. power on and attach the new drive to the new pool.

Unfortunately, the system refused to forget about the old pool. I have moved this to a new question: How do I remove a pool from ZFS?

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.