Date: Tue, 18 Jan 2011 17:49:52 +0100 From: Ivan Voras <ivoras@freebsd.org> To: Lev Serebryakov <lev@serebryakov.spb.ru> Cc: freebsd-geom@freebsd.org Subject: Re: Broken gmirror: why /dev/ufs is empty when geom_mirror is not loaded? Message-ID: <AANLkTinUjN70FsVApYjP=bLu1W9vb0DaNLvLs%2BX2N=CH@mail.gmail.com> In-Reply-To: <1211987575.20110117170902@serebryakov.spb.ru> References: <1686083494.20110113182418@serebryakov.spb.ru> <1811347380.20110113213700@serebryakov.spb.ru> <ih1ga3$tdv$1@dough.gmane.org> <234432652.20110117163922@serebryakov.spb.ru> <ih1h86$1t3$1@dough.gmane.org> <1211987575.20110117170902@serebryakov.spb.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
On 17 January 2011 15:09, Lev Serebryakov <lev@serebryakov.spb.ru> wrote: > Let imagine /dev/ad0s1a and /dev/ad1s1a both have, say, 1024 > sectors. They are mirrored as "mirror/rootfs". It should have size > 1023 sectors, am I right? 1 sector is spent on metadata and can not be > accessed via /dev/mirror/gm0. > > UFS2 is created on /dev/mirror/gm0, with volume label "rootfs" > so it records file system size as "1023 sectors", Ok? Well... it depends. As I see it, the UFS file system size is calculated based on block size, so the actual size would not be 1024, but 1024-32 or something like that, which brings me to the next point... > When geom_mirror is loaded and "win" tasting of ad?s1a, geom_label > reads label from /dev/mirror/gm0 and shows proper > "/dev/ufs/rootfs" and "/dev/ufsid/whatever" with proper sizes "1023 > sectors". > > When geom_mirror is not loaded, but geom_label is, now it will not > show "/dev/ufs/rootfs" because ad?s1a.size != rootf.size, am I right? > > If change geom_label to create labels in such cases (simply remove > sizes check in current code), there will be problem with geom_mirror > loaded AFTER geom_label -- it could pickup mirror component via > label, not via device itself. > > But if we remove this check AND change geom_label in such way, as > it will create provider based on UFS size (not underlying provider > size), it will work always. When there is no geom_mirror labels will > be created but it will be impossible to pickup such label as > component of mirror, because label-provider will not contain mirror > metadata. I don't think this is a general enough solution. Other file systems than UFS may not record file system size at all, or maybe record it even more inprecisely than UFS. Additionally, glabel would have to be restructured a bit to support that. > And there is one more problem: it is almost always possible to > create mirror AFTER file system (add mirror to existing installation > without re-creating FSes), but it will have incorrect FS size in > metadata and here is no way to "shrink" FS even with one sector. And, > yes, it such case current geom_label implementation will create > labels from mirror components (size check will be passed), and allows > geom_mirror to use labels as components. Complete mess :( And > creation mirror on live system looks like useful feature. I think this would be solved by my other proposal :)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTinUjN70FsVApYjP=bLu1W9vb0DaNLvLs%2BX2N=CH>
