From owner-freebsd-fs@FreeBSD.ORG Thu Apr 1 13:41:03 2010 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 0245D106564A; Thu, 1 Apr 2010 13:41:03 +0000 (UTC) (envelope-from bartosz.stec@it4pro.pl) Received: from mainframe.kkip.pl (kkip.pl [87.105.164.78]) by mx1.freebsd.org (Postfix) with ESMTP id 443C38FC0A; Thu, 1 Apr 2010 13:41:02 +0000 (UTC) Received: from mb01.admin.lan.kkip.pl ([10.66.3.254]) by mainframe.kkip.pl with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.71 (FreeBSD)) (envelope-from ) id 1NxKMZ-000Cps-Mx; Thu, 01 Apr 2010 15:23:19 +0200 Message-ID: <4BB49E3F.7070506@it4pro.pl> Date: Thu, 01 Apr 2010 15:23:11 +0200 From: Bartosz Stec Organization: IT4Pro User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.1.8) Gecko/20100227 Lightning/1.0b1 Thunderbird/3.0.3 MIME-Version: 1.0 To: freebsd-current@freebsd.org, freebsd-fs@freebsd.org X-Stationery: 0.5.1 X-Authenticated-User: bartosz.stec@it4pro.pl X-Authenticator: plain X-Sender-Verify: SUCCEEDED (sender exists & accepts mail) X-Spam-Score: -7.0 X-Spam-Score-Int: -69 X-Exim-Version: 4.71 (build at 02-Feb-2010 20:10:28) X-Date: 2010-04-01 15:23:19 X-Connected-IP: 10.66.3.254:2203 X-Message-Linecount: 172 X-Body-Linecount: 159 X-Message-Size: 7504 X-Body-Size: 6932 X-Received-Count: 1 X-Recipient-Count: 2 X-Local-Recipient-Count: 2 X-Local-Recipient-Defer-Count: 0 X-Local-Recipient-Fail-Count: 0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: gpart failing with no such geom after gpt corruption 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: Thu, 01 Apr 2010 13:41:03 -0000 Hello ZFS and GPT hackers :) I'm sending this message to both freebsd-current and freebsd-fs because it doesn't seems to be a CURRENT-specific issue. Yesterday I tried to migrate my mixed UFS/RAIDZ config to clean RAIDZ with GPT boot. I've following mostly this guide: http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/RAIDZ1 I'm using CURRENT on 3x40GB HDDs (ad0-ad3) and additional 250GB HDD has been used for data migration (ad4). Data was copied form RAIDZ to 250GB HDD, GPT sheme was created on 40GB HDDs, then new zpool on them, and finally data went back to RAIDZ. Booting from RAIDZ was succesful, so far so good. After a while I've noticed some SMART errors on ad1, so I've booted machine with seatools for dos and made long test. One bad sector was found and reallocated, nothing to worry about. As I was in seatools already, I've decided to adjust LBA size on that disk (seatools can do that), because it was about 30MB larger than the other two, and because of that I had to adjust size of freebsd-zfs partition on that disk to match exact size of others (otherwise 'zpool create' will complain). So LBA was adjusted and system rebooted. Yes, I was aware that changing disk size probably end with corrupted GPT and data loss, but it doesn't seem to be a big deal for me as far as 2/3 of zpool is alive, because I can always recreate gpt and resilver ad1. Unfortunately it wasn't so easy. First of all system booted, and as I expected kernel message shows GPT error on ad1. Zpool was degraded but alive and kicking. However, when I tried to execute any gpart command on ad1, it return: ad1: no such geom ad1 was present under /dev, and it could be accessed by sysinstall/fdisk, but no with gpart. I've created bsd slice with sysinstall on ad1 and rebooted, with hope that after reboot I could acces ad1 with gpart and recreate GPT scheme. Another surprise - system didn't boot at all, rebooting after couple of seconds in loader (changing boot device didn't make a difference). Only way I could boot system at this moment was connecting 250GB HDD which fortunately still had data from zpool migration and boot from it. Another surprise - kernel was still complaining about GPT corruption on ad1. I had no other ideas so I ran dd if=/dev/zero of=/dev/ad1 bs=512 count=512 to clear beginning of the hdd. After that disk was still unaccesible fromt gpart, so I tried sysinstall/fdisk againt to create standard BSD partitioning scheme and rebooted system. After that finally gpart started to talk with ad1 and GPT scheme and zpool has been recreated and work as it supposed to. Still, how can we clear broken GPT data after it got corrupted? Why gpart has been showing "ad1: no such geom", and how can we deal with this problem? Finally, why gptzfsboot failed with GPT corrupted on other disk after trying to fix it, while it booted at first place? Or maybe changing LBA size of already partitioned HDD is extreme case, and the only way these problems could be triggered ;)? Cheers! -- Bartosz Stec