Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted
  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.

share|improve this answer
    
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
    
Perfect, thanks @ChrisS! –  hexist Nov 15 '12 at 16:18
    
@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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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