Solved Replacing root pool mirror drives with larger units

I have a working FreeBSD (8.2-STABLE) system installed on a ZFS root pool 'root-pool' which is a 2-disk mirror using two 160GB drives:
drive1: 160GB gpt/mirror1
drive2: 160GB gpt/mirror2
Code:
# zpool status root-pool
  pool: root-pool
 state: ONLINE
config:

        NAME             STATE     READ WRITE CKSUM
        root-pool       ONLINE       0     0     0
          mirror-0       ONLINE       0     0     0
            gpt/mirror1  ONLINE       0     0     0
            gpt/mirror2  ONLINE       0     0     0

errors: No known data errors
I know the BSD version is pretty old, but it's a complicated build and it's running just perfectly. The system was pretty full so I though I'd replace both drives with two new 500GB drives:
drive3: 500GB gpt/mirror3
drive4: 500GB gpt/mirror4

I initialized both drives in GPT format and then did the following:
Code:
# zpool attach -f root-pool gpt/mirror2 gpt/mirror3
# zpool attach -f root-pool gpt/mirror2 gpt/mirror4
Once the new drives had resilvered, the pool looked like this:
Code:
# zpool status root-pool
  pool: root-pool
 state: ONLINE
config:

        NAME             STATE     READ WRITE CKSUM
        root-pool       ONLINE       0     0     0
          mirror-0       ONLINE       0     0     0
            gpt/mirror1  ONLINE       0     0     0
            gpt/mirror2  ONLINE       0     0     0
            gpt/mirror3  ONLINE       0     0     0
            gpt/mirror4  ONLINE       0     0     0

errors: No known data errors
I then detached the original disks:
Code:
# zpool detach root-pool gpt/mirror1
# zpool detach root-pool gpt/mirror2
and rebooted - all is fine... except the pool still shows size as 160GB! I then set 'autoexpand' on:
zpool set autoexpand=on root-pool

and rebooted again, but pool is still showing as 160GB, even though new drives are 500GB:
Code:
# zpool list root-pool
NAME         SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
root-pool   149G   135G    14G     90%  1.00x  ONLINE  -
I'm probably just missing something very simple, but how do I force ZFS to 'see' the extra space on the new drives/pool and allow me to use it for data?


I'd appreciate any light anyone can shed on this.
 
zpool online -e for both providers (mirror3 and 4) should do the trick.

man zpool:
Code:
     zpool online [-e] pool device ...

         Brings the specified physical device online.

         This command is not applicable to spares or cache devices.

         -e      Expand the device to use all available space. If the device
                 is part of a mirror or raidz then all devices must be
                 expanded before the new space will become available to the
                 pool.
 
How did you partition the drives? If you copied the partition tables from the old drives the partitions will be 160GB and will show around 340GB of free space.
 
I believe that in the version you have, you need to boot with a rescue CD, import the pool, export the pool and then re-import.
 
Bingo!
Code:
# zpool online -e root-pool gpt/mirror3 gpt/mirror4
# zpool list
NAME         SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
root-pool    465G   135M   465G    29%  1.00x  ONLINE  -
 
zpool set autoexpand=on root-pool
zpool online -e for both providers (mirror3 and 4) should do the trick.

Unless I'm missing something, the two suggestions quoted above simply do not exist in that version of zpool. This is why unsupported versions of FreeBSD are, well, not supported here any more than they are elsewhere.

blimpyboy, back up your vital data, install and configure a newer version of FreeBSD (upgrading that system directly will be tedious, time-consuming and very error-prone), and recreate the pool.
 
Unless I'm missing something, the two suggestions quoted above simply do not exist in that version of zpool. This is why unsupported versions of FreeBSD are, well, not supported here any more than they are elsewhere.

Actually, I think that zpool set autoexpand=on was implemented at some point in 8.2-STABLE. I think that zpool online -e came much later. The only way that you could do it was to export and import the pool at that time if I recall well.
 
I promise you, I did exactly as I said in my previous email and it did resolve the issue. Why on earth would I state anything other than the truth when asking for help, it would not be in my interest. I really appreciate people taking the time to respond in the way they do, the last thing I'd want to do is waste their time. However, I should point out that it's a ZFSGuru system sitting on top of core FreeBSD (8.2-STABLE), not sure if that makes a difference? I didn't state that initially because I didn't think it was relevant, in hindsight perhaps I should have - my sincere apologies if it muddied the waters.
 
Back
Top