LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 02-28-2021, 05:41 AM   #1
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,117

Rep: Reputation: 43
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.

Last edited by rng; 02-28-2021 at 05:58 AM.
 
Old 02-28-2021, 12:52 PM   #2
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Posts: 4,177

Rep: Reputation: Disabled
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.

Last edited by fatmac; 02-28-2021 at 12:53 PM.
 
Old 03-13-2021, 11:37 AM   #3
Gad
Member
 
Registered: May 2013
Distribution: FreeBSD 12.2-RELEASE
Posts: 566

Rep: Reputation: 114Reputation: 114
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

Last edited by Gad; 03-13-2021 at 11:40 AM.
 
Old 03-13-2021, 12:11 PM   #4
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,117

Original Poster
Rep: Reputation: 43
Quote:
Originally Posted by Gad View Post
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!
 
Old 03-15-2021, 08:36 PM   #5
MattMadness
LQ Newbie
 
Registered: Aug 2020
Location: New York
Distribution: Arch Linux
Posts: 14

Rep: Reputation: Disabled
Quote:
Originally Posted by rng View Post
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
 
Old 03-16-2021, 06:26 AM   #6
cynwulf
Senior Member
 
Registered: Apr 2005
Location: Walsall, UK
Posts: 2,631
Blog Entries: 7

Rep: Reputation: 2151Reputation: 2151Reputation: 2151Reputation: 2151Reputation: 2151Reputation: 2151Reputation: 2151Reputation: 2151Reputation: 2151Reputation: 2151Reputation: 2151
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 View Post
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.

Last edited by cynwulf; 03-16-2021 at 06:28 AM.
 
  


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: Chakra Linux: Its Own Beast, Its Own Beauty LXer Syndicated Linux News 0 08-18-2017 05:42 PM
LXer: Microsoft has created its own FreeBSD. Repeat. Microsoft has created its own FreeBSD LXer Syndicated Linux News 0 06-09-2016 11:42 AM
LXer: Microsoft has developed its own Linux. Repeat. Microsoft has developed its own Linux LXer Syndicated Linux News 0 09-18-2015 04:51 PM
LXer: Mozilla picks one of its own to be its new CEO LXer Syndicated Linux News 0 07-28-2014 11:11 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 01:17 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