From owner-freebsd-geom@FreeBSD.ORG Thu May 27 22:57:33 2010 Return-Path: Delivered-To: geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5D4D106564A for ; Thu, 27 May 2010 22:57:33 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.221.175]) by mx1.freebsd.org (Postfix) with ESMTP id 8948D8FC19 for ; Thu, 27 May 2010 22:57:33 +0000 (UTC) Received: by qyk5 with SMTP id 5so849755qyk.3 for ; Thu, 27 May 2010 15:57:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=lxJeHRp+zCfDz4nBPT9UAnFNcMSWdlgno82Zp56IhLs=; b=cY/talK1oSa/s7RSzTcaLYKXehM8xMRDR8eyk3yOdCNikg8TohMrnyQZ/e7UQ+rEk7 2JabJqqu+MqJ9kY7cMmzm1OGiFYfyG6gQisSvgurZeX7zx1wWch6A8340rgUbsWGFEeI AW36x/aXbSgGx7a3QyTSLd/U7gApXC3T31k/s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=OGUE5Qrx338cYKjVQ94zkLipz711h9o+tpfCIx1jqgo7MQLDS0bIgIKS8E3Jb4cliN HGmt94V5Vju7dVXjxaFV6t6giXBplfsJQAOLS5NVVhwATddtC7XAHf6tIGGujLfxDmhx yiX8iv1ay/wezX02jmdAH2anii4N4rKBIAvU0= MIME-Version: 1.0 Received: by 10.229.226.208 with SMTP id ix16mr2479106qcb.175.1275001052663; Thu, 27 May 2010 15:57:32 -0700 (PDT) Received: by 10.229.190.83 with HTTP; Thu, 27 May 2010 15:57:32 -0700 (PDT) In-Reply-To: <20100527224627.GD82995@kay.kiwi-computer.com> References: <20100527220241.GA82995@kay.kiwi-computer.com> <20100527220821.GB82995@kay.kiwi-computer.com> <20100527224627.GD82995@kay.kiwi-computer.com> Date: Thu, 27 May 2010 15:57:32 -0700 Message-ID: From: Garrett Cooper To: rick-freebsd2009@kiwi-computer.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: geom@freebsd.org Subject: Re: Getting useful diagnostics from geom(8) and friends 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: Thu, 27 May 2010 22:57:33 -0000 On Thu, May 27, 2010 at 3:46 PM, Rick C. Petty wrote: > On Thu, May 27, 2010 at 03:27:59PM -0700, Garrett Cooper wrote: >> On Thu, May 27, 2010 at 3:08 PM, Rick C. Petty >> wrote: >> > On Thu, May 27, 2010 at 05:02:41PM -0500, Rick C. Petty wrote: >> > >> > In any case, show us the output of "gpart show /dev/ad4" if there are >> > any problems. >> >> =A0 =A0 Here's the entire operation; I realize there's a rounding error = in >> the size calculation with capacity... >> Thanks, >> -Garrett >> >> ./clear_and_rewrite_partitions ad4 >> + atacontrol cap ad4 >> + awk /^lba supported/ { print $3 } >> + capacity=3D268435455 >> + dd if=3D/dev/zero of=3D/dev/ad4 bs=3D20m count=3D1 >> 1+0 records in >> 1+0 records out >> 20971520 bytes transferred in 0.610148 secs (34371204 bytes/sec) >> + expr 0 + 268435455 / 1024 - 1 >> + dd if=3D/dev/zero of=3D/dev/ad4 bs=3D1m oseek=3D262142 >> dd: /dev/ad4: Input/output error >> 1+0 records in >> 0+0 records out >> 0 bytes transferred in 0.021521 secs (0 bytes/sec) > > This last step is unnecessary, and there's something wrong with your math= . > 268435455 sectors is ~128 GiB, since each sector is 512 bytes. =A0So seek= ing > to 256 GiB won't work. =A0Also you probably want lba48 not lba, or you'll > always be limited to 268435455 which is rarely (never?) the actual disk > size. Quote: # GPT optionally caches a protective MBR at the end; trash it. dd if=3D/dev/zero of=3D/dev/$1 bs=3D1m oseek=3D`expr 0 + $capacity / 1024 -= 1` Yes, it's required for some cases because of the way that some systems setup with gpt partitioning; PCBSD for instance does install a PMBR that confuses the hell out of sysinstall where geom keeps on restoring the old disk layout when it tastes the provider. The capacity drive is 250GB, and I intentionally want to blow away the last couple of sectors: %atacontrol cap ad4 Protocol Serial ATA II device model WDC WD2502ABYS-18B7A0 serial number WD-WCAT1F033778 firmware revision 02.03B04 cylinders 16383 heads 16 sectors/track 63 lba supported 268435455 sectors lba48 supported 488281250 sectors dma supported overlap not supported Feature Support Enable Value Vendor write cache yes yes read ahead yes yes Native Command Queuing (NCQ) yes - 31/0x1F Tagged Command Queuing (TCQ) no no 31/0x1F SMART yes yes microcode download yes yes security yes no power management yes yes advanced power management no no 0/0x00 automatic acoustic management yes no 254/0xFE 128/0x80 I don't doubt that my math is wrong though... I'll use lba48 instead. >> + ls /dev/ad4s* >> ls: /dev/ad4s*: No such file or directory >> + gpart create -s MBR ad4 >> gpart: 22 scheme 'MBR' >> + gpart bootcode -b /boot/mbr -p /boot/boot0 -i 5 ad4 >> gpart: No such geom: ad4. > > I'm not sure you want to use both -b and -p options at the same time.. > does that even work? No idea. At this point I've just started throwing random stuff at geom trying to figure out why things aren't working because trying the same thing over and over expecting a different results is a sign of insanity :D. > Regardless, try my aforementioned suggestion of specifying the complete > device path when running "gpart bootcode". Did that and the basename for the provider (ad4 in this case). Neither worked :(. > Also, what is partition #5 here? >From boot0cfg(8): -s slice Set the default boot selection to slice. Values between 1 and= 4 refer to slices; a value of 5 refers to the option of booting from a second disk. Probably user error, but it was worth trying I guess.. >> + gpart add -b 34 -s 128 -t freebsd ad4 >> gpart: 22 geom 'ad4' >> + gpart show ad4 >> gpart: No such geom: ad4. >> + ls /dev/ad4s* >> ls: /dev/ad4s*: No such file or directory > > Are you sure geom_part_mbr and geom_part_bsd are kldload'd? It's 7.1, so the names are different... %kldstat -v | grep g_ 58 g_md 133 g_bsd 134 g_dev 135 g_disk 136 g_mbrext 137 g_mbr 138 g_vfs 139 g_part 206 g_class geom is hardwired into the kernel. Thanks! -Garrett