[ZFS] How to change the geom label for a disk without losing data in the ZFS pool?

Vladislav V. Prodan universite at ukr.net
Mon Jan 24 21:53:06 UTC 2011


I just changed the "label: disk6" on "label: disk5"

# zpool replace -f tank ad18p1 /dev/gpt/disk5
invalid vdev specification
the following errors must be manually repaired:
/dev/gpt/disk5 is part of active pool 'tank'

# zpool upgrade
This system is currently running ZFS pool version 14.

All pools are formatted using this version.

# zfs upgrade
This system is currently running ZFS filesystem version 3.

# zpool status
  pool: tank
 state: DEGRADED
status: One or more devices has been taken offline 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'.
 scrub: none requested
config:

        NAME           STATE     READ WRITE CKSUM
        tank           DEGRADED     0     0     0
          raidz2       DEGRADED     0     0     0
            ad8        ONLINE       0     0     0
            ad10       ONLINE       0     0     0
            ad12       ONLINE       0     0     0
            ad14       ONLINE       0     0     0
            gpt/disk4  ONLINE       0     0     0
            ad18p1     OFFLINE      0     0     0

errors: No known data errors

# gpart list ad18
Geom name: ad18
fwheads: 16
fwsectors: 63
last: 1465149134
first: 34
entries: 128
scheme: GPT
Providers:
1. Name: ad18p1
   Mediasize: 750156339712 (699G)
   Sectorsize: 512
   Mode: r0w0e0
   rawuuid: 562396c8-25ab-11e0-9a58-00e04d7b690c
   rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
   label: disk5
   length: 750156339712
   offset: 17408
   type: freebsd-zfs
   index: 1
   end: 1465149134
   start: 34
Consumers:
1. Name: ad18
   Mediasize: 750156374016 (699G)
   Sectorsize: 512
   Mode: r0w0e0


-- 
Vladislav V. Prodan
VVP24-UANIC
+38[067]4584408
+38[099]4060508
vlad11 at jabber.ru


More information about the freebsd-fs mailing list