Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Aug 2012 22:29:48 GMT
From:      Dieter <freebsd@sopwith.solgatos.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/170945: disk layout not portable between direct connect and USB bridge
Message-ID:  <201208232229.q7NMTmNj037483@red.freebsd.org>
Resent-Message-ID: <201208232230.q7NMU6Hb072017@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208232229.q7NMTmNj037483>