From owner-freebsd-hackers@freebsd.org Fri Jul 19 11:55:30 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44A01BFB3D for ; Fri, 19 Jul 2019 11:55:30 +0000 (UTC) (envelope-from rank1seeker@gmail.com) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 09B3C6A9AD for ; Fri, 19 Jul 2019 11:55:30 +0000 (UTC) (envelope-from rank1seeker@gmail.com) Received: by mailman.nyi.freebsd.org (Postfix) id 071E4BFB3C; Fri, 19 Jul 2019 11:55:30 +0000 (UTC) Delivered-To: hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 05B5CBFB3B for ; Fri, 19 Jul 2019 11:55:30 +0000 (UTC) (envelope-from rank1seeker@gmail.com) Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2A396A9AC; Fri, 19 Jul 2019 11:55:28 +0000 (UTC) (envelope-from rank1seeker@gmail.com) Received: by mail-ed1-x543.google.com with SMTP id k8so34224611edr.11; Fri, 19 Jul 2019 04:55:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bcEkfmdr/s37zzViADmMAHY2XytIlAQ2WW5Mjxzl40c=; b=KlvCNIXewztpIaGaHjSNegK6plzxXvqoCRMsaz3AWSRWS9UthJS02I7x0XpFEXuTbS LNN698BR6imU1KxU8dRQXXRsXyvNgwfEHp69SECKGGjh3RQtyBCkltxTGBrL++O8qVs6 UbHNr0o6C4QCqJJKB7TK7MeZ5j9La2BJp5UvcvrQJQZUqWadf32yWlDWMoToP5yeMqNi 4cCusGF+1n0JA2WQGn2CArBAQN9osVjub+9yRh+TveI+mAldtvGswf2eWg9mUy/o7ZgZ 5hMhX4f/fy6X7Hg3QmL9WEfaEX7CqQcLv8MOAVRsg9i4xOtWpyK7qBIA7uLhSEVGDUPg LejQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bcEkfmdr/s37zzViADmMAHY2XytIlAQ2WW5Mjxzl40c=; b=fT19zSK3FuhyNF/KMtBQxOJ6izxzNU1+mlPIIZepSO0U2ohkwU7h4LqcLi46gq3ntE mp3GG1EIOCFlhyuAeQjUXiVdspoMaKwbuBC62/hPyiqWvCv2gDeIrBtgVVY3+5vnFRC9 mJIQSCoe+zNmn0hhw1WTG5FwxrvRtMBPO9fnf7YKEQWUSy8+B/EAcfcpbicjn6Q3HSsX lLLLp28r5KGZBH94ir3bH3iCII4bjqXXqsQdOcrXzy32j9aVOmv4SIgLCQHYhazSMpG2 muC3Mzdjzn3pVf8HWGCrLkG00hhtKHFWDqo+XgoXqbDm5pKD5yIwExyDM9bNNVU8DLcK QtJw== X-Gm-Message-State: APjAAAULPqjyXsGVCH/i0AuElFPR+dEiOU86cPGl937QSlWR/Fc2FOGc 7jyQ8w15BcpO2otybowxE0y5/P/Y7r0= X-Google-Smtp-Source: APXvYqzdyNzUI+G1BGNn50tnmwpxspIZNo/b02zqPPXEOoNvoYaOQaprnKS+wQFH5xtPxZkl5QKU6A== X-Received: by 2002:a17:906:4a10:: with SMTP id w16mr40571516eju.299.1563537327746; Fri, 19 Jul 2019 04:55:27 -0700 (PDT) Received: from localhost ([213.149.55.147]) by smtp.gmail.com with ESMTPSA id u24sm6169950ejr.20.2019.07.19.04.55.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Jul 2019 04:55:27 -0700 (PDT) Date: Fri, 19 Jul 2019 13:54:37 +0200 From: Domagoj =?UTF-8?Q?Smol=C4=8Di=C4=87?= To: Warner Losh Cc: hackers@freebsd.org, delphij@FreeBSD.org Subject: Re: Device's "stolen" sector Message-ID: <20190719135437.00002536@gmail.com> In-Reply-To: References: <20190716182350.000054f8@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: C2A396A9AC X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=KlvCNIXe; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rank1seeker@gmail.com designates 2a00:1450:4864:20::543 as permitted sender) smtp.mailfrom=rank1seeker@gmail.com X-Spamd-Result: default: False [-5.06 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-1.09)[ip: (-0.03), ipnet: 2a00:1450::/32(-2.92), asn: 15169(-2.43), country: US(-0.05)]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[3.4.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2019 11:55:30 -0000 On Tue, 16 Jul 2019 10:45:07 -0600 Warner Losh wrote: > On Tue, Jul 16, 2019 at 10:25 AM Domagoj Smol=C4=8Di=C4=87 > wrote: >=20 > > 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? > > =20 >=20 > 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. >=20 > 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=C4=8Di=C4=87