ZFS Replacing and Upgrading Disks on ZPool

Good day everyone, hope we all are staying safe :)

For a few years I have been using a 2 Disk ZPOOL on a standalone FreeBSD 12 system.
I use this to keep offsite backups of users data from a production mac
hine.
When I booted up to do the monthly backups, I found ada0 had gone bad and was taken offline (I later found that the BIOS was not even seeing the drive).
That drive has since been removed, and the remaining drive (which has the OS and data) boots up fine.
I have ordered 2 more 4TB SATA drives and would like to replace the current running drive, (which is a 2TB drive) with a 4TB drive, then, add the second 4TB drive back into the array, thus, getting back to a duel drive mirror array.
Is anyone away of any concise documentation on how this might be done? ( Yes, I have read the docs, but am looking to compare so I am sure I am following the right replace/upgrade path).

Thanks in advance,

-T
 
Make sure you create the correct partition structure beforehand, as this is a bigger disk make sure the freebsd-zfs partition covers the disk till the end. Don't worry about the fact it's a bigger partition (compared to the old drive). Then, first replace the broken drive. Let it resilver, depending on the amount of data this can take a while. Once your disk is resilvered you can take out the other disk and do the same thing. When that's been resilvered too, double check the sizes. Then enable autoexpand on the pool. You may need to 'online' both drives but after that the pool should be automatically resized.

It's actually very easy to do. You just need to be diligent (partitions correct, replacing the correct drive, etc.) and patient (resilvering can take a long time).
 
Thanks for the reply SirDice...

So, with this status in mind:
Code:
root@PE-R200-FS:/var/log # zpool status
  pool: zroot
 state: DEGRADED
status: One or more devices has been removed by the administrator.
        Sufficient replicas exist for the pool to continue functioning in a
        degraded state.
action: Online the device using 'zpool online' or replace the device with
        'zpool replace'.
  scan: resilvered 29.3G in 0 days 00:05:58 with 0 errors on Wed Jul 29 04:56:10 2020
config:

        NAME                      STATE     READ WRITE CKSUM
        zroot                     DEGRADED     0     0     0
          mirror-0                DEGRADED     0     0     0
            14492585210383915832  REMOVED      0     0     0  was /dev/ada0p3
            ada0p3                ONLINE       0     0     0
I would power down, install the brand new 4TB drive, boot and use gpart to create the freebsd-zfs, then follow the 19.3.2. Adding and Removing Devices" docs?

Do I need to copy the bootcode first as described?
 
I would power down, install the brand new 4TB drive, boot and use gpart to create the freebsd-zfs
Yes, make the same partitions as on the existing drive. Assuming it's GPT there's probably a freebsd-boot, freebsd-swap and freebsd-zfs partition. Also take note of the drives shifting nomination when you add/remove drives from the system.
Do I need to copy the bootcode first as described?
First, last, doesn't matter, as long as you write the bootcode so you can boot from the drive when the other disk fails.
 
Appears those are exactly what exists on the current drive:


root@PE-R200-FS:/var/log # gpart show
=> 40 3907029088 ada0 GPT (1.8T)
40 1024 1 freebsd-boot (512K)
1064 984 - free - (492K)
2048 4194304 2 freebsd-swap (2.0G)
4196352 3902832640 3 freebsd-zfs (1.8T)
3907028992 136 - free - (68K)

I assume when creating them on the new drive, the freebsd-boot and freebsd-swap can be made the same size, and the freebsd-zfs can use the remaining space on the disk? Or, would we make it the same size as on the current disk, then let the "autoexpand" do its magic later when both 4TB drives are online?

-T
 
I assume when creating them on the new drive, the freebsd-boot and freebsd-swap can be made the same size, and the freebsd-zfs can use the remaining space on the disk?
Correct.

Or, would we make it the same size as on the current disk, then let the "autoexpand" do its magic later when both 4TB drives are online?
If the partition is the same size there won't be anything to expand into. The autoexpand feature makes use of the available space, it doesn't automagically resize the partition.
 
Hi,

The new ada0p3 has a boot code written and has resilvered without issue.
No matter how much I read, I can't figure out the command to get this back on line - I am sure I need to REMOVE or REPLACE the REMOVED device, but I need help:


root@PE-R200-FS:/home/me # zpool status
pool: zroot
state: DEGRADED
status: One or more devices has been removed by the administrator.
Sufficient replicas exist for the pool to continue functioning in a
degraded state.
action: Online the device using 'zpool online' or replace the device with
'zpool replace'.
scan: resilvered 1.47T in 0 days 17:32:42 with 0 errors on Tue Nov 3 12:16:16 2020
config:

NAME STATE READ WRITE CKSUM
zroot DEGRADED 0 0 0
mirror-0 DEGRADED 0 0 0
14492585210383915832 REMOVED 0 0 0 was /dev/ada0p3
ada1p3 ONLINE 0 0 0
ada0p3 ONLINE 0 0 0

errors: No known data errors
root@PE-R200-FS:/home/me #
 
Back
Top