svn commit: r264378 - head/sys/geom/part

Ian Lepore ian at freebsd.org
Tue Oct 9 14:19:28 UTC 2018


On Tue, 2018-10-09 at 07:33 -0600, Warner Losh wrote:
> On Tue, Oct 9, 2018 at 2:41 AM Andrey V. Elsukov <bu7cher at yandex.ru>
> wrote:
> 
> > 
> > On 08.10.2018 19:46, John Baldwin wrote:
> > > 
> > > This needs a way to be overridden.  If you have a machine
> > > installed with
> > a
> > > 
> > > layout created prior to this change (e.g. a zpool mirror or RAID
> > > or some
> > > other mirror or RAID), you can no longer create a matching
> > > partition
> > since
> > > 
> > > the starting sector is now always 40 instead of 34 and the
> > > partition size
> > > won't match.  Also, while we may want to create sane layouts by
> > > default,
> > we
> > > 
> > > should probably always provide a way to create less-sane layouts
> > > that are
> > > still conformant to the spec.  I do wonder if this kind of
> > > default
> > > preference shouldn't belong in the userspace gpart tool rather
> > > than the
> > > kernel and the kernel should create any compliant layout as
> > > requested by
> > > userland instead.
> > > 
> > > jpaetzel@ just ran into this case where he can't replace a failed
> > > disk
> > in a
> > > 
> > > system running 12 that was first formatted on 10, so it's not
> > > academic.
> > As a workaround you can try to copy first 34 sectors from old disk
> > to
> > new using dd(1). And then use `gpart recover`. I think this should
> > work.
> > 
> Clever hack, but we shouldn't need crazy stuff like this....
> 
> Yes. This absolutely needs to be in userland, under user control. The
> rounding should *ALWAYS* be optional. The reported geometry that the
> code
> bases the 'rounding' on is bogus often times, and not invariant. I've
> fought with this misfeature since I was making CF images on a USB
> adapter
> that never had the right geometry for the system it was deployed
> into. It's
> silly.
> 
> Warner

While we're at it, kern.geom.part.mbr.enforce_chs is another thing that
needs to be controllable on a per-invocation (of gpart) basis, not as a
system-wide setting.

-- Ian



More information about the svn-src-all mailing list