From owner-freebsd-questions@freebsd.org Fri Apr 8 19:59:44 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D65EB09220 for ; Fri, 8 Apr 2016 19:59:44 +0000 (UTC) (envelope-from sebastian@wolfgarten.com) Received: from waldfest.wolfgarten.com (waldfest.wolfgarten.com [144.76.61.234]) by mx1.freebsd.org (Postfix) with ESMTP id B3A601A45 for ; Fri, 8 Apr 2016 19:59:43 +0000 (UTC) (envelope-from sebastian@wolfgarten.com) Received: from waldfest (localhost [127.0.0.1]) by waldfest.wolfgarten.com (Postfix) with ESMTP id 55E3F27A3D for ; Fri, 8 Apr 2016 21:53:57 +0200 (CEST) X-Virus-Scanned: amavisd-new at wolfgarten.com X-Spam-Flag: NO X-Spam-Score: -1.89 X-Spam-Level: X-Spam-Status: No, score=-1.89 tagged_above=-9999 required=5 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, BODY_RULE_1=1, T_FILL_THIS_FORM_SHORT=0.01] autolearn=no autolearn_force=no Received: from waldfest.wolfgarten.com ([127.0.0.1]) by waldfest (waldfest.wolfgarten.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id nHURg6Gawftf for ; Fri, 8 Apr 2016 21:53:53 +0200 (CEST) Received: from [192.168.0.159] (unknown [5.146.100.22]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by waldfest.wolfgarten.com (Postfix) with ESMTPSA id 00F0C27A35 for ; Fri, 8 Apr 2016 21:53:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfgarten.com; s=mail; t=1460145233; bh=dSUfceAYGN65AXqbR/rtzjZP7wrp6UEq2vnSkKK7CgI=; h=From:Subject:Date:To; b=K+hak1wOVyh160nqMVimLqHigzGED22tXTmhebeQfpGPts7jevcQwVBy/Ydx3tECu DnACOOiDTxj5xyzfS6Mfc/ZH5pP2Z8KLDYsJ29FFNnBmmpqoJdWT+4PpOHm5N04aah vsCZyZI41ueOxpwkn5Xy+J06griGeUfMxvcJ9uU0= From: Sebastian Wolfgarten Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Zfs - broken disk - add instead of attach - How to go back to mirrored setup? Message-Id: <6ACA8DAA-7D86-4FD0-B08C-2030CFF575C1@wolfgarten.com> Date: Fri, 8 Apr 2016 21:53:52 +0200 To: freebsd-questions@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Apr 2016 19:59:44 -0000 Dear all, I used to have a ZFS-based mirror and now thanks to a typo I have one = big disk of 5.4TB instead of a 2.7T mirror - how do I get back to having = a mirror? Here is what happened: Last week one of my hard drives broke requiring me to detach & replace = the disk: server1 - ZFS pool - HEALTH fault=20 NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH = ALTROOT zroot 2.72T 763G 1.97T 18% - 27% 1.00x DEGRADED -=20= 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: scrub repaired 0 in 3h48m with 0 errors on Fri Mar 25 10:48:35 = 2016 config: NAME STATE READ WRITE CKSUM zroot DEGRADED 0 0 0 mirror-0 DEGRADED 0 0 0 5383010007106655398 REMOVED 0 0 0 was /dev/diskid/DISK-Z1F0LSM7p3 gpt/zfs1 ONLINE 0 0 0 errors: No known data errors # zpool detach zroot /dev/diskid/DISK-Z1F0LSM7p3 After the provider put in a new disk, I made a mistake (i.e. I added the = disk to the zroot pool instead of attaching it) and now I was wondering = how to recover from this situation: # zpool add zroot ada0 Here is what zroot now looks like: # zpool status zroot pool: zroot state: ONLINE scan: scrub canceled on Fri Apr 8 21:27:31 2016 config: NAME STATE READ WRITE CKSUM zroot ONLINE 0 0 0 gpt/zfs1 ONLINE 0 0 0 ada0 ONLINE 0 0 0 errors: No known data errors I tried to remove/disable/offline the second disk but that did not work: # zpool offline zroot ada0 cannot offline ada0: no valid replicas # zpool remove zroot ada0 cannot remove ada0: only inactive hot spares, cache, top-level, or log = devices can be removed # zpool detach zroot ada0 cannot detach ada0: only applicable to mirror and replacing vdevs Now my question is: How can I get back to having a mirror without = loosing all the data on ada1? Any ideas? Using ZFS split maybe? Many thanks. Best regards Sebastian