Confused about how to replace a disk

All your general support questions for OpenZFS on OS X.

Confused about how to replace a disk

Postby tim.rohrer » Wed Sep 25, 2019 11:51 am

I apologize as I really thought I should be able to figure this out, but several hours later and I don't have it. Time to ask for help.

I had a drive go bad and I have what should be a suitable replacement installed in the bay.

Code: Select all
pool: tank1
 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: scrub repaired 0 in 0 days 05:13:33 with 0 errors on Wed Aug  7 19:24:10 2019
config:

   NAME                                            STATE     READ WRITE CKSUM
   tank1                  [code][/code]                         DEGRADED     0     0     0
     mirror-0                                      ONLINE       0     0     0
       media-F898B004-B88E-4D11-A560-B769C8ACBEB5  ONLINE       0     0     0
       media-11C59899-C99C-4ED9-B8B3-7D6D6C473FB2  ONLINE       0     0     0
     mirror-1                                      DEGRADED     0     0     0
       media-B59EB647-C62C-4C3E-93E8-298106A7A61C  REMOVED      0     0     0
       media-7CDE56AE-F1F8-4BA6-ACFC-3A0BBD1F41C7  ONLINE       0     0     0

errors: No known data errors


I initialized the new disk as HFS (is that a correct step?) and then tried several times to issue various forms of the `zpool replace tank1` command using the `guid` for the bad drive from the `zdb` output and `/var/run/disk/by-id/media-xxxx...` but I'd get I/O errors. Then I finally tried using the `/var/run/disk/by-id/volume-xxxx....` identifier and now I've got:

Code: Select all
  pool: tank1
 state: DEGRADED
status: One or more devices is currently being resilvered.  The pool will
   continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
  scan: resilver in progress since Wed Sep 25 14:44:38 2019
   146G scanned at 117M/s, 73.0G issued at 54.8M/s, 1.85T total
   0 resilvered, 3.85% done, 0 days 09:27:18 to go
config:

   NAME                                               STATE     READ WRITE CKSUM
   tank1                                              DEGRADED     0     0     0
     mirror-0                                         ONLINE       0     0     0
       media-F898B004-B88E-4D11-A560-B769C8ACBEB5     ONLINE       0     0     0
       media-11C59899-C99C-4ED9-B8B3-7D6D6C473FB2     ONLINE       0     0     0
     mirror-1                                         DEGRADED     0     0     0
       replacing-0                                    REMOVED      0     0     0
         media-B59EB647-C62C-4C3E-93E8-298106A7A61C   REMOVED      0     0     0
         volume-F3951F86-80F4-321F-ABD6-2D0C8F0030CF  ONLINE       0     0     0
       media-7CDE56AE-F1F8-4BA6-ACFC-3A0BBD1F41C7     ONLINE       0     0     0


My question is, have I done this right? Does it matter which identifier is used?

Tim
tim.rohrer
 
Posts: 29
Joined: Tue Jul 24, 2018 6:49 pm

Re: Confused about how to replace a disk

Postby lundman » Wed Sep 25, 2019 4:43 pm

There is an unfortunate disconnect between the invariantdisk names we recommend people use, and that ZFS commandline tools don't really understand them. Generally, I would use
"zpool status -g" to list the pool with "guids" instead of invariantdisk names, then issue replace using that:

Code: Select all
# zpool status -g
   NAME                   STATE     READ WRITE CKSUM
   testpool               ONLINE       0     0     0
     8332391264605344183  ONLINE       0     0     0
     4649019242914943499  REMOVED       0     0     0

# zpool replace testpool  4649019242914943499 /dev/disk4


Where disk4 in my case is the new disk. I would not bother using invariantdisk path for disk4 here, that will be replaced automatically, the next time you export/import. You may want to export/import it after resilver completes.

You should not pre-format the disk to HFS, as ZFS prefers to partition the disk for you.

In fact, I am a little concerned that your new disk that is currently resilvering to replace the old is
named "volume" - as if you used CoreStorage to create a volume around the disk. But either way
wait until the resilver is complete before looking at fixing things, if fixing is required.
User avatar
lundman
 
Posts: 1335
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan


Return to General Help

Who is online

Users browsing this forum: No registered users and 29 guests

cron