From owner-freebsd-hackers@freebsd.org Wed Jul 17 16:19:24 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 C0497B051C for ; Wed, 17 Jul 2019 16:19:24 +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 2140488AE0 for ; Wed, 17 Jul 2019 16:19:24 +0000 (UTC) (envelope-from rank1seeker@gmail.com) Received: by mailman.nyi.freebsd.org (Postfix) id 20D15B051B; Wed, 17 Jul 2019 16:19:24 +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 20976B051A for ; Wed, 17 Jul 2019 16:19:24 +0000 (UTC) (envelope-from rank1seeker@gmail.com) Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) (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 D16F688ADD for ; Wed, 17 Jul 2019 16:19:23 +0000 (UTC) (envelope-from rank1seeker@gmail.com) Received: by mail-ed1-x544.google.com with SMTP id p15so26421363eds.8 for ; Wed, 17 Jul 2019 09:19:23 -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=JbVUX6QHHleRCOwfkhVpMWqtbbHzXnXVkcxjOA1p4cI=; b=nOILN5p9fYQc9Og7ic7L/DVKuGf3bqNNM4mNJz3lW+t6O5MXF1IbyrXhDiRqriMQnL IHtzQH3iYgyUZWmc9bbN8RHBBX1mCa8dI0hAbNrlYv6tl7VAuFcMxF9RqTKuvRZdGt27 glcuhknpaUDslbHowMS0Yb8tLMvVEOl6CSvDqBKlhOgUT4Jd1EKWL+5AQVOCcAIjvOME r9a2P1RY8k0klRk/DOggbSU9vBpvye9xJ35eo2Li1S1l0xH1KwYDx7w3cp3UOVbhJ9sT LJg06F8Xfss7JPlfCP6m/vCPL86i5qnXPfh7g3YjeTaQ4kOvWePLnEgdNrGE5r1XuPVy XHyg== 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=JbVUX6QHHleRCOwfkhVpMWqtbbHzXnXVkcxjOA1p4cI=; b=Njo4YTcUwNkh0sVfPzsCPWnFqniT7yYxXmo5GjJZXW7/OqnaIgrs0qGKIPqCpOQJX9 hSMk/RotI9lpnJ4FcH24sL5BGetrA9Y2x1lwKjdaMd5mBqBp8SEOPM3psVe4HmaEtLBU 2i17Td23xkouy0QXaTdQOWuvZXU8QNRKcAfkwbzpwgFcg49KygHYblTIjp4Jv5sGP4xi 3oBe6lu3GpO/Xnb3KpAYDsbS7O+m/qQY0iMYdKoYFEh9Axuby9d+hQ8lSU3Ulsn2iwvZ /G/+XRaOCsjBDJVXSiU9DKA/l3WCAXuyiUJRPHqmIvpNc1zarkW+GYN4VLJnCIyJFxqg /5fQ== X-Gm-Message-State: APjAAAV5xMBHeRgLLLy+mhAMnWMTSg3UZiflaMXz+s5sFWONX/NJNoFY IBvAxdmbIJIYaRg77ug+vl15QW6lH9w= X-Google-Smtp-Source: APXvYqzHVUePWKEb958U+/uW+eg6i0yOJ1PjSbhTTTzV9NndyB4X9GU0iBEt2FjoKpIOOea0u3tDWg== X-Received: by 2002:a17:906:ece7:: with SMTP id qt7mr32211090ejb.155.1563380362761; Wed, 17 Jul 2019 09:19:22 -0700 (PDT) Received: from localhost ([213.149.52.156]) by smtp.gmail.com with ESMTPSA id t13sm6965381edd.13.2019.07.17.09.19.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jul 2019 09:19:22 -0700 (PDT) Date: Wed, 17 Jul 2019 18:18:34 +0200 From: Domagoj =?UTF-8?Q?Smol=C4=8Di=C4=87?= To: Warner Losh Cc: Wojciech Puchar , hackers@freebsd.org Subject: Re: Device's "stolen" sector Message-ID: <20190717181834.00002698@gmail.com> In-Reply-To: References: <20190716182350.000054f8@gmail.com> <20190716224332.00000326@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: D16F688ADD X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.994,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] 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: Wed, 17 Jul 2019 16:19:24 -0000 On Tue, 16 Jul 2019 15:34:47 -0600 Warner Losh wrote: > On Tue, Jul 16, 2019 at 2:44 PM Domagoj Smol=C4=8Di=C4=87 > wrote: >=20 > > On Tue, 16 Jul 2019 13:27:43 -0600 > > Warner Losh wrote: > > =20 > > > On Tue, Jul 16, 2019 at 11:05 AM Wojciech Puchar > > > wrote: > > > =20 > > > > > > > > > > > > On Tue, 16 Jul 2019, 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 =20 > > > > amount of sectors. =20 > > > > > diskinfo -v ada1 > > > > > > > > > > When I connect it to the same MBO over USB to SATA adapter, 1 > > > > > sector is =20 > > > > missing (the last one) =20 > > > > > diskinfo -v da0 > > > > > > > > > > Having last sector inaccessible is a huge problem as many > > > > > "things" use =20 > > > > it for a metadata. =20 > > > > > This has many times caused MBR disks occasionally to not be > > > > > visible at =20 > > > > all while being 'da0' (gpart: No such geom: da0.) =20 > > > > > And also GPT disks to be in a [CORRUPT] state upon reattach > > > > > directly to =20 > > > > SATA interface. =20 > > > > > > > > > > Before submitting a bug, there is only 1 variable left that I > > > > > can't =20 > > > > test, because I have only 1 USB to SATA adapter. =20 > > > > > It might be a hardware issue, so can someone else test this > > > > > too?=20 > > > > 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 > > > > =20 > > > > > > 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 > > > =20 > > > > 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 =20 > > =3D> 63 312581745 ada1 MBR (149G) =20 > > 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) > > =20 >=20 > What does sg_readcap from sg3_utils package say? Wait. When I intended to recompile kernel with sg device, I also decided to bring 11.2 to latest patch version and this also includes world recompilation. But I just saw 11.3 is production ready, so If I'm already doing world+kernel why to not migrate to 11.3 in a process. You'll have it tomorrow. Domagoj > Warner >=20