LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (https://www.linuxquestions.org/questions/%2Absd-17/)
-   -   How to install FreeBSD on its own partition (https://www.linuxquestions.org/questions/%2Absd-17/how-to-install-freebsd-on-its-own-partition-4175691304/)

rng 02-28-2021 05:41 AM

How to install FreeBSD on its own partition
 
I have recently tried FreeBSD in VirtualBox, where one whole virtual disk was provided for its installation. It is working very well there with XFCE4 desktop. Now I want to make a real install on my hard disk which has following partitioning scheme:

https://imgur.com/T14U9YX

However, on my desktop hard disk, I have a total of 4 partitions. I have one partition with Windows and another with Linux installed on it. I have grub installed in MBR from Linux and I can boot to either OS from its menu at startup.

I have 2 more partitions which are free, one is primary (P3 in above figure) and other is extended (P4 in above figure). Is it possible to install FreeBSD to one of these free partitions only, without the need to use whole disk? For booting, I can update grub from Linux partition and I think it will find FreeBSD partition and put it in its menu. I tried to check on the internet but could not find simple instructions for this process. Also, FreeBSD instructions talk about 'slice' also and its relation with partition is not clear to me. Thanks for your help.

fatmac 02-28-2021 12:52 PM

Not sure if you can add it to your disk, but, a partition is a slice in BSD talk, & partitions are segments of that slice - kind of like your extended partition that can hold more than one more 'partition'.

If you can install it into your waiting partition, you should indeed be able to chain load it from grub.
(I think you will need its boot loader installed into its 'slice' for it to work.)

Might be worth looking through the FreeBSD documentation for confirmation, it's very good.

Gad 03-13-2021 11:37 AM

A traditional Master Boot Record (MBR) holds a partition table defining up to four primary partitions. For historical reasons, FreeBSD calls these primary partition slices.

ada0s1a - The first partition (a) on the first slice (s1) on the first SATA disk (ada0).

Its also another possibility your FreeBSD boot manager will overwrite any other boot manager you have installed.

You can reconfigure the boot manager by using the following command

Code:

boot0cfg -B ada0
Replacing ada0 with your actual hard drive as listed under /dev/

Otherwise to boot FreeBSD using GRUB, add the following to either /boot/grub/menu.lst or /boot/grub/grub.conf, depending upon which is used by the Linux distribution.

But yes I agree, its best to consult the official documentation and ensure you have a verified backup

rng 03-13-2021 12:11 PM

Quote:

Originally Posted by Gad (Post 6230034)
Otherwise to boot FreeBSD using GRUB, add the following to either /boot/grub/menu.lst or /boot/grub/grub.conf, depending upon which is used by the Linux distribution.

But yes I agree, its best to consult the official documentation and ensure you have a verified backup

I think you forgot to write what needs to be added to menu.lst or grub.cfg file!

MattMadness 03-15-2021 08:36 PM

Quote:

Originally Posted by rng (Post 6230047)
I think you forgot to write what needs to be added to menu.lst or grub.cfg file!

http://unix.stackexchange.com/questi...272/ddg#109278

cynwulf 03-16-2021 06:26 AM

The correct way to do this, for "peaceful coexistence", is to configure the grub bootloader from the Linux installation to boot using either the kFreeBSD stanzas or by chainloading. I suggest that you search the FreeBSD forums for this and you will likely find hundreds, if not thousands, of hits.
Quote:

Originally Posted by Gad (Post 6230034)
A traditional Master Boot Record (MBR) holds a partition table defining up to four primary partitions. For historical reasons, FreeBSD calls these primary partition slices. [1]

ada0s1a - The first partition (a) on the first slice (s1) on the first SATA disk (ada0).

Its also another possibility your FreeBSD boot manager will overwrite any other boot manager you have installed.

You can reconfigure the boot manager by using the following command

Code:

boot0cfg -B ada0
Replacing ada0 with your actual hard drive as listed under /dev/

Otherwise to boot FreeBSD using GRUB, add the following to either /boot/grub/menu.lst or /boot/grub/grub.conf, depending upon which is used by the Linux distribution. [2]

But yes I agree, its best to consult the official documentation and ensure you have a verified backup

It's always good to cite your sources:
[1] https://docs.freebsd.org/en/books/ha...bsdinstall-pre
[2] https://docs.freebsd.org/en/books/fa...ml#idp49037688

If the OP installs in the extended DOS partition, then last time I checked boot0cfg(8) doesn't support this.

They will also replace the bootcode on that device with boot0 and possibly render the other installed OS' unbootable.
Quote:

-B Install the 'boot0' boot manager. This option causes MBR code to be replaced, without affecting the embedded slice table.


All times are GMT -5. The time now is 06:05 PM.