LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-06-2020, 01:13 PM   #1
tramni1980
Member
 
Registered: Jul 2006
Location: Köln, Germany
Distribution: Slackware64-14.2 & -current, DragonFly BSD, OpenBSD
Posts: 819

Rep: Reputation: 55
Multiboot of Slackware Linux with DragonFly BSD and OpenBSD on UEFI


Dear all,

multiboot installation of a BSD system with other operating systems
(OSs) on UEFI hardware is not officially supported by any of the popular
BSDs. Because of the general interest in this topic, here I would like
to share my experience of running DragonFly BSD, OpenBSD, and Slackware
Linux on an UEFI ASUS laptop. The only boot manager you need is
rEFInd.

Preliminaries

As each OS is going to reside on its own hard drive slice,
the first step of setting your system for multiboot is slicing the hard
drive. In general, if you want to multiboot n OSs, you would need n + 1
slices. The extra slice is for the EFI system partition (ESP). Of
course, you have to make sure each partition is large enough for the OS that is
going to reside on it. As mentioned, in this post I share my experience
with installing DragonFly, OpenBSD, and Slackware Linux. I sliced the hard
drive from DragonFly, which I have exemplarily described in the
DragonFly documentation on multiboot. Of course, you will slice the hard drive from the first OS that you are going
to install. In the above link to the DragonFly documentation, I have also
described how the ESP is to be set up. The installation of OpenBSD is described
in this post. Therefore, in the following I assume your first OS has already been installed
in its slice, rEFInd has been installed in the ESP, and I only consider the
specifics of the Slackware installation.

Installation of Slackware Linux

After booting with the installation media, use gdisk make the Linux partition
of type 8300 or 8e00 in case you use LVM. After creating your LVM partitions,
you can type setup and proceed with the Slackware installation. Install
neither lilo nor elilo. At the end of the installation do not reboot but
change to shell. Chroot to /mnt, create the initrd image, mount the ESP, create
a Slackware directory under EFI/BOOT in the ESP and copy the generic-kernel
image and the initrd to EFI/BOOT/Slackware. Assuming the Slackware partition is
nvme0n1p4 as on my system, run

Code:
blkid nvme0n1p4
to obtain the UUID and PARTUUID. These are to be used at the
'volume' and 'options' entries of refind.conf, respectively.
Add the following entry to refind.conf:

Code:
menuentry "Slackware" {
  icon /EFI/BOOT/icons/os_slackware.png
  volume the-UUID-from-blkid
  loader /EFI/BOOT/Slackware/vmlinuz-generic-kernel_version
  options "ro root=PARTUUID=the-PARTUUID-from-blkid"
  initrd /EFI/BOOT/Slackware/initrd-kernel_version.gz
}
Reboot and have fun!

Best regards,

Martin
 
Old 06-06-2020, 01:17 PM   #2
hitest
Guru
 
Registered: Mar 2004
Location: Canada
Distribution: Void, Debian, Slackware
Posts: 7,342

Rep: Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746Reputation: 3746
Cool

Very cool! Thanks for sharing.
 
Old 06-06-2020, 06:03 PM   #3
Regnad Kcin
Member
 
Registered: Jan 2014
Location: Beijing
Distribution: Slackware 64 -current .
Posts: 663

Rep: Reputation: 460Reputation: 460Reputation: 460Reputation: 460Reputation: 460
Quote:
The only boot manager you need is
rEFInd.
It's the only one I need.
 
Old 06-06-2020, 08:58 PM   #4
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,440
Blog Entries: 7

Rep: Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551
Quote:
Originally Posted by tramni1980 View Post
I sliced the hard drive from DragonFly, which I have exemplarily described in the
DragonFly documentation on multiboot. Of course, you will slice the hard drive from the first OS that you are going to install. In the above link to the DragonFly documentation, I have also described how the ESP is to be set up. The installation of OpenBSD is described
in this post. Therefore, in the following I assume your first OS has already been installed in its slice, rEFInd has been installed in the ESP, and I only consider the specifics of the Slackware installation.
Many thanks for your efforts in this area.

I've been following DragonFlyBSD for the past few years, but have only ever tried it in a Virtualbox VM.

Those instructions for manual installation are most welcome, and will be studied inside & out as I try to wrap my head around the process.

The laptop I'm installing it on already has rEFInd on it, dual booting Windows and Slackware Linux. At this point, I could probably ditch Windows since I never use it, but it isn't taking that much space and it might serve some purpose one day.

After shrinking the Windows partition back when I first bought the laptop, I set up more partitions than necessary with the thought that one of them would house a *BSD one day... and that day looks like it's here.

Given that the EFI partition is already set up, and the spare partition is ready to use I gather it's a matter of tweaking these instructions:
Quote:
Create the DragonFly slice of, say 200 GiB:

# gpt -v show nvme0 gpt add -i 1 -s 419430400 -t dfly nvme0

Label the DragonFly slice:

# gpt label -i 1 -l "DragonFly BSD" nvme0

Now you can create your disklabel partitions on the DragonFly slice. Normally, you want a disk layout consisting of an "a" partition for /boot, a "b" partition for swap and a "d" partition for the root file system.
Is it simply a matter of:
1. changing the partition/slice type
2. labelling the DragonFly slice
3. creating the disklabel and then following the rest of the instructions.

Can I use the gpt command to change the partition/slice type to "dfly"?

To label the slice, would I need to modify the command above by changing 'nvme0' to something like 'nvme0s3'?

I greatly appreciate any comments, hits & tips.
 
Old 06-07-2020, 01:06 AM   #5
tramni1980
Member
 
Registered: Jul 2006
Location: Köln, Germany
Distribution: Slackware64-14.2 & -current, DragonFly BSD, OpenBSD
Posts: 819

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by rkelsen View Post
The laptop I'm installing it on already has rEFInd on it, dual booting Windows and Slackware Linux. At this point, I could probably ditch Windows since I never use it, but it isn't taking that much space and it might serve some purpose one day.

After shrinking the Windows partition back when I first bought the laptop, I set up more partitions than necessary with the thought that one of them would house a *BSD one day... and that day looks like it's here.

Given that the EFI partition is already set up, and the spare partition is ready to use I gather it's a matter of tweaking these instructions:

Is it simply a matter of:
1. changing the partition/slice type
2. labelling the DragonFly slice
3. creating the disklabel and then following the rest of the instructions.
Exactly. But your ESP is still not completely set up, you need to copy the DragonFly BSD's boot code (/boot/boot1.efi ) to the EFI/BOOT under your ESP as described in the DragonFly documentation and add a DragonFly BSD entry to refind.conf.
I would also like to note that while one can slice the hard drive from one OS to prepare the slices for the other OSs, setting the slice type for each OS may have to be done later from that OS. For example, from DragonFly BSD it is not possible to set the slice type of the OpenBSD partition to A6; you have to do that from OpenBSD after booting the OpenBSD install medium; from Slackware's gdisk it might be possible to set a slice type to A6 for OpenBSD or dfly for DragonFly, but I do not know. With DragonFly BSD, so long as I know, there is no way to change the slice type after the slice has been created. Therefore, just leave some space for your DragonFly slice. Then, after booting the DragonFly install medium, create the slice with type dfly. For example, if
Code:
gpt -v show -l nvme0
shows you already have slices 0 (ESP), 1 (Windows), and 2 (Slackware), then you should create a slice with number 3 for DragonFly like this:

Code:
gpt add -i 3 -s 419430400 -t dfly nvme0
gpt label -i 3 -l "DragonFly BSD" nvme0
Quote:
Originally Posted by rkelsen View Post
Can I use the gpt command to change the partition/slice type to "dfly"?
As I mentioned above, so long as I know you cannot change the type of an existing slice in DragonFly. You will have to either create a new slice for DragonFly using the DragonFly install medium or delete the existing slice and create it again with the desired type. Actually, for DragonFly I think setting the slice type to dfly is not crucial when installing manually. Maybe you can just skip setting the slice type and proceed making the disklabel partitions. However, I have not tested this. You are welcome to try and share your experience with us :-).

Quote:
Originally Posted by rkelsen View Post
To label the slice, would I need to modify the command above by changing 'nvme0' to something like 'nvme0s3'?
No, no. nvme0 is just a parameter to gpt that points to the hard drive whose slices are being edited. It is the -i parameter that specifies which slice gpt has to modify. So, if you want to label slice number 3 on nvme0, you should issue

Code:
gpt label -i 3 -l "DragonFly BSD" nvme0
nvme0s3 is the third slice on the nvme0 drive. The gpt command needs nvme0 supplied as disk drive parameter and slice number 3 supplied via the -i parameter.

Quote:
Originally Posted by rkelsen View Post
I greatly appreciate any comments, hits & tips.
You are welcome.

Cheers,
Martin

Last edited by tramni1980; 06-07-2020 at 06:15 AM.
 
1 members found this post helpful.
Old 06-07-2020, 02:28 AM   #6
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,440
Blog Entries: 7

Rep: Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551
Thank you sir! I'll have a go at some point over the next week or so and will report back.
 
Old 06-07-2020, 12:31 PM   #7
tramni1980
Member
 
Registered: Jul 2006
Location: Köln, Germany
Distribution: Slackware64-14.2 & -current, DragonFly BSD, OpenBSD
Posts: 819

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by rkelsen View Post
Thank you sir! I'll have a go at some point over the next week or so and will report back.
Wow, "sir" :-) No need to be that formal I come from Eastern Europe and we don't have such titles there ;-)

I would be happy to get your feedback.

Cheers,
Martin
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Wine, Mozilla, GNOME and DragonFly BSD LXer Syndicated Linux News 0 01-19-2018 01:36 PM
UEFI multibooting: FreeBSD and DragonFly BSD spacelander *BSD 9 08-25-2016 02:42 PM
LXer: DragonFly BSD 4.4.2 Released with OpenSSL 1.0.1r and Kernel Quirks for xHCI USB LXer Syndicated Linux News 0 02-17-2016 12:53 AM
LXer: DragonFly BSD 4.2 Gets Improvements for i915 and Radeon, Moves to GCC 5 LXer Syndicated Linux News 0 06-29-2015 10:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration