Quantcast
Channel: Admins Goodies » freebsd
Viewing all articles
Browse latest Browse all 10

Migrating ZFS from using partitions to using the entire disk

$
0
0

Question

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?

Asked by hexist

Answer

  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.

Answered by Chris S

Viewing all articles
Browse latest Browse all 10

Trending Articles