Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jul 2019 15:34:47 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        =?UTF-8?B?RG9tYWdvaiBTbW9sxI1pxIc=?= <rank1seeker@gmail.com>
Cc:        Wojciech Puchar <wojtek@puchar.net>, "freebsd-hackers@freebsd.org" <hackers@freebsd.org>
Subject:   Re: Device's "stolen" sector
Message-ID:  <CANCZdfpJgw6k2hoTYgUTYfonKyYZEUYvfYePO9-gDypHY74BsQ@mail.gmail.com>
In-Reply-To: <20190716224332.00000326@gmail.com>
References:  <20190716182350.000054f8@gmail.com> <alpine.BSF.2.20.1907161841340.6412@puchar.net> <CANCZdfp9zMD2gFz3NAJWa-s83XW24PPBBazu4uik3b3ss6w5uA@mail.gmail.com> <20190716224332.00000326@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jul 16, 2019 at 2:44 PM Domagoj Smol=C4=8Di=C4=87 <rank1seeker@gmai=
l.com>
wrote:

> On Tue, 16 Jul 2019 13:27:43 -0600
> Warner Losh <imp@bsdimp.com> wrote:
>
> > On Tue, Jul 16, 2019 at 11:05 AM Wojciech Puchar <wojtek@puchar.net>
> > wrote:
> >
> > >
> > >
> > > On Tue, 16 Jul 2019, Domagoj Smol=C4=8Di=C4=87 wrote:
> > >
> > > > 11.2-RELEASE-p9
> > > >
> > > > Tested with >1 disks:
> > > > --
> > > > SATA disk connected directly with SATA cable to MBO, shows
> > > > correct
> > > amount of sectors.
> > > >    diskinfo -v ada1
> > > >
> > > > When I connect it to the same MBO over USB to SATA adapter, 1
> > > > sector is
> > > missing (the last one)
> > > >    diskinfo -v da0
> > > >
> > > > Having last sector inaccessible is a huge problem as many
> > > > "things" use
> > > it for a metadata.
> > > > This has many times caused MBR disks occasionally to not be
> > > > visible at
> > > all while being 'da0' (gpart: No such geom: da0.)
> > > > And also GPT disks to be in a [CORRUPT] state upon reattach
> > > > directly to
> > > SATA interface.
> > > >
> > > > Before submitting a bug, there is only 1 variable left that I
> > > > can't
> > > test, because I have only 1 USB to SATA adapter.
> > > > It might be a hardware issue, so can someone else test this too?
> > > >
> > > i have two external disk chassis with USB-SATA bridge, works just
> > > fine
> > >
> > > recently connected through it disk that was geli encrypted when
> > > directly connected to server. geli worked so all is fine as geli
> > > header is in last sector
> > >
> >
> > It all depends... There's huge variation in the quality of USB-SATA
> > bridges. Some get in the way and do things like round off the last
> > sector when the reported capacity is odd, for example. Which is why
> > I'm trying to see if there's an issue with that, or if the issue is
> > something in the da driver. For drives with an even number of
> > sectors, there's likely no issues at all...
> >
> > Warner
> >
>
> Well, I've installed sysutils/sg3_utils, but required sg device will have
> to wait,
> as I can't recompile kernel ATM.
>
> Regarding quality ..., this one was so cheap that I've got it for free. ;=
)
> Regarding capacity ..., HDD has EVEN number of sectors.
>
> Last HDD checked (just before posting) Hitachi:
> =3D=3D=3D=3D=3D=3D=3D=3D
> # diskinfo -v ada1 | awk '/mediasize in sectors/{print $1}'
> 312581808
>
> # gpart show -p ada1
> =3D>       63  312581745    ada1  MBR  (149G)
>     312581745 + 63 =3D 312581808
>
> All OK!
>
>
> # diskinfo -v da0 | awk '/mediasize in sectors/{print $1}'
> 312581807
>
> # gpart show -p da0
> gpart: No such geom: da0.
>     Showed nothing (usually it does even in this cases)
>

What does sg_readcap from sg3_utils package say?

Warner



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