Need help trying to recompile kernel with EBR functionality

Polytropon freebsd at edvax.de
Wed Jan 1 15:39:59 UTC 2020


On Wed, 01 Jan 2020 06:19:33 +0000, Thomas Mueller wrote:
> > I am a long time user of FreeBSD but have never recompiled my kernel.
> 
> 
> > I am trying to compile a custom 12.1 amd64 kernel with the ability
> > to add/delete EBR partitions, but the online documentation did not
> > help and I ended up losing EBR functionality entirely.
> 
> 
> > The steps I followed were as under :
> 
> 
> > 1) copied [/usr/src/sys/amd64/conf/]GENERIC as EBRKERNEL
> 
> > 2) commented out GEOM_PART_EBR_COMPAT in [/usr/src/sys/amd64/conf/]DEFAULTS

A little sidenote: Do not change that file. All your kernel
configurations should be in the kernel configuration file.
In order to deviate from the defaults, use "nooption <name>"
to disable an existing option, and (as shown correctly)
"option <name>" to add an additional one; same for "device"
and "nodevice".



> > 3) inserted 'options GEOM_PART_EBR' into my kernel configuration
> > file EBRKERNEL
> 
> > 4) cd /usr/src
> 
> > 5) make buildkernel KERNCONF=EBRKERNEL
> 
> > 6) make installkernel KERNCONF=EBRKERNEL
> 
> 
> > When I shutdown the system and rebooted into the new kernel, the
> > boot process halted complaining that it could find any device
> > /dev/ada0s5 (the EBR partition).
> 
> 
> > What am I doing wrong ? Any help in getting me a good custom kernel
> > with the ability to add/delete EBR partitions would be greatly appreciated.
> 
> > Thank you & Regards,
> > Manish Jain
> 
> I am rather confused here.  My first inclination would be to suggest
> you switch to GPT.

This often is not an option for multi-OS settings because it
lacks boot selection (through FreeBSD's boot manager), and
the support across different operating systems (for example,
read partition of of OS 1 from OS 2) sometimes causes trouble
when GPT is involved.



> Using MBR, you get up to 4 partitions, of which one may be
> an extended boot record.  That partition is a container for
> logical-partition data, not a partition that can be mounted
> or copied to or from.

The "DOS extended partition" (which contains "logical volumes")
is not to be addressed directly; instead the "logical volumes"
inside it are. And that's completely okay for non-bootable
partitions (such as data partitions). So basically there are
3 "DOS primary partitions" (bootable - 3 systems), one "slot"
for the "DOS extended partition", and inside it, any further
partitions needed, for example shared /home partitions for
Linux.

FreeBSD itself does not need any of this. ;-)



> It seems to me the EBR partition would be s1, s2, s3, or s4
> but no higher.  I'd need to see your full partition table
> data, such as you get with "fdisk -lu" in Linux, or you can
> use gpart with "show" in FreeBSD.

If I remember the numbering system correctly, s1 - s4 are
reserved for "DOS primary partitions" - slices. The "logical
volumes" as well as the "DOS extended partition" containing
them have a higher "s value".



> Maybe you have the wrong partition name (ada0s5)?  You can
> go to the loader prompt and get a rough idea of what's in
> the partitions, and change the root partition to boot into.

So if ada0s5 is the "DOS extended partition", it's absolutely
understandable that no partition (read: slice) can be found.
I think the problem here is that the number is wrong. It's
worth verifying the correct numbers with gpart. The "logical
volumes" that need to be addressed (as a "slice equivalent")
then probably should be ada0s6 and so on.



> I have created logical partitions with Linux fdisk but never
> any BSD fdisk.  I believe there is a linuxfdisk in FreeBSD
> ports, category would be sysutils to the best of my memory.

In the past, I used FreeBSD's ye olde fdisk for partition
creation, it worked, but the common suggestion was to use
the OS that would be _using_ the partition for initializing
it, and adding the required file systems. WIth goart, however,
this should basically work.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list