From eugen@grosbein.net Fri Mar 18 10:32:24 2022 X-Original-To: hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9D54E1A269AB for ; Fri, 18 Mar 2022 10:33:11 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:c2c:26d8::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KKgMV3CPpz3sS6 for ; Fri, 18 Mar 2022 10:33:10 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.16.1/8.16.1) with ESMTPS id 22IAWvI8070697 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 18 Mar 2022 10:32:57 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: Hartmut.Brandt@dlr.de Received: from [10.58.0.11] (dadvw [10.58.0.11] (may be forged)) by eg.sd.rdtc.ru (8.16.1/8.16.1) with ESMTPS id 22IAWV1h060251 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 18 Mar 2022 17:32:56 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: Odd behaviour after disk conversion (partition disappeared) To: Hartmut.Brandt@dlr.de, hackers@freebsd.org References: <7e5669b2afe842b3bbc16737d8a3066c@dlr.de> From: Eugene Grosbein Message-ID: Date: Fri, 18 Mar 2022 17:32:24 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 In-Reply-To: <7e5669b2afe842b3bbc16737d8a3066c@dlr.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT autolearn=disabled version=3.4.2 X-Spam-Report: * -0.0 SHORTCIRCUIT No description available. * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 4KKgMV3CPpz3sS6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=fail (mx1.freebsd.org: domain of eugen@grosbein.net does not designate 2a01:4f8:c2c:26d8::2 as permitted sender) smtp.mailfrom=eugen@grosbein.net X-Spamd-Result: default: False [-2.01 / 15.00]; ARC_NA(0.00)[]; R_SPF_FAIL(1.00)[-all]; FREEFALL_USER(0.00)[eugen]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_MEDIUM(-0.91)[-0.912]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[grosbein.net]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; MLMMJ_DEST(0.00)[hackers]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/32, country:DE]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N 18.03.2022 16:52, Hartmut.Brandt@dlr.de wrote: > Hi, > > I have a virtual machine on Hyper-V running 12.1-RELEASE-p2. Root is > mounted on /dev/da0s1a. Now we have converted the disk image from .vhdx to > .vmdk to use it on a VMware workstation. Now the BSD partitions > disappeared, but the thing still boots, but from /dev/ada0s1. Of course I > cannot see the swap partition anymore. > > gpart show da0 on the old image shows: > => 63 62914497 da0 MBR (30G) > 63 1 - free - (512B) > 64 62914495 1 freebsd [active] (30G) > 62914559 1 - free - (512B) > > and gpart show da0s1: > => 0 62914495 da0s1 BSD (30G) > 0 58720256 1 freebsd-ufs (28G) > 58720256 3145728 2 freebsd-swap (1.5G) > 61865984 1048511 - free - (512M) > > on the new image gpart show ada0: > => 63 62914497 da0 MBR (30G) > 63 1 - free - (512B) > 64 62914495 1 freebsd [active] (30G) > 62914559 1 - free - (512B) > > and gpart show ada0s1: > gpart: No such geom: ada0s1. > > What happened? The conversion process is supposed to make a 1:1 copy of > the disk image. I guess it was not about conversion but something else changed, too. But the root cause is your da0s1 and da0s1a having same offset from the beginning of da0 and this is bad. One should not create 'a' partition at zero offset inside BSD label but either create 'b' partition at the beginning of the slice and 'a' after 'b', or use non-zero offset for 'a'. Or else you can hit this problem with GEOM tasting order due to ambiguity.