From owner-freebsd-bugs@FreeBSD.ORG Thu Aug 23 22:30:07 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C2A41065677 for ; Thu, 23 Aug 2012 22:30:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 826D58FC17 for ; Thu, 23 Aug 2012 22:30:06 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q7NMU6Ci072020 for ; Thu, 23 Aug 2012 22:30:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q7NMU6Hb072017; Thu, 23 Aug 2012 22:30:06 GMT (envelope-from gnats) Resent-Date: Thu, 23 Aug 2012 22:30:06 GMT Resent-Message-Id: <201208232230.q7NMU6Hb072017@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dieter Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7D30E106566C for ; Thu, 23 Aug 2012 22:29:48 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 67E2E8FC21 for ; Thu, 23 Aug 2012 22:29:48 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q7NMTmIh037484 for ; Thu, 23 Aug 2012 22:29:48 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q7NMTmNj037483; Thu, 23 Aug 2012 22:29:48 GMT (envelope-from nobody) Message-Id: <201208232229.q7NMTmNj037483@red.freebsd.org> Date: Thu, 23 Aug 2012 22:29:48 GMT From: Dieter To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/170945: disk layout not portable between direct connect and USB bridge X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Aug 2012 22:30:07 -0000 >Number: 170945 >Category: kern >Synopsis: disk layout not portable between direct connect and USB bridge >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Aug 23 22:30:06 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Dieter >Release: FreeBSD 8.2 amd64 >Organization: >Environment: FreeBSD 8.2 amd64 >Description: With a SATA drive connected to a SATA controller, we get: start size index contents 0 1 PMBR 1 1 Pri GPT header 2 32 Pri GPT table 34 6 1 GPT part - FreeBSD UFS/UFS2 40 5860533095 2 GPT part - FreeBSD UFS/UFS2 5860533135 32 Sec GPT table 5860533167 1 Sec GPT header (The 6 sector partition is for 4KiB alignment.) With a USB bridge, we get this: start size index contents 0 1 PMBR 1 1 Pri GPT header 2 4 Pri GPT table 6 6 1 GPT part - FreeBSD UFS/UFS2 12 732566573 2 GPT part - FreeBSD UFS/UFS2 732566585 55 732566640 4 Sec GPT table 732566644 1 Sec GPT header Note that these are 4 KiB sectors, so the GPT header no longer starts at 512, it now starts at 4096. It does work, so long as we have the disk attached to the USB bridge. But move the disk from the USB bridge to a direct sata controller, and it breaks: start size index contents 0 1 PMBR 1 5860533167 The GPT headers are not found, thus the partitions are not found. Unusable. I suspect that moving a disk in the opposite direction is probably broken as well. [ Yes, with the USB's 4 KiB sectors the 6 sector alignment partition is not needed. And with just one large data partition we can skip partitioning and just newfs the drive. ] >How-To-Repeat: >Fix: Have the kernel look for a GPT header at 4096 as well as at 512. (And similarly for the secondary header.) >Release-Note: >Audit-Trail: >Unformatted: