From owner-freebsd-geom@FreeBSD.ORG Mon Jan 24 21:53:06 2011 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B002F1065675; Mon, 24 Jan 2011 21:53:06 +0000 (UTC) (envelope-from universite@ukr.net) Received: from otrada.od.ua (universite-1-pt.tunnel.tserv24.sto1.ipv6.he.net [IPv6:2001:470:27:140::2]) by mx1.freebsd.org (Postfix) with ESMTP id 067FE8FC18; Mon, 24 Jan 2011 21:53:05 +0000 (UTC) Received: from [10.0.0.10] (phenom.otrada.od.ua [10.0.0.10]) (authenticated bits=0) by otrada.od.ua (8.14.4/8.14.4) with ESMTP id p0OLr1fZ068979; Mon, 24 Jan 2011 23:53:01 +0200 (EET) (envelope-from universite@ukr.net) X-Authentication-Warning: otrada.od.ua: Host phenom.otrada.od.ua [10.0.0.10] claimed to be [10.0.0.10] Message-ID: <4D3DF4B8.4050901@ukr.net> Date: Mon, 24 Jan 2011 23:52:56 +0200 From: "Vladislav V. Prodan" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: freebsd-fs@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.3 required=5.0 tests=ALL_TRUSTED,AWL autolearn=failed version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mary-teresa.otrada.od.ua X-Virus-Scanned: clamav-milter 0.95.3 at mary-teresa.otrada.od.ua X-Virus-Status: Clean Cc: freebsd-geom@freebsd.org Subject: [ZFS] How to change the geom label for a disk without losing data in the ZFS pool? X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 21:53:06 -0000 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@jabber.ru