From owner-freebsd-geom@freebsd.org Sun Dec 8 17:11:52 2019 Return-Path: Delivered-To: freebsd-geom@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 DC3831E9CC0 for ; Sun, 8 Dec 2019 17:11:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 47WCY45MM5z4R8W for ; Sun, 8 Dec 2019 17:11:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id B627F1E9CBF; Sun, 8 Dec 2019 17:11:52 +0000 (UTC) Delivered-To: geom@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 B5DCD1E9CBE for ; Sun, 8 Dec 2019 17:11:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47WCY431lGz4R8R for ; Sun, 8 Dec 2019 17:11:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63252578F for ; Sun, 8 Dec 2019 17:11:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id xB8HBq7a045029 for ; Sun, 8 Dec 2019 17:11:52 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id xB8HBqLH045028 for geom@FreeBSD.org; Sun, 8 Dec 2019 17:11:52 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: geom@FreeBSD.org Subject: [Bug 242341] GEOM / GEOM_PART: silent discard MBR modification Date: Sun, 08 Dec 2019 17:11:51 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 12.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: tomek@cedro.info X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: geom@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 17:11:52 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D242341 --- Comment #3 from Tomasz "CeDeROM" CEDRO --- Hello Andrew! :-) Thank you for your reply. There is a discussion on a mailing lists (questio= ns andusb), where some folks say this is the pendrive problem, others suggest = that invalid MBR may be the reason of discarding writes to MBR. I think here is the best place to ask questions and solve the issue directly with authors :-) 1. I would like to clarify why I was unable to write to MBR (first 512 byte= s) of the da1 while there was no problem with writhing to the rest of the disk? 2. GEOM_PART: integrity check failed (da1, MBR) <- could that block / disca= rd writes to MBR silently? 3. Why `dd if=3D/dev/da0 of=3D/dev/da1` did copy all disk except the MBR? 4. Why I was unable to write to MBR from a file but it was possible to write that data from a file over md0? This is the first time such situation happened to me in FreeBSD for many ma= ny years. I am working a lot on disk copies / images so reliable and trustwort= hy DD is a must have for me.. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-geom@freebsd.org Sun Dec 8 21:00:41 2019 Return-Path: Delivered-To: freebsd-geom@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 811361B942F for ; Sun, 8 Dec 2019 21:00:41 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 47WJd52xzcz3MBV for ; Sun, 8 Dec 2019 21:00:41 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: by mailman.nyi.freebsd.org (Postfix) id 64F541B9422; Sun, 8 Dec 2019 21:00:41 +0000 (UTC) Delivered-To: geom@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 647341B9420 for ; Sun, 8 Dec 2019 21:00:41 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47WJd51xdGz3MBJ for ; Sun, 8 Dec 2019 21:00:41 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BF1D80D4 for ; Sun, 8 Dec 2019 21:00:41 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id xB8L0fqp045209 for ; Sun, 8 Dec 2019 21:00:41 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id xB8L0f2b045208 for geom@FreeBSD.org; Sun, 8 Dec 2019 21:00:41 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Message-Id: <201912082100.xB8L0f2b045208@kenobi.freebsd.org> X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@FreeBSD.org using -f From: bugzilla-noreply@FreeBSD.org To: geom@FreeBSD.org Subject: Problem reports for geom@FreeBSD.org that need special attention Date: Sun, 8 Dec 2019 21:00:41 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 21:00:41 -0000 To view an individual PR, use: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=(Bug Id). The following is a listing of current problems submitted by FreeBSD users, which need special attention. These represent problem reports covering all versions including experimental development code and obsolete releases. Status | Bug Id | Description ------------+-----------+--------------------------------------------------- In Progress | 218679 | [geli] add a verify command Open | 237269 | panic in glabel (g_label_destroy) stop after resi Open | 238814 | geom: topology lock being dropped in dumpconf of 3 problems total for which you should take action. From owner-freebsd-geom@freebsd.org Mon Dec 9 11:09:36 2019 Return-Path: Delivered-To: freebsd-geom@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 6751C1D3A90 for ; Mon, 9 Dec 2019 11:09:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 47WgSc27ykz4VGC for ; Mon, 9 Dec 2019 11:09:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 4762C1D3A8F; Mon, 9 Dec 2019 11:09:36 +0000 (UTC) Delivered-To: geom@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 460091D3A8E for ; Mon, 9 Dec 2019 11:09:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47WgSc0wwyz4VGB for ; Mon, 9 Dec 2019 11:09:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19F2F19A79 for ; Mon, 9 Dec 2019 11:09:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id xB9B9Zvh047911 for ; Mon, 9 Dec 2019 11:09:35 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id xB9B9Zck047910 for geom@FreeBSD.org; Mon, 9 Dec 2019 11:09:35 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: geom@FreeBSD.org Subject: [Bug 242341] GEOM / GEOM_PART: silent discard MBR modification Date: Mon, 09 Dec 2019 11:09:35 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 12.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: ae@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: geom@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 11:09:36 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D242341 Andrey V. Elsukov changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ae@FreeBSD.org --- Comment #4 from Andrey V. Elsukov --- Hello, if you want to get answers, you need to provide more useful info. First of rumors like "I did something and it didn't work" aren't useful. You should provide the state of your system at the time before you did some changes, then what you want to do and what you expect to get in the result.= And then what result you have got. How to obtain this info: gpart show gpart list mount dmesg | grep GEOM all commands you have ran and the resulted output. And then we will can say where is the problem. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-geom@freebsd.org Mon Dec 9 11:22:39 2019 Return-Path: Delivered-To: freebsd-geom@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 1878C1D3FFA for ; Mon, 9 Dec 2019 11:22:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 47Wglf6zn2z4W4J for ; Mon, 9 Dec 2019 11:22:38 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id EF7CF1D3FF8; Mon, 9 Dec 2019 11:22:38 +0000 (UTC) Delivered-To: geom@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 EE3491D3FF7 for ; Mon, 9 Dec 2019 11:22:38 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Wglf60slz4W4H for ; Mon, 9 Dec 2019 11:22:38 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C980719DF4 for ; Mon, 9 Dec 2019 11:22:38 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id xB9BMcxx014008 for ; Mon, 9 Dec 2019 11:22:38 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id xB9BMc0w013977 for geom@FreeBSD.org; Mon, 9 Dec 2019 11:22:38 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: geom@FreeBSD.org Subject: [Bug 242341] GEOM / GEOM_PART: silent discard MBR modification Date: Mon, 09 Dec 2019 11:22:38 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 12.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: ae@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: geom@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 11:22:39 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D242341 --- Comment #5 from Andrey V. Elsukov --- (In reply to Tomasz "CeDeROM" CEDRO from comment #3) > 1. I would like to clarify why I was unable to write to MBR (first 512 by= tes) of the da1 while there was no problem with writhing to the rest of the= disk? How did you know that? Did you compare the first 512 bytes on both disks af= ter copying? > 2. GEOM_PART: integrity check failed (da1, MBR) <- could that block / dis= card writes to MBR silently? This usually means that parition table's metadata is wrong. If it is wrong,= and kern.geom.part.check_integrity is set, then GEOM_PART just ignores the partition table. > 3. Why `dd if=3D/dev/da0 of=3D/dev/da1` did copy all disk except the MBR? How did you know that? Did you compare the first 512 bytes on both disks af= ter copying? I assume you have disks with different size and GEOM_PART just rej= ects MBR on the copied disk, because its integrity check has failed.=20 > 4. Why I was unable to write to MBR from a file but it was possible to wr= ite that data from a file over md0? Again, how did you know that? --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-geom@freebsd.org Mon Dec 9 15:27:13 2019 Return-Path: Delivered-To: freebsd-geom@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 7476E1D9199 for ; Mon, 9 Dec 2019 15:27:13 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 47Wn9s2St2z3Fnw for ; Mon, 9 Dec 2019 15:27:13 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 549901D9198; Mon, 9 Dec 2019 15:27:13 +0000 (UTC) Delivered-To: geom@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 545961D9197 for ; Mon, 9 Dec 2019 15:27:13 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Wn9s1Ykyz3Fnt for ; Mon, 9 Dec 2019 15:27:13 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 310FB1C95A for ; Mon, 9 Dec 2019 15:27:13 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id xB9FRDhc093933 for ; Mon, 9 Dec 2019 15:27:13 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id xB9FRDwE093932 for geom@FreeBSD.org; Mon, 9 Dec 2019 15:27:13 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: geom@FreeBSD.org Subject: [Bug 242341] GEOM / GEOM_PART: silent discard MBR modification Date: Mon, 09 Dec 2019 15:27:13 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 12.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: tomek@cedro.info X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: geom@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 15:27:13 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D242341 --- Comment #6 from Tomasz "CeDeROM" CEDRO --- (In reply to Andrey V. Elsukov from comment #5) Hello Andrey and thank you for your reply :-) =3D ACTIONS =3D 1. dd if=3D/dev/da0 of=3D/dev/da1 bs=3D512 count=3D1 does not copy anything. 2. dd if=3D/dev/zero of=3D/dev/da1 bs=3D512 count=3D1 zeroes the mbr. 3. dd if=3D/dev/random of=3D/dev/da1 bs=3D512 count=3D1 randoms the mbr. 4. dd if=3D/dev/da0 of=3Dda0.mbr bs=3D512 count1; dd if=3Dda0.mbr bc=3D512 count=3D1 does NOT copy the mbr. 5. mdconfig -a -tvnode da0.mbr; dd if=3D/dev/md0 of=3D/dev/da1 bc=3D512 count=3D1 does put the data into mbr, but still da1 seems to have no partitions!!! =3D ANSWERS =3D >> 1. I would like to clarify why I was unable to write to MBR=20 >> (first 512 bytes) of the da1 while there was no problem with >> writhing to the rest of the disk? > How did you know that? Did you compare the first 512 bytes > on both disks after copying? Yes, exactly! I am using `less -f` rather than `bvi` (stalls the OS by load= ing 128GB into RAM lol) on a large files just to sneak peek the contents. Because after initial failures with DD I did ZERO the whole disk just to ma= ke sure its is all clean. Zeros looks like monkeys and you can see with bare e= ye where are zeros and where not, 512 bytes fits nicely on one screen :-) >> 2. GEOM_PART: integrity check failed (da1, MBR)=20 >> <- could that block / discard writes to MBR silently? > This usually means that parition table's metadata is wrong. > If it is wrong, and kern.geom.part.check_integrity is set,=20 > then GEOM_PART just ignores the partition table. root@0xCFMX4:~ # sysctl kern.geom.part.check_integrity kern.geom.part.check_integrity: 1 Can you please explain in detail what does it mean exactly "ignores the partition table"? I guess here is the problem. If the "partition table is ignored", then why it is silently ignored, write= s to MBR goes to /dev/null, reads from MBR does not update disk layout, while it= is possible to write to the rest of the disk? Why the whole disk is not locked against writing in a clearly distinguishab= le manner? Like error return code from DD and error messages in DMESG? If the MBR is corrupt, then high chance of all partitions may be corrupt, w= rite out of bounds may happen, so writing data to such disk would irreversibly destroy data that are stored on such drive. This "ignore" thing makes system incoherent and unpredictable. Here is my proposal for change: 1. Either we allow writing to the WHOLE disk AND the MBR but signal _warnin= g_ the MBR corruption via DMESG when kern.geom.part.check_integrity=3D1. 2. Or we signal _error_ MBR corruption over DMESG and whole disk is locked against writing with clear error message (i.e. DD writes return clear fail = and at the same time we show DMESG error message like "/DEV/XXX disk is write locked because MBR is corrupt. Clear kern.geom.part.check_integrity if you = want to write to that disk anyway") when kern.geom.part.check_integrity=3D1. 3. I know there are some additional flags that may allow writing over "igno= red" disk. They are not set by default and kind of unclear where to find them. Definitely not a fix for the current "silent write ignore surprise" until y= ou set them. I guess using the kern.geom.part.check_integrity is good enough to control the situation. Either kern.geom.part.check_integrity=3D1 and when M= BR or GPT is corrupt then WHOLE disk is clearly locked against writing (as explai= ned in point 2 above), or kern.geom.part.check_integrity=3D0 and we can write o= ver the WHOLE disk even if MBR or GPT seems corrupted because it is not verifie= d. I think number 2 would be the safest choice..? >> 3. Why `dd if=3D/dev/da0 of=3D/dev/da1` did copy all disk except the MBR? > How did you know that? Did you compare the first 512 bytes on both disks > after copying? I assume you have disks with different size and GEOM_PART > just rejects MBR on the copied disk, because its integrity check has fail= ed.=20 Exactly, verified them after write. No write to MBR occured, but the whole contents was written. There was no clear error that MBR was not written. Th= is should be signaled with an error and write to the disk should be prohibited= as explained above. So you confirm that the write to MBR was silently discared and the whole situation is indeed managed by GEOM_PART. This is exactly the problem I am reporting. Thank you :-) >> 4. Why I was unable to write to MBR from a file but it was possible >> to write that data from a file over md0? > Again, how did you know that? Verification after write :-) =3D SYSTEM DETAILS =3D ugen0.7: at usbus0 umass0 on uhub0 umass0: on us= bus0 umass0: SCSI over Bulk-Only; quirks =3D 0x8100 umass0:2:0: Attached to scbus2 da0 at umass-sim0 bus 0 scbus2 target 0 lun 0 da0: Removable Direct Access SPC-4 SCSI de= vice da0: Serial Number BLAHBLAH da0: 400.000MB/s transfers da0: 118368MB (242417664 512 byte sectors) da0: quirks=3D0x2 ugen0.8: at usbus0 umass1 on uhub0 umass1: on us= bus0 umass1: SCSI over Bulk-Only; quirks =3D 0x8100 umass1:3:1: Attached to scbus3 da1 at umass-sim1 bus 1 scbus3 target 0 lun 0 da1: Removable Direct Access SPC-4 SCSI de= vice da1: Serial Number BLAHBLAH da1: 400.000MB/s transfers da1: 118272MB (242221056 512 byte sectors) da1: quirks=3D0x2 GEOM_PART: integrity check failed (da1, MBR) FreeBSD 0xCFMX4 12.1-RELEASE-p1 FreeBSD 12.1-RELEASE-p1 GENERIC amd64 --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-geom@freebsd.org Mon Dec 9 15:51:28 2019 Return-Path: Delivered-To: freebsd-geom@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 31C111D9A23 for ; Mon, 9 Dec 2019 15:51:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 47Wnjr0flHz3HJd for ; Mon, 9 Dec 2019 15:51:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 14B8E1D9A22; Mon, 9 Dec 2019 15:51:28 +0000 (UTC) Delivered-To: geom@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 147A81D9A21 for ; Mon, 9 Dec 2019 15:51:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Wnjq6sNHz3HJc for ; Mon, 9 Dec 2019 15:51:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6DDC1CD6C for ; Mon, 9 Dec 2019 15:51:27 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id xB9FpRjq057264 for ; Mon, 9 Dec 2019 15:51:27 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id xB9FpR0m057263 for geom@FreeBSD.org; Mon, 9 Dec 2019 15:51:27 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: geom@FreeBSD.org Subject: [Bug 242341] GEOM / GEOM_PART: silent discard MBR modification Date: Mon, 09 Dec 2019 15:51:28 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 12.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: ae@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: geom@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 15:51:28 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D242341 --- Comment #7 from Andrey V. Elsukov --- (In reply to Tomasz "CeDeROM" CEDRO from comment #6) And again, You didn't provided any useful info. > 1. dd if=3D/dev/da0 of=3D/dev/da1 bs=3D512 count=3D1 does not copy anythi= ng. Please, use script(1) command if you unable to make a copy from your termin= al. Should be something like this: # dd if=3D/dev/da0 of=3D/dev/da1 count=3D1 1+0 records in 1+0 records out 512 bytes transferred in 0.001958 secs (261495 bytes/sec) You can use hexdump(1) command to check the result of your copy, e.g. # dd if=3D/dev/da1 count=3D1 | hexdump -vC > 2. dd if=3D/dev/zero of=3D/dev/da1 bs=3D512 count=3D1 zeroes the mbr. This looks impossible, if first command doesn't work, this also wont work. > Can you please explain in detail what does it mean exactly "ignores the=20 > partition table"? I guess here is the problem. There is no problem, all described in gpart(8) man page. "Ignores" means th= at GEOM_PART class will not create geom object of type MBR and there will no partitions appears.=20 > If the "partition table is ignored", then why it is silently ignored,=20 > writes to MBR goes to /dev/null, reads from MBR does not update disk > layout, while it is possible to write to the rest of the disk? > Why the whole disk is not locked against writing in a clearly=20 > distinguishable manner? Like error return code from DD and error=20 > messages in DMESG? I don't think that something like this happens in reality :) > So you confirm that the write to MBR was silently discared and the whole > situation is indeed managed by GEOM_PART. This is exactly the problem I=20 > am reporting. Thank you :-) You still misunderstand how all things work. There are different GEOM objec= ts, and when MBR is ignored, GEOM_PART discards nothing, since there is no rela= ted GEOM object. This is why I asked to show the output of `gpart show` and `gp= art list` commands. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-geom@freebsd.org Mon Dec 9 16:22:22 2019 Return-Path: Delivered-To: freebsd-geom@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 14A9F1DA479 for ; Mon, 9 Dec 2019 16:22:22 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 47WpPT6v6nz3K7M for ; Mon, 9 Dec 2019 16:22:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id EC9D91DA478; Mon, 9 Dec 2019 16:22:21 +0000 (UTC) Delivered-To: geom@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 EC6291DA477 for ; Mon, 9 Dec 2019 16:22:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47WpPT63Cjz3K7L for ; Mon, 9 Dec 2019 16:22:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB04A1D437 for ; Mon, 9 Dec 2019 16:22:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id xB9GMLtN051307 for ; Mon, 9 Dec 2019 16:22:21 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id xB9GMLHV051295 for geom@FreeBSD.org; Mon, 9 Dec 2019 16:22:21 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: geom@FreeBSD.org Subject: [Bug 242341] GEOM / GEOM_PART: silent discard MBR modification Date: Mon, 09 Dec 2019 16:22:21 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 12.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: tomek@cedro.info X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: geom@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2019 16:22:22 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D242341 --- Comment #8 from Tomasz "CeDeROM" CEDRO --- Okay, I am using this pendrive already with some data on it, and I don't ha= ve the other one anymore. That was supposed a quick swap and it failed with a surprise. Will try to recreate that situation logs with script / tee / hexdump as requiested and report back.. probably I will have to buy another one or will use some SD card if I have one.. maybe first sectors would be enough :-) I was also surprised after dd if=3D/dev/da0 of=3D/dev/da1 put data on a pen= drive but no MBR. I tell you :-) :-) ps/2: Do you know https://asciinema.org/ is it okay for documenting stuff? = :-) --=20 You are receiving this mail because: You are the assignee for the bug.=