From owner-freebsd-fs@FreeBSD.ORG Sun Jan 1 11:27:30 2012 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 8ECC2106566B for ; Sun, 1 Jan 2012 11:27:30 +0000 (UTC) (envelope-from fbsd@dannysplace.net) Received: from mailgw.dannysplace.net (mailgw.dannysplace.net [204.109.56.184]) by mx1.freebsd.org (Postfix) with ESMTP id 2DCE48FC08 for ; Sun, 1 Jan 2012 11:27:29 +0000 (UTC) Received: from [203.206.171.212] (helo=[192.168.10.12]) by mailgw.dannysplace.net with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1RhJIO-0007Pj-2C for freebsd-fs@freebsd.org; Sun, 01 Jan 2012 21:10:16 +1000 Message-ID: <4F003EB8.6080006@dannysplace.net> Date: Sun, 01 Jan 2012 21:08:40 +1000 From: Dan Carroll User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: freebsd-fs@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-User: danny X-Authenticator: plain X-Exim-Version: 4.76 (build at 08-Jun-2011 18:40:49) X-Date: 2012-01-01 21:09:44 X-Connected-IP: 203.206.171.212:56059 X-Message-Linecount: 132 X-Body-Linecount: 122 X-Message-Size: 4939 X-Body-Size: 4553 X-Received-Count: 1 X-Recipient-Count: 1 X-Local-Recipient-Count: 1 X-Local-Recipient-Defer-Count: 0 X-Local-Recipient-Fail-Count: 0 X-SA-Exim-Connect-IP: 203.206.171.212 X-SA-Exim-Mail-From: fbsd@dannysplace.net X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on damka.dannysplace.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.1 X-SA-Exim-Version: 4.2 X-SA-Exim-Scanned: Yes (on mailgw.dannysplace.net) Subject: ZFS With Gpart partitions 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: Sun, 01 Jan 2012 11:27:30 -0000 Hello all, I'm currently trying to fix a suspect drive and I've run into a small problem. I was wondering if someone can shed some light into how GPart works (when using labels for partitions). My drives are 2Tb WD RE4's, originally the array was using 1Tb Seagate drives, and I was replacing about 3 of those a year, but since I migrated to the RE4's this is my first problem. Here is my setup. NAME STATE READ WRITE CKSUM areca ONLINE 0 0 0 raidz1 ONLINE 0 0 0 gpt/data0 ONLINE 0 0 0 gpt/data1 ONLINE 0 0 0 gpt/data2 ONLINE 0 0 0 gpt/data3 ONLINE 103 0 0 gpt/data4 ONLINE 0 0 0 gpt/data5 ONLINE 0 0 0 raidz1 ONLINE 0 0 0 gpt/data6 ONLINE 0 0 0 gpt/data7 ONLINE 0 0 0 gpt/data8 ONLINE 0 0 0 gpt/data9 ONLINE 0 0 0 gpt/data10 ONLINE 0 0 0 gpt/data11 ONLINE 0 0 0 errors: No known data errors The drives are connected via an Areca controller, each drive is created as a Pass-Thru (just like JBod but also using the cache and BBU). So, my problem began when I tried to replace gpt/data3. Here is what I did. # zpool offline areca gpt/data3 # shutdown -p now (I could not remember the camcontrol commands to detach a device and shutting down was not an issue, so that's the way I did it.) Replace the failing drive and re-create the passthru device in the areca console. power on. All good so far, except the drive I used as a replacement came from a decomissioned server. It already had a gpart label on it. As it happens it was labelled data2. I quickly shut down the system, took the new drive out, put it into another machine and wiped the first few megabytes of the disk with dd. I re-inserted the drive, recreated the passthrough, powered up and replaced the offlined drive. Now it's resilvering. Currently, my system looks like this: NAME STATE READ WRITE CKSUM areca DEGRADED 0 0 0 raidz1 DEGRADED 0 0 0 gpt/data0 ONLINE 0 0 0 gpt/data1 ONLINE 0 0 0 da8p1 ONLINE 0 0 0 replacing DEGRADED 0 0 0 gpt/data3/old OFFLINE 0 0 0 gpt/data3 ONLINE 0 0 0 931G resilvered gpt/data4 ONLINE 0 0 0 gpt/data5 ONLINE 0 0 0 raidz1 ONLINE 0 0 0 gpt/data6 ONLINE 0 0 0 gpt/data7 ONLINE 0 0 0 gpt/data8 ONLINE 0 0 0 gpt/data9 ONLINE 0 0 0 gpt/data10 ONLINE 0 0 0 gpt/data11 ONLINE 0 0 0 The resilvering looks like it's working fine, but I am curious about the gpart label. When I query da8p1 I cannot find it. # gpart show da8 => 34 3907029101 da8 GPT (1.8T) 34 3907029101 1 freebsd-zfs (1.8T) # glabel list da8p1 glabel: No such geom: da8p1. It should look like this: # gpart show da0 => 34 3907029101 da0 GPT (1.8T) 34 3907029101 1 freebsd-zfs (1.8T) # glabel list da0p1 Geom name: da0p1 Providers: 1. Name: gpt/data0 Mediasize: 2000398899712 (1.8T) Sectorsize: 512 Mode: r1w1e1 secoffset: 0 offset: 0 seclength: 3907029101 length: 2000398899712 index: 0 Consumers: 1. Name: da0p1 Mediasize: 2000398899712 (1.8T) Sectorsize: 512 Mode: r1w1e2 So it seems to me that when I inserted the second drive with a label called data2, it wiped the label from the *original* drive. ZFS does not seem to care about this. If the label is simply a label and losing it does not alter the user data on the drive, then this makes sense. I am wondering if I can simply re-label the partition without fear of breaking something? Reading the glabel man page I suspect that it may be ok. -D