I have a simple ZFS setup that I've been running for a few years now. When I originally set it up, I created a number of partitions and created a zpool from a partition on each of my two drives, and used the others for booting etc..

Now however I have a separate drive for booting and everything else, so I just want to use the entire drives for my zpool. I recently replaced a drive, so I'm already doing that on one drive:

tank                        ONLINE       0     0     0
  mirror-0                  ONLINE       0     0     0
    ada2                    ONLINE       0     0     0
    ada1p4                  ONLINE       0     0     0

What I want to do now is to replace ada1p4 with ada1, the question is, how do I do that? Is it as simple as zpool replace tank ada1p4 ada1, or is that a bad idea?

  1. BACKUP anything you care about... to something off this server.

  2. Do the replacement

    zpool set autoexpand=on tank
    zpool offline tank ada1p4
    zpool replace tank ada1p4 ada1
  3. Wait... and lots of it. Check status with zpool status tank

  4. Turn off the autoexpand, zpool set autoexpand=off tank. It's a best practices thing mostly.

  • Is offline really necessary? I do not get what autoexpand is and why it is needed. – cstamas Nov 15 '12 at 15:57
  • 1
    What does it matter if it's "really necessary" or not? The steps include best practices to prevent "oh sh*t" situations. The size of the disk and the size of the partition are different, that's what the "autoexpand" is for. – Chris S Nov 15 '12 at 16:09
  • @ChrisS Okay, no offense. I did not realized the size change and you did not say. What's why I asked ;-) – cstamas Nov 15 '12 at 22:44

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.