Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-12 Thread Ignatios Souvatzis, YCM
On Sun, Apr 11, 2021 at 10:15:18PM -, Michael van Elst wrote: > I have also seen winchester disks with 128 byte sectors, ESDI > disks with 576 byte sectors and CD-ROM XA media uses 2352 byte > sectors. I've seen a washing machine sized DEC disk drive, formerly used by the Physics institute @

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-12 Thread Anders Magnusson
Den 2021-04-12 kl. 22:16, skrev i...@netbsd.org: On Sun, Apr 11, 2021 at 10:15:18PM -, Michael van Elst wrote: I have also seen winchester disks with 128 byte sectors, ESDI disks with 576 byte sectors and CD-ROM XA media uses 2352 byte sectors. I've seen a washing-machine sized disk

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-12 Thread is
On Sun, Apr 11, 2021 at 10:15:18PM -, Michael van Elst wrote: > I have also seen winchester disks with 128 byte sectors, ESDI > disks with 576 byte sectors and CD-ROM XA media uses 2352 byte > sectors. I've seen a washing-machine sized disk driver, used with 128-word sectors (thus 4608 bits)

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-11 Thread Michael van Elst
k...@munnari.oz.au (Robert Elz) writes: >Date:Sun, 11 Apr 2021 18:14:44 - (UTC) >From:mlel...@serpens.de (Michael van Elst) >Message-ID: > | + spb = vnd->sc_geom.vng_secsize / DEV_BSIZE; >Do we know for sure here that vng_secsize >= DEV_BSIZE ? >When I

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-11 Thread Michael van Elst
wo...@planix.ca ("Greg A. Woods") writes: > } else if (vnd->sc_size >= (32 * 64)) { > /* >- * Size must be at least 2048 DEV_BSIZE blocks >- * (1M) in order to use this geometry. >+ * The file's

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-11 Thread Robert Elz
Date:Sun, 11 Apr 2021 18:14:44 - (UTC) From:mlel...@serpens.de (Michael van Elst) Message-ID: | + spb = vnd->sc_geom.vng_secsize / DEV_BSIZE; Do we know for sure here that vng_secsize >= DEV_BSIZE ? When I first used unix (long long ago) the drives I

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-11 Thread Greg A. Woods
So I just tested the patch below, and it actually works! FreeBSD complains a wee bit during boot that it can't read the last few sectors of the disk and later the last few sectors of its root FS, but it does find all the the partitions, and the right filesystem(s) in /dev/vnd0d: First from the

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-11 Thread Michael van Elst
wo...@planix.ca ("Greg A. Woods") writes: > dg->dg_secperunit = > ((vnd->sc_size * DEV_BSIZE) + DEV_BSIZE - 1) / > vnd->sc_geom.vng_secsize; @@ -2104,11 +2108,12 @@ static void vnd_set_geometry(struct vnd_softc *vnd) { struct disk_geom *dg = >sc_dkdev.dk_geom;

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-11 Thread Greg A. Woods
At Sun, 11 Apr 2021 16:06:27 - (UTC), mlel...@serpens.de (Michael van Elst) wrote: Subject: Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!) > > k...@munnari.oz.au (Robert Elz) writes: > > >Date:Sun, 11 Apr 2021

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-11 Thread Michael van Elst
jaromir.dole...@gmail.com (=?UTF-8?B?SmFyb23DrXIgRG9sZcSNZWs=?=) writes: >Le dim. 11 avr. 2021 =C3=A0 17:51, Robert Elz a =C3=A9c= >rit : >> >> Date:Sun, 11 Apr 2021 14:25:40 - (UTC) >> From:mlel...@serpens.de (Michael van Elst) >> Message-ID: >> >> | +

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-11 Thread Michael van Elst
k...@munnari.oz.au (Robert Elz) writes: >Date:Sun, 11 Apr 2021 14:25:40 - (UTC) >From:mlel...@serpens.de (Michael van Elst) >Message-ID: > | + dg->dg_secperunit = vnd->sc_size / DEV_BSIZE; >While it shouldn't make any difference for any properly created

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-11 Thread Jaromír Doleček
Le dim. 11 avr. 2021 à 17:51, Robert Elz a écrit : > > Date:Sun, 11 Apr 2021 14:25:40 - (UTC) > From:mlel...@serpens.de (Michael van Elst) > Message-ID: > > | + dg->dg_secperunit = vnd->sc_size / DEV_BSIZE; > > While it shouldn't make any difference for

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-11 Thread Robert Elz
Date:Sun, 11 Apr 2021 14:25:40 - (UTC) From:mlel...@serpens.de (Michael van Elst) Message-ID: | Seems to have been introduced with netbsd-7. Perhaps, but the effect was probably invisible until Jan this year when the calculation of ncylinders was corrected -

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-11 Thread Robert Elz
Date:Sun, 11 Apr 2021 14:25:40 - (UTC) From:mlel...@serpens.de (Michael van Elst) Message-ID: | + dg->dg_secperunit = vnd->sc_size / DEV_BSIZE; While it shouldn't make any difference for any properly created image file, make it be

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-11 Thread Robert Elz
Date:Sun, 11 Apr 2021 15:53:07 +0200 From:Manuel Bouyer Message-ID: | On Sun, Apr 11, 2021 at 01:28:46PM -, Michael van Elst wrote: | > vnd computes a fake geometry based on 1MB cylinders. | | Why does this trucates the total number of sectors of the vnd

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-11 Thread Michael van Elst
bou...@antioche.eu.org (Manuel Bouyer) writes: >On Sun, Apr 11, 2021 at 01:28:46PM -, Michael van Elst wrote: >> bou...@antioche.eu.org (Manuel Bouyer) writes: >> >> >The size of the disk is indeed 790528 in the xenstore (and the dom0's >> >kernel message) but I don't know where this comes

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-11 Thread Manuel Bouyer
On Sun, Apr 11, 2021 at 01:28:46PM -, Michael van Elst wrote: > bou...@antioche.eu.org (Manuel Bouyer) writes: > > >The size of the disk is indeed 790528 in the xenstore (and the dom0's > >kernel message) but I don't know where this comes from. > > >The file is definitively 791121 sectors

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-11 Thread Michael van Elst
bou...@antioche.eu.org (Manuel Bouyer) writes: >The size of the disk is indeed 790528 in the xenstore (and the dom0's >kernel message) but I don't know where this comes from. >The file is definitively 791121 sectors long: vnd computes a fake geometry based on 1MB cylinders. 791121 truncated to

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-11 Thread Manuel Bouyer
On Sat, Apr 10, 2021 at 03:17:35PM -0700, Greg A. Woods wrote: > [...] > # fdisk -F /images/FreeBSD-12.2-RELEASE-amd64-mini-memstick.img > Disk: /images/FreeBSD-12.2-RELEASE-amd64-mini-memstick.img > NetBSD disklabel disk geometry: > cylinders: 49, heads: 255, sectors/track: 63 (16065

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-11 Thread Michael van Elst
wo...@planix.ca ("Greg A. Woods") writes: >I'm thinking (esp. given what I see from "od -c < /dev/rvnd0d") that >what's wrong is the vnd(4) driver is (also?) imposing some >mis-interpreted idea about the number of cylinders and heads or >something like that, especially given that "fdisk vnd0" is

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-10 Thread Greg A. Woods
On the other hand NetBSD's own .img files work OK. However interestingly there's a small, but apparently insignificant (because it works OK) difference between how fdisk sees the disk image and the vnd0 device: # fdisk -F images/NetBSD-9.99.81-amd64-live.img Disk:

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-10 Thread Greg A. Woods
At Sat, 10 Apr 2021 18:44:32 -0700, Brian Buhrow wrote: Subject: Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!) > > hello. This must be some kind of regression that's ben around a > while. I'm runing a xen dom0 with N

Re: I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-10 Thread Brian Buhrow
hello. This must be some kind of regression that's ben around a while. I'm runing a xen dom0 with NetBSD-5.2 and xen-3.3.2, very old, but vnd(4) does expose the entire file to the domu's including FreeBSD 11 and 12 without any corruption or booting issues. Do you know when this

I think I've found why Xen domUs can't mount some file-backed disk images! (vnd(4) hides labels!)

2021-04-10 Thread Greg A. Woods
I think I've found why Xen domUs can't mount some file-backed disk images! This realization must have come to my unconscious as I was sleeping, since just as I awoke I realised what must be happening. The clue I needed was from back in the early March discussion with Michael van Elst about