From owner-freebsd-fs@FreeBSD.ORG Fri Jul 27 09:32:22 2007 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3BCD16A417 for ; Fri, 27 Jul 2007 09:32:22 +0000 (UTC) (envelope-from M.S.Powell@salford.ac.uk) Received: from abbe.salford.ac.uk (abbe.salford.ac.uk [146.87.0.10]) by mx1.freebsd.org (Postfix) with SMTP id 51EC113C458 for ; Fri, 27 Jul 2007 09:32:21 +0000 (UTC) (envelope-from M.S.Powell@salford.ac.uk) Received: (qmail 80895 invoked by uid 98); 27 Jul 2007 10:32:20 +0100 Received: from 146.87.255.121 by abbe.salford.ac.uk (envelope-from , uid 401) with qmail-scanner-2.01 (clamdscan: 0.90/3779. spamassassin: 3.1.8. Clear:RC:1(146.87.255.121):. Processed in 0.056505 secs); 27 Jul 2007 09:32:20 -0000 Received: from rust.salford.ac.uk (HELO rust.salford.ac.uk) (146.87.255.121) by abbe.salford.ac.uk (qpsmtpd/0.3x.614) with SMTP; Fri, 27 Jul 2007 10:32:20 +0100 Received: (qmail 78183 invoked by uid 1002); 27 Jul 2007 09:32:18 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 27 Jul 2007 09:32:18 -0000 Date: Fri, 27 Jul 2007 10:32:18 +0100 (BST) From: "Mark Powell" To: freebsd-fs@freebsd.org Message-ID: <20070727100039.V68220@rust.salford.ac.uk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: Breaking raidz and zpool bug? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2007 09:32:22 -0000 Hi, Have a machine with two identical drives ad[01]. Each have a 4GB slice1 and the rest as slice 2. Slice 1 contains a gmirrored ufs /boot and swap. Slice2 I foolishly raidz'ed and put / on there. All works well. I realised the error of making a raidz of only 2 drives and wanted to convert this setup to gmirror without any backup/restore or pulling of drives to force them to error. I assume the difficulty with doing this is from deliberate safeguards to prevent data lose in normal usage? 1st I needed to break the raidz, stop it using one of the drives, so I can make the mirror on it. I thought I could just wipe ad1s2, but I am prevented from doing that cos it's being used by zfs. Even with kern.geom.debugflags=16. I couldn't change the partition details using fdisk for ad1s2 as it doesn't allow it for partitions in use. So i blanked sector 0 on ad1 and rebooted. zpool status showed the raidz as degraded. I thought I'd then create a zpool mirror on ad1s2, but of course I can't cos it's still part of the raidz. I could find no way to remove ad1s2 from the raidz. zpool detach is only for hot spares. I tried to get around the problems of the system not letting me do anything with ad1s2, by creating an identical ad1s3 and then changing the slice type of ad1s2 to 1 (DOS FAT 16-bit). I rebooted, but the zfs root would not mount. I booted into a test enviroment and zpool status told me the worst that no replicas could be found. At first I assumed I'd made a mess of something, but after reflection I was sure I'd not touched ad0. I changed the type of ad1s2 back to FreeBSD 165 and the zfs root worked fine again albeit in the degraded state. It shouldn't be possible to break a raidz simply by changing the slice type? Is this a bug? And does anyone have ideas for what I was trying? Cheers. -- Mark Powell - UNIX System Administrator - The University of Salford Information Services Division, Clifford Whitworth Building, Salford University, Manchester, M5 4WT, UK. Tel: +44 161 295 4837 Fax: +44 161 295 5888 www.pgp.com for PGP key