Date: Fri, 18 Mar 2022 17:32:24 +0700 From: Eugene Grosbein <eugen@grosbein.net> To: Hartmut.Brandt@dlr.de, hackers@freebsd.org Subject: Re: Odd behaviour after disk conversion (partition disappeared) Message-ID: <ad4f2aa6-d4f7-c1bb-2924-5257ae88d9c4@grosbein.net> In-Reply-To: <7e5669b2afe842b3bbc16737d8a3066c@dlr.de> References: <7e5669b2afe842b3bbc16737d8a3066c@dlr.de>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ad4f2aa6-d4f7-c1bb-2924-5257ae88d9c4>