From owner-freebsd-questions@freebsd.org Wed Jan 1 16:57:46 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6211B1DA6DA for ; Wed, 1 Jan 2020 16:57:46 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47ny5j2sH7z4788 for ; Wed, 1 Jan 2020 16:57:44 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([178.5.227.248]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPA (Nemesis) id 1MsZif-1jbtx62EAt-00tzZk; Wed, 01 Jan 2020 17:57:35 +0100 Date: Wed, 1 Jan 2020 17:57:34 +0100 From: Polytropon To: Manish Jain Cc: Thomas Mueller , "freebsd-questions@freebsd.org" Subject: Re: Need help trying to recompile kernel with EBR functionality Message-Id: <20200101175734.2e5c66ba.freebsd@edvax.de> In-Reply-To: References: <202001011526.001FQUeA001903@r56.edvax.de> <20200101163902.60776151.freebsd@edvax.de> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:B3BhXbH5cOMx1uyvPSZAICsJXTwT613F1PLO9rgGM1xz1l85Zx/ vJgFY40yzbQ+IvLB9eKJVFbxakN7UQQGdNoLHEMN99ETsVTNrAASBWRP8d9ULATFjblk9S+ Ag+hDJNQdHQBen074doZW1QsvSZiYI2/eMv4ZPQScKSvpYWWKT4fAZJj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entication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@edvax.de has no SPF policy when checking 212.227.17.24) smtp.mailfrom=freebsd@edvax.de X-Spamd-Result: default: False [3.85 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; FREEMAIL_TO(0.00)[hotmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[248.227.5.178.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.57)[0.567,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.75)[0.747,0]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[24.17.227.212.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[24.17.227.212.rep.mailspike.net : 127.0.0.17]; FREEMAIL_CC(0.00)[twc.com]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE(0.14)[ip: (-0.35), ipnet: 212.227.0.0/16(-1.17), asn: 8560(2.23), country: DE(-0.02)] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jan 2020 16:57:46 -0000 On Wed, 1 Jan 2020 15:50:05 +0000, Manish Jain wrote: > > On 2020-01-01 21:09, Polytropon wrote: > > 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 " > > to disable an existing option, and (as shown correctly) > > "option " 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. > > > > > > > > Thomas's idea worked. sysutils/linuxfdisk is able to create/delete > logical volumes > > under FreeBSD, when FreeBSD gpart itself cannot. That's why tools like GPartEd (for example on the UBCD) are a much better solution that what FreeBSD includes natively. It would be nice to have that Linux-specific functionality implemented in FreeBSD's stock gpart, so all steps of disk initialization can be done with FreeBSD (and scripted). > And I completely agree with Polytropon that boot0 is much better for > multi-OS systems, but boot0 works only on MBR - which is why I never use > GPT. Definitely. It's simple and predictable, doesn't require any maintenance (like GRUB), and works with everything that is MBR-based. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...