Device's "stolen" sector
Domagoj Smolčić
rank1seeker at gmail.com
Fri Jul 19 11:55:30 UTC 2019
On Tue, 16 Jul 2019 10:45:07 -0600
Warner Losh <imp at bsdimp.com> wrote:
> On Tue, Jul 16, 2019 at 10:25 AM Domagoj Smolčić
> <rank1seeker at gmail.com> 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?
> >
>
> On 11.x, I'd install the sg3_util port. You'll need the sg device in
> your kernel.
Note: This isn't GENERIC kernel and has only what hardware needs.
Even with:
'device sg'
I'm getting error for all sg_* CMDs:
CAM status: CCB request was invalid
Adding:
'device ses #Enclosure Services (SES and SAF-TE)'
hasn't helped too.
PS: Yes i did '# kldload linux'
Port hasn't specified mandatory devices!
> Use sg_readcap on /dev/da0 to see if the numbers match
> the devinfo from ada1. If they match, then we have a bug in the da
> driver. If they differ, you have hardware issues in the USB to SATA
> adapter.
>
> Warner
sg_* is being used to query device's size by sending SCSI commands directly to device,
through da driver's node, thus ignoring 'da' driver's response of device's size to i.e; diskinfo?
Domagoj Smolčić
More information about the freebsd-hackers
mailing list