# Switching from Arch to FreeBSD



## developer11 (Dec 27, 2014)

Long time Arch Linux user. Just want to try something new. No - I do not want Ubuntu (or any of its derivatives). I just want something more...... challenging than Arch. I don't want Gentoo as it's not usable. I've selected FreeBSD, and I have some questions before I even download its ISO installer.

a) is there a live version so I can see what it's like before installing?
b) can I make dualboot FreeBSD<>Arch?
c) is the directory structure much different from the Linux one (home, docs etc)?
d) is FreeBSD using kernels from Linux or custom (specially designed) ones?
e) is it meta or binary OS?
f) how 'rich' are its repo(s)?
g) how often does it get updates?
h) does it support UEFI/standard BIOS?
i) is it possible that FreeBSD reads and 'adopts' Arch /home partition (I mean will all the docs be editable, scripts runnable etc) or do I have to make separate /home just for FreeBSD?

I'd be grateful for any more advice you share with me....


----------



## uzsolt (Dec 27, 2014)

a) As far as I know there isn't a live version
b) Yes, you can use grub.
c) Check hier(7)!
d) FreeBSD uses FreeBSD kernel.
e) Check handbook.
f) The binary repo contains binary packages from almost every ports.
g) Check Release Information.
i) It depends on filesystem. You can easily read and write ZFS in FreeBSD and ArchLinux too. If you've ext4 you can't write it on FreeBSD.


----------



## srobert (Dec 27, 2014)

a) For a live version you could try GhostBSD.  It will usually run from a USB Stick or CDROM.
c) One notable difference between Linux and FreeBSD directory structure is that the base of the operating system installs under the root directory /, while applications install under /usr/local
i) Quite a while back, I attempted to share a home directory between Linux and FreeBSD on a dual boot system through ZFS.  But differences in the ZFS versions made it difficult at that time. Perhaps that has changed.


----------



## scottro (Dec 27, 2014)

And, my own versions, because it's Saturday, and my lovely wife is working.

a) The installation image gives you the option to have a live shell, so you can at least see what hardware of yours will work, but there's no GUI liveCDS. There is, as was mentioned, GhostBSD.

b) It's easy to dualboot, there's various pages about it, I have one of my own http://srobb.net/grub2.html.  In a nutshell, you have Arch's grub point to the FreeBSD partition with chainloader.

c) Structure isn't DRASTICALLY different, but FreeBSD will put many things in /usr/local rather than /usr.  Actually, isn't Linux generally skipping /usr entirely these days?  I've lost track.  Anyway, freshly installed programs will be in /usr/local/bin, rather than more typical Linux placement of /usr/bin and /bin.

d) Kernel question has been answered, it doesn't use a Linux kernel.

e) What do you mean meta? If you mean source vs. binary, you can use either.   Mixing can cause problems, but often people mix successfully.

f) Unless you're looking for something pretty obscure, you should be able to find a package or a port.

g) Frequently.  One big difference is that ports and the base system are two different things and are updated separately.  There is also a nice thing called UPDATING, for both ports and the system, which almost always has, in one place, the things that a user must watch if updating.

h) I think so. I've only used it on standard BIOS, so never checked, but I suspect that one is a very quick google.

i) As was said, depends upon file system.  FreeBSD can mount some Linux systems, but as I haven't made use of that in a long time, I don't know the specifics.

The documentation is pretty good, equal, and sometimes better than the Arch Wiki.


----------



## wblock@ (Dec 27, 2014)

PC-BSD has a live version with several X desktops.  The FreeBSD installer disks or USB sticks also have a live version, but you must realize that FreeBSD does not have X in the base install, so this is mostly just a shell.

Dual booting is possible, but consider using VirtualBox instead, so you can use one operating system to look up things on the web while the other is running at the same time.

FreeBSD is not a Linux variant at all, so it does not use Linux kernels.  We have our own.

I don't understand what the "meta or binary" question is asking.  Source or binary?  But all operating systems are built from source...

Update rate depends on which one you pick.  -CURRENT, daily.  -STABLE, sometimes very often.  -RELEASE: only for security and important bug fixes.  The ports tree (applications) is separate from the base, and is updated constantly.

UEFI support is new and probably not well tested yet.

A shared /home can be done, but there are difficulties.  The filesystem is one thing.  FreeBSD can run some Linux executables also.  Linux usually pretends that sh(1) is bash, but those are not the same in FreeBSD.  Of course, bash can be installed from a port.  Plain data files interchange well.  Some people use NFS for shared directories, keeping them on a NAS like FreeNAS.


----------



## scottro (Dec 27, 2014)

wblock@, does the most recent PC-BSD version have a live version?  Last I looked, it didn't.  I believe the 9.x version has a live system though, and to the OP, that can also give you an idea, though.


----------



## wblock@ (Dec 27, 2014)

scottro, it's been a while since I tried it, and that might have gone away.


----------



## Oko (Dec 28, 2014)

developer11 said:


> Long time Arch Linux user. Just want to try something new. No - I do not want Ubuntu (or any of its derivatives). I just want something more...... challenging than Arch. I don't want Gentoo as it's not usable. I've selected FreeBSD, and I have some questions before I even download its ISO installer.


If there are no technical/job related reasons for switching from Arch to FreeBSD I would suggest more of your favourite outdoor activity instead of distro hopping. However I would be happy to answer your questions.



developer11 said:


> a) is there a live version so I can see what it's like before installing?


I am not sure if GhostBSD (FreeBSD desktop distro focused on UFS) comes with LiveCD installer. In the past my favourite live CD was FreeSBIE but it is no longer maintained.  There is also a system admin live CD rescue tool called Frenzy http://frenzy.org.ua/eng/



developer11 said:


> b) can I make dualboot FreeBSD<>Arch?


Sure. On another hand there are no technical reasons for dual boot. I suggest fresh air and not wasting your time in front of computers.



developer11 said:


> c) is the directory structure much different from the Linux one (home, docs etc)?


Not too much difference but there is definitely a difference. Linux != UNIX. On the another hand if Linux was a UNIX it would be classified as System V UNIX. BSDs are of course BSD type of UNIX and they are different that System V systems (like modern Solaris for example)



developer11 said:


> d) is FreeBSD using kernels from Linux or custom (specially designed) ones?


There is no relationship between any of BSDs and Linux. BSDs are separate family of pure UNIX operating systems.



developer11 said:


> e) is it meta or binary OS?


Not following the question. All BSD come with the full source code. FreeBSD does support binary updates at least in minor versions 10.0 ---> 10.1



developer11 said:


> f) how 'rich' are its repo(s)?


FreeBSD number of packages is only second to Debian. At the same time unlike Linux vendor support is almost non-existing. You will not find MATLAB or Skype for that matter.



developer11 said:


> g) how often does it get updates?


Depends what branch you are following. If you are following current you might need to do serious update several time a day. If you are using 10.1 stable for example once in a while only. These are very stable server grade production systems. Updates are done for serious reasons only.



developer11 said:


> h) does it support UEFI/standard BIOS?


10.1 is the first FreeBSD which includes experimental support for UEFI boot. However YMMV.



developer11 said:


> i) is it possible that FreeBSD reads and 'adopts' Arch /home partition (I mean will all the docs be editable, scripts runnable etc) or do I have to make separate /home just for FreeBSD?



Probably not. Arch uses some kind of Linux file system (ext2,3,4) or Silicon Graphics file system (xfs).

FreeBSD uses UNIX file system ffs or even better ZFS. Note that ZFS is an enterprise grade file system and requires enterprise grade hardware typically not used by people at home.
ZFS requires 64-bit OS (for all practical purposes). You need at least 16GB of high quality ECC RAM. PC-BSD (a desktop distro of FreeBSD) relies exclusively on ZFS and has similar requirements.

If you don't know what is ZFS than you probably don't need it.

If you are after high performance modern file system with relatively modest requirements I suggest looking at DragonFlyBSD project and HAMMER.

ZFS is "ported" on Linux but it is a big joke.


----------



## Oko (Dec 28, 2014)

scottro said:


> wblock@, does the most recent PCBSD version have a live version?  Last I looked, it didn't.  I believe the 9.x version has a live system though, and to the OP, that can also give you an idea, though.


Nope!!! They also removed all support for UNIX file system so it is very resource hungry ZFS only system. It is a fantastic distro but it is not for everyone.


----------



## scottro (Dec 28, 2014)

As far as I can tell, Frenzy is pretty old, with the last version being based on FreeBSD-8.something.  Oko told us about PC-BSD.  As srobert mentions, GhostBSD does run live. I  just tried it in VirtualBox and it seems to only have a Gnome or Gnome-ish desktop.  Mate is based on Gnome, right?  I don't use any of those so I'm fairly ignorant about them--at any rate, it had a menu you could open from the upper left.  Although people always recommend PC-BSD as an easy introduction, I wonder if Ghost might be a better choice.  Oko mentioned that PC-BSD can have fairly hefty requirements, and I remember the last time I tried to install it, it complained that I wasn't giving it 50 GB, whereas Ghost seems to run pretty easily and although still over a gig, is much smaller than PC-BSD's images.

At any rate, such discussions merits its own thread, so the  quick answer to the OP, the most recent thing with GUI live CD capabilities is GhostBSD.   Pity about both Frenzy and FreeSBIE, both were nice light weight (Fluxbox, I think, but my memory's hazy) GUIs, but GhostBSD should give some sort of idea about your hardware.


----------



## Oko (Dec 28, 2014)

scottro said:


> Pity about both Frenzy and FreeSBIE, both were nice light weight (fluxbox, I think, but my memory's hazy) GUIs, but GhostBSD should give some sort of idea about your hardware.


I apologize if I mislead you in believing that Frenzy is an active project. It is not. However it was a fantastic system admin tool. FreeSBIE default GUI was Xfce but I think you are right that the second option was Fluxbox. Around times of FreeBSD 6.2 it was rock stable. There were even FreeSBIE tools in the ports three which one could use to create his/her own LiveCD. I personally learned about Tor and Privoxy by using FreeSBIE. It supported it out of box. FreeSBIE didn't have installer though.


----------



## scottro (Dec 28, 2014)

No apology necessary, I just got my hopes up for a moment, since, like you, I really liked it.


----------



## developer11 (Dec 28, 2014)

Thanks for feedback 

I’ve installed FreeBSD as a guest-system in VirtualBox. It comes with console only. I had to install Xfce4 and it just works. My first impressions on the system? Well - much alike Arch, it needs time to switch memory to FreeBSD dir layout but I hope one day I will install FreeBSD as standalone OS.....


----------



## Oko (Dec 28, 2014)

scottro said:


> I wonder if Ghost might be a better choice.  Oko mentioned that PC-BSD can have fairly hefty requirements, and I remember the last time I tried to install it, it complained that I wasn't giving it 50 GB, whereas Ghost seems to run pretty easily and although still over a gig, is much smaller than PC-BSD's images.


I would like to clarify something for people who would be browsing forum. 50 GB HDD is just a tip of the iceberg. DragonFly/HAMMER also requires a minimum of 50 GB HDD and it is also 64-bit only OS. As a matter of fact I would very strongly recommend SSD drives possible 2 for ZFS mirror or HAMMER mirror as the installation media for both systems. I would not go into details why SSD are so much better choice for OS itself. I typically use 36GB SSDs for OS ( I found some for as little as $20 per drive over the holidays here in U.S.). Note that FreeNAS 9.3 have also switched and now uses ZFS for OS partition (it used to be UFS due to its NanoBSD heritage). For a storage pool ZFS was only choice in FreeNAS for a while now. 
Typically people will use HBO controller with at least 6 industrial grade HDD for ZFS file server or good HWRaid controller (Areca, LSI or similar) for DF storage pool. 

The real difference between FreeBSD/TrueOS/PC-BSD/FreeNAS and DragonFly is in the amount of RAM and the quality of the RAM. FreeBSD is optimized for high number of CPUs and RAM (I typically use no less than 64 GB on the file servers). DragonFly is optimized for fewer CPUs and smaller RAM even though it supports up to 256 CPUs per mother board and I personally was running DragonFly on machines with 512 GB or RAM. That is not all. ZFS really requires ECC RAM (at least 16GB) while DF will be happy with 1GB for 3-5 TB storage space. I am sure I will have few angry people now replaying to this thread and telling me that they use ZFS on the laptop with 1-2GB RAM. Good for them. I have seen many people who do that and then come crying on FreeNAS forum after the system crashes during ZFS scrubbing or de-duplication and data gets corrupted.  Just saying  I am also highly recommending the interview with Matt Dillan (BSD talk number 248)

http://bsdtalk.blogspot.com/

Enterprise storage people should pay careful attention when he talks about limitations of HAMMER which ultimately lead him to development of HAMMER 2 (In works for almost 2 years now but not even close to be production ready).  He also has interesting observations about PC-BSD which is not really average Joe desktop system but rather a monster server OS with ability to work as a UNIX workstation.


----------



## blackhaz (Dec 28, 2014)

developer11 said:


> Well - much alike Arch, it needs time to switch memory to FreeBSD dir layout but I hope one day I will install FreeBSD as standalone OS.....



The great thing about FreeBSD file system layout I appreciated after switching from Linux is that the base operating system and the user-installed applications are separated. All the user stuff, including configuration files, goes to /usr/local/ and man I must tell you, that's the best thing since flushable toilet paper rolls. You can simply remove everything user-installed and get back to a virgin OS any time. Keeps everything clean and tidy.


----------



## ANOKNUSA (Dec 28, 2014)

I used Arch for four years before switching to FreeBSD as my main OS about three weeks ago. The similarities are almost uncanny, so the switch was pretty easy. Arch is great and FreeBSD shares a lot of its characteristics, but improves upon most of them. That last point is going to be the gist of my answers. I've kept my Arch install to tinker with too, so as someone who's very familiar with Arch, new to FreeBSD and currently using both, here are the answers to your questions I've gleaned from the experience:



> a) is there a live version so I can see what it's like before installing?


Yup, in the same way there's an Arch LiveCD. It's just a live environment you can boot into via the installation image. As with Arch, playing around with a graphical LiveCD with a bunch of pre-installed stuff won't tell you anything about the OS itself, as all that graphical stuff isn't really part of the operating system. It's just extra stuff installed on top of the operating system. The separation between the base system and the extra user-installed software is much greater than the separation between Arch's [core] repository and its other repos.



> b) can I make dualboot FreeBSD<>Arch?


You can boot FreeBSD with GRUB. The FreeBSD boot menu is supposed to also detect multiple operating systems installed on the same disk, though I've never seen that since I use one OS per disk.



> c) is the directory structure much different from the Linux one (home, docs etc)?


It's very similar better. Both GNU/Linux and *BSD have a hier(7) man page; the difference is that FreeBSD (and the other BSDs, I presume) actually stick very closely to the defined structure, while the Linux FSH varies between distributions, isn't strictly kept to and the man page is out-of-date. Under FreeBSD every major directory serves a specific purpose, which makes it easy to make educated guesses about where various files are stored when you need to find them. You can still use tools like [command]find[/command] and [command]locate[/command] if you wish.



> d) is FreeBSD using kernels from Linux or custom (specially designed) ones?


FreeBSD has its own kernel. There are two differences to be aware of. First, configuring a custom kernel in FreeBSD is insanely easy. I still have a lot of love for Linux, but the tedium of configuring and building a custom kernel in Arch relative to the ease and speed of doing it under FreeBSD cannot be overlooked. The second thing to note is that FreeBSD is a complete operating system---all of its components are developed and maintained together, including the kernel, so the kernel source is synched to the rest of the operating system source.



> e) is it meta or binary OS?


Either. In a general sense, software management under FreeBSD and Arch Linux are virtually identical. You can either install built binary packages with the `pkg` package manager, or build your own custom packages from the ports tree. The main difference is that unlike the Arch Build System, the ports tree is designed so that all your user software can be installed and updated from source, so it features dependency resolution and interactive customization. But you can mix the two all you like---all ports, all packages, or mostly packages with just a few custom ports, for example.



> f) how 'rich' are its repo(s)?


There isn't nearly as much software available in the FreeBSD ports tree as there is in the Arch repos and AUR, but just as you can write your own PKGBUILDs you can write your own Makefiles. If you're using a minimal setup in Arch there's a really good chance most of the software you use is available in the FreeBSD repositories/ports tree. I run a really minimal system, so I'm lucky enough to have Arch and FreeBSD systems that are identical on the surface.



> g) how often does it get updates?


That's a more complex question than you might think. FreeBSD has a similar development cycle to Debian, with -RELEASE (Stable) -STABLE (Testing) and -CURRENT (Unstable) branches. The -CURRENT branch is just the HEAD of the SVN repository that's used for FreeBSD development, and can function as a Gentoo-style rolling release if you want, while -RELEASE branch only sees an update a couple times a year, with the exception of security patches. -STABLE is a sort of mid-point between those two extremes. The ports tree and package repositories get updated fairly often, though the update frequency depends on which of the three branches you choose to follow.



> h) does it support UEFI/standard BIOS?


I'm booting UEFI on my Thinkpad without any trouble. Every OS ever supports BIOS. 



> i) is it possible that FreeBSD reads and 'adopts' Arch /home partition (I mean will all the docs be editable, scripts runnable etc) or do I have to make separate /home just for FreeBSD?


You can use your existing /home partition _*if*_ it's formatted in EXT2 or EXT3, but I wouldn't recommend it. Native filesystems are preferable, and the /home directory on FreeBSD exists under /usr/home. The separation of system data and user data means partitioning is a little different. Under Arch I used an 8g / partition and gave the rest of the disk to /home. On my FreeBSD system I give 4g to the base system and the rest of the disk to /usr.


----------



## max21 (Dec 29, 2014)

> b) can I make dualboot FreeBSD<>Arch?


If you really want to set thing up correctly you need 2 machines or at least 2 hard drives.  One big as you like and the other being 80GB or more.  You use the small drive to install FreeBSD.  Since the newer FreeBSD don’t give you a choice any more like 8.2 did, it now install the boot on MBR or create an extra tiny boot partition on the drive if you use GPT.  **see why I had to do it this way?**  It’s that extra boot partition that messed everything up.  If you move that partition elsewhere, it will not work.  I never found any information of how to use install FreeBSD-9.1 -10.1 where one could use console to script it myself.

Anyway, select MBR so that you will have no missing boot partition when it’s time to dd it to your big hard drive.  On you big hard drive, create three large PRIMARY-PARTITONS.  I do this with Arch Linux-097.  Than create as many LOGICAL-PARTITONS as you like.  I think 23 or 24 is max.
Now dd using Arch to copy the small disk FreeBSD to sda1 on your main disk.  I copy FreeBSD on all three partitions, but they will not boot just yet because we never let Arch-Linux create the MBR.
The next step is to install Arch-Linux on sda6 and make sda5 your swap partition for ARCH.  Than install GRUB on SDA.

After you are done,  reboot to ARCH.  All you need is this one block of code to run all three FreeBSD but you have to boot to ARCH > cfdisk> and select which FreeBSD you want to set to boot each time.  There may be a better way but I have not found one since 2010, when I went nuts for FreeBSD-8.2.

But for now you can only select sda1 than re-boot.  Once in FreeBSD, you need to mount ada0s1a and ada0s2a so that you can fix-up the /etc/fstab for each partition… and don’t forget to umount them.  From this day on you can go to ARCH to do everything and anything on this platter that FreeBSD may do, and/or may not do.  This way nothing is impossible to keep FreeBSD happy without knowing what you did for him.  Now you have full control!

```
/boot/grub/menu.lst

title FreeBSD 1-2-3
root (hd0,1)
chainloader +1
```
I use FreeBSD 8.2 to make these PRIMARY PARTITONS but I select don’t intall boot loader or MBR so they are dead.  Than I (dd) clean them out with ARCH-LINUX for use latter.

```
01   P1   75500   FreeBSD 10 +
02   P2   75500   FreeBSD 8.2
03   P3   75500   FreeBSD or Window
```
.. than I use Arch-Linux v0.9.7 or whatever to make all ALL your logical disk!  You can use partition commander or whatever.  You can, but I never use Linux anymore to make my FreeBSD partitions because Linus go by 1000-bytes to equal one MB and FreeBSD and Commander go by 1024 byte to equal one MB.  You will notice that all three partitions read perfect in size for each, but if done in Linux, P2 and P3 will be the same but not P1.  It surely dips into the MBR section claiming a fraction of what it should not.  I tripped off that from day 1 until I got wise last year when I broke my Commander CD.  It took a while for me to think to use FreeBSD 8.2 to do the job.  Even Commander was off if I remember correctly, but that will never happen when using FreeBSD 8.2.  They threw away a master piece and don’t even know it.

Btw … always make your install partition one or more MB smaller on your small disk so that it will have room to spare when copying (dd’in) it to your main disk.  This way you never get caught up if something changes in the future.  I do 1024 x 75 = 76800 on my big disk for all three PRIMARYS, and a flat 75000MB on my small disk each new version of FreeBSD.

```
04  762700.70-MB EXTENDED

05   swap    1000 or larger
06   Arch    2000 or larger
07   D    4400   #   test stuff  mkfs -t vfat /dev/sdxx
08   E    27000   #   database
09   F    21500   #   school
10   G    21500   #   programming
11   H    54000   #   downloads
12   I    11264   #   office
13   J    11264   #   scratch
14   K    14700   #   stuff

15   L    14700   #   win-XP NTFS  mkfs.ntfs -Q /dev/sdxx
16   M    35000   #   win-7  NTFS
17   N    54000   #   win-9 when it get here

18   O    10350   #   Linux something mkfs.ext2 /dev/sdxx
19   P   309750 #    backup space
20   Q   105000   #   backup space
21   R    65000  #    backup space
Free 275.08-mb
```
From here if needed you can dd your original ARCH desktop into sda-6 provided it’s not larger than the partition you created for sda-6 (unless you do a compete re-install)… I would just dd it just like the rest if possible.  I also keep a few spare 1T HDD backups just in case.

That’s a lot of work and time but it is worth it.  For now on end you can move any OS into sda 20, 21 or 22 for insurance when you replace any partition with a newer version.  Well, this is nothing new, but it's just about the only thing I know how to do.  I'm just glad ARCH was there when I needed it to be.  I't my favorite tool for taking care of my FreeBSD


----------



## wblock@ (Dec 29, 2014)

I appreciate your effort in writing that, but man that's a lot of work.  Most of it is not necessary, just install FreeBSD using MBR, then use boot0cfg(8) to install the multiboot loader.

But this is also a lot of work when you can just use VirtualBox and install FreeBSD in a VM.  It's effectively a whole machine and makes multibooting unnecessary.


----------



## Carpetsmoker (Dec 30, 2014)

wblock@ said:


> I appreciate your effort in writing that, but man that's a lot of work.  Most of it is not necessary, just install FreeBSD using MBR, then use boot0cfg(8) to install the multiboot loader.



Can this boot Linux? I have never been able to boot Linux with FreeBSD's boot0, and had to resort to GRUB or GAG...


----------



## garry (Dec 30, 2014)

wblock@ said:


> I appreciate your effort in writing that, but man that's a lot of work.  Most of it is not necessary, just install FreeBSD using MBR, then use boot0cfg(8) to install the multiboot loader....



That is a nice solution.  I am always reluctant to let any thing overwrite my functioning grub mbr, but I may try it next time.  Last time I just installed a minimal PC-BSD and in the appropriate dialog changed the boot loader option from "grub" to "grub-slice".  It installs a grub boot loader to the slice and leaves the mbr untouched.  Then it is only necessary to edit my existing /boot/grub/grub.cfg in the already booting linux partition (slice) to chain load the new {pc,free}bsd partition.  Thereafter (re)build freebsd from ports().

As nearly as I could figure out it is not currently possible to install FreeBSD from the iso and install a grub boot loader to the slice, leaving the mbr untouched.  Was I right?


----------



## wblock@ (Dec 30, 2014)

Carpetsmoker said:


> Can this boot Linux? I have never been able to boot Linux with FreeBSD's boot0, and had to resort to GRUB or GAG...


It used to.  However, I have not tried it in years.  It is so easy to create VMs and not have disk space tied up in other partitions that I always run Linux in them.


----------



## max21 (Dec 31, 2014)

> I appreciate your effort in writing that, but man that's a lot of work.


It really is a lot of work but someone of greatness created the earth in six days.  Surely man can spend half of that time to create a life-time-foundation for himself in this quick-to-change computing world.


> Most of it is not necessary,


wblock@, you already know that I have tall respect for your expertise and personality, but for what I posted everything is necessary in order to gain 100% separation to obtain a true duel-booting system.  I have no plans to give up my form of divide to conquer (_enhancing my knowledge of those hidden features and weak-points by thinking to compare what went on when they had no duel-boot and Virtualbox for each ...  now I can understand more.  It's just a better way to experiment_) each operating systems on my workstation(s) machine.  But on the day when bhyve is ready to run _ALL_ versions of FreeBSD (and not just 8.3 at present), it will be the *ONLY* hypervisor to dominate any usable server that I ever build.  But I think bhyve is for running your own hosting style machine or on a unmanaged dedicated server abroad.  So this may have nothing to do with duel-booting other than being included in the OS just like KVM or Virtualbox within its own PRIMARY.  I been wondering about bhyve a lot lately.  Anyway, 2-Terabyte hard drive(s) are dirt cheap.  ARCH is basically free because it lives inside a dead logical drive to handle boot-control, backup-replace and it is completely unknown when in use.  In my world, FreeBSD is the man and ARCH is his only friend.

To complete what I posted, here is how I replace my *final* MBR on my master-disk.  It’s not the best way but it’s the standard way … After everything is ready as in what I post for the OP, the trick is; when you write your first MBR (sda1)…  you should boot to that PRIMARY and make sure it works.  Rebooting the system after replacement is important because it is too dangerous to play games at this point.  Don’t write them all and save them back-to-back unless you know what you’re doing, and make sure you cfdisk after each WRITE and SAVE so that you see that they have actually switched, if you do.

*COPY MBR:*
Do this and create MBR-1 than MBR-2 than MBR-3

```
At first-- the boot flag should be empty:

go to [FILE]cfdisk[/FILE] > hit enter> select Write > type yes > enter > select Quit.

[CMD][root@me~]# dd if=/dev/sda of=/MBR-1 bs=32256 count=1[/CMD]

go back to [FILE]cfdisk[/FILE] > this time [FILE]sda1[/FILE] should say boot.

you are good to go.

[CMD]reboot[/CMD]
..............................................

Always be careful leaving [FILE]cfdisk[/FILE] and always go back
in to recheck after changing MBR before rebooting.
Do this until you are sure it's working always as
expected.  DON'T RUSH [FILE]cfdisk[/FILE]!  soon you
will never have to go back again.
```

*One more thing,* when you are ready to WRITE and SAVE the next MBR which is sda2 you _MUST FIRST remove_ the previous selected MBR ***and*** WRITE it to disk.

Now you can repeat the steps above after selecting sda2.  Maybe You could do both steps with one WRITE but I don’t trust it.  I think I got bitten once doing that.  I think it dirty-up the MBR.  I can't remember but for some reason I do the two-step method since I don't play games with the MBR anymore.

I do think or it's something I choose to believe ... the two-steps WRITE method will ensure a cleaner MBR for each SAVE MBR.  What the heck, you will never have to do it again, so go the two-step way, anyway.  Hope I make some since of this, somewhere. 

*
RESTORE/SWITCH MBR:*
Now you have safety and ease-of-use all at the same time:

```
[CMD][root@me~]# dd if=/MBR-1 of=/dev/sda bs=32256 count=1[/CMD]
[CMD][root@me~]# dd if=/MBR-2 of=/dev/sda bs=32256 count=1[/CMD]
[CMD][root@me~]# dd if=/MBR-3 of=/dev/sda bs=32256 count=1[/CMD]

[CMD]reboot[/CMD]

... after running your selection and/or
double checking with [FILE]cfdisk[/FILE].
```
The saved commands above have never fail since 2010, but I still believe that the safest way to replace the MBR is to know where to _point-to_, so to replace only that single byte that makes the switching of PRIMARY partitions possible.  This way, you never touch any other parts of the full MBR (but always keep full copies on media elsewhere just-in-case).  The problem is I been too chicken to try any examples on the internet because I was bitten once and lost my entire drive.  I had no backup back then.  I read the Wiki but I don’t know how to do the math.  So may I ask the question?

What is the full command-line to replace only that single byte in the MBR so to change PRIMARY?

BTW:  sorry about what some people call ranting.  I call it trying not to miss key points and to pass along ideas, taken in or not.


----------



## TiberiusDuval (Jan 28, 2015)

Umm why not simply use two separate hdd's each with their own bootblock, and simply choose from BIOS/UEFI menu which one is used on boot up? That is the way I did it. One HDD brings Linux grub, giving access to Linux and Windows7, other brings PC-BSD grub, giving access to PC-BSD and Windows7.


----------



## ANOKNUSA (Jan 29, 2015)

TiberiusDuval said:


> Umm why not simply use two separate hdd's each with their own bootblock, and simply choose from BIOS/UEFI menu which one is used on boot up? That is the way I did it.



That's how I did it too, but not everyone has multiple disks and multiple bays for them.


----------



## teo (Jan 30, 2015)

What about the project ArchBSD? You can install desktop?


----------



## scottro (Jan 30, 2015)

I've found it fairly easy to dual boot.  I usually have one or possibly two Linux installs, and use one of their grubs with a custom /boot/grub (or grub2 in Fedora's case)/custom.cfg

I have a little page on grub2, anyone interested can just search for FreeBSD on the page.

http://www.srobb.net/grub2.html

In a nutshell, you can either use the chainloader syntax or kfreebsd /boot/loader.  (Which I prefer, because if you use chainloader, and put a second FreeBSD version on the drive, it will only boot the last one installed).


----------



## TiberiusDuval (Jan 30, 2015)

PC-BSD uses Grub directly without chainloading, it just gives right arguments for Grub to do its work...something like this:

```
submenu "PC-BSD (default) - 2014-07-01 17:26" {
  menuentry "Normal Bootup" {
  insmod zfs
  search --no-floppy -s -l tank
  kfreebsd /ROOT/default/@/boot/kernel/kernel
  kfreebsd_loadenv /ROOT/default@/boot/device.hints
  kfreebsd_module /ROOT/default/@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache
  set kFreeBSD.vfs.root.mountfrom=zfs:tank/ROOT/default
  kfreebsd_module_elf /ROOT/default/@/boot/kernel/crypto.ko
  kfreebsd_module_elf /ROOT/default/@/boot/kernel/aesni.ko
  kfreebsd_module_elf /ROOT/default/@/boot/kernel/geom_eli.ko
  kfreebsd_module_elf /ROOT/default/@/boot/kernel/zfs.ko
  kfreebsd_module_elf /ROOT/default/@/boot/modules/nvidia.ko
  kfreebsd_module_elf /ROOT/default/@/boot/kernel/opensolaris.ko
  kfreebsd_module_elf /ROOT/default/@/boot/kernel/tmpfs.ko
  kfreebsd_module_elf /ROOT/default/@/boot/kernel/linux.ko
  kfreebsd_module_elf /ROOT/default/@/boot/kernel/geom_journal.ko
  kfreebsd_module_elf /ROOT/default/@/boot/kernel/geom_mirror.ko
  kfreebsd_module_elf /ROOT/default/@/boot/kernel/ums.ko
  set kFreeBSD.bootfile="kernel"
  set kFreeBSD.kernel="kernel"
  set kFreeBSD.kernel_options=""
  set kFreeBSD.kernelname="/boot/kernel/kernel"
  set kFreeBSD.module_path="/boot/kernel;/boot/modules"
  set kFreeBSD.kern.ipc.shmseg="1024"
  set kFreeBSD.kern.ipc.shmmni="1024"
  set kFreeBSD.kern.maxproc="10000"
  set kFreeBSD.legal.intel_ipw.license_ack="1"
  set kFreeBSD.legal.intel_iwi.license_ack="1"
  set kFreeBSD.legal.realtek.license_ack="1"
  set kFreeBSD.hint.acpi_throttle.0.disabled="1"
  set kFreeBSD.machdep.disable_mtrrs="1"
  set kFreeBSD.kern.geom.eli.visible_passphrase="2"
  set kFreeBSD.kern.cam.scsi_delay="500"
  set kFreeBSD.hw.memtest.tests="0"
  set kFreeBSD.kern.vty="vt"
  set kFreeBSD.grub.platform="$grub_platform"
  set kFreeBSD.kern.geom.eli.passphrase="$pass"
```
That is from my PC-BSD 10.1 /boot/grub/grub.cfg


----------

