# Questions after move from Arch Linux to FreeBSD



## Mriedstra95 (Dec 14, 2012)

After my Arch Linux home server decided to break upon update two days ago I've been setting up FreeBSD to go ahead and take it's place. This has gone smoothly by using Qemu inside of my desktop computer's Linux install. Not only have I been able to install FreeBSD on a real 2TB drive attached to my current system but I have been able to remotely set it up over SSH as well.

I have found no problems installing packages, configuring MiniDLNA, Samba, or anything else so far. I've also enjoyed the fact that I can install more than one thing at once, weather it's from ports or using pkg_add. There are a few things I am unfamiliar with and would be very happy for other users to clear up for me.

Normally on Arch Linux I would go about my backups as such while the system is running


```
# cd /
# tar cJ ./* \
--exclude={/proc/*,/sys/*,/dev/*,/root/*,/lost+found/*,/mnt/*,/media/*,/tmp/*,/run/*,/home/ \
| pv > /media/backups/server/month_day_year.tar.gz
```

My understanding is that backups are much the same way and almost painless. However on Arch Linux to restore the backup (from a rescuse disk) I could easily reformat the partition or use rm -rf ./* and simply restore via


```
# cd /media/server
# pv /media/backups/server/month_day_year.tar.gz | tar xJ
# extlinux --install /media/server/boot/syslinux
```

With the extlinux being used to restore my favorite Linux boot loader.
After reading the FreeBSD handbook section on the boot system I found the command `# fdisk -B -b /boot/boot0 device` device would allow me to restore the FreeBSD bootloader on an MBR setup. I have opted for GPT as my FreeBSD system is EFI and GPT is supposed to the the standard for the future. I'm unsure how to go about a restore from here.

I am planning on raid 1 and several 3TB drives for /home and general file storage soon, this I do not believe I will have any problems with setting up. However I am wondering If I were to transition my current root file system to say, 4 SSDs in RAID 6 would my best option to be to backup my current system and simply restore to the SSDs? Or would another way be better? 

Also, I have been able to install Arch Linux along with various other Linux distributions to flash drives for years and have been able to get them to find the root file system with ease simply by adding the kernel parameter root=/dev/disk/by-label/flashdrive_label I am also unsure how to go about this from FreeBSD. Does FreeBSD have a root= option on a kernel parameter line? I have also seen nothing in the FreeBSD handbook about an initrd or initramfs, are these just Linux concepts?

All in all so far my FreeBSD experience has been an awesome one with a setup process that just make sense. Updates that don't break stuff or silly changes. (Arch Linux moving to systemd comes to mind) And a little bit of peace and mind that the system I've setup will stay working. I'm hoping to have completely replaced my old home server over the weekend, which is currently running an old backup of Arch Linux. I will keep everyone here updated with my progress and I will also look forward to everyone's responses to my questions.


----------



## Crest (Dec 14, 2012)

There is no kernel parameter line. There is the loader.conf which can define vfs.root.mountfrom="filesystem:path". FreeBSD still lacks EFI capable bootstrap code. You need to boot an EFI system in BIOS mode to load FreeBSD.


----------



## SirDice (Dec 14, 2012)

Mriedstra95 said:
			
		

> I have also seen nothing in the FreeBSD handbook about an initrd or initramfs, are these just Linux concepts?


Yes.


----------



## Mriedstra95 (Dec 15, 2012)

Crest said:
			
		

> There is no kernel parameter line. There is the loader.conf which can define vfs.root.mountfrom="filesystem:path". FreeBSD still lacks EFI capable bootstrap code. You need to boot an EFI system in BIOS mode to load FreeBSD.



I'm happy to report that my server is now booting without a guessing game! I simply added vfs.root.mountfrom="UFS:/dev/gpt/FreeBSD" to /boot/loader.conf I will also post when I get it running on my flash drive properly.

I am however still wondering how to properly restore the FreeBSD boot loader after restoring from a tarball.


----------



## kpa (Dec 15, 2012)

GPT bootloader is installed on a partition of type freebsd-boot (usually the first GPT partition) using gpart(8):

`# gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0`

The -b /boot/pmbr parameter instructs gpart(8) to also install a protective MBR on the first sector of the disk to make the disk bootable trough the traditional BIOS.

The rest of the boot process is handled by loader(8) that does not need any special handling, it's just an executable file in the /boot directory.


----------



## wblock@ (Dec 15, 2012)

fdisk(8) and boot0cfg(8) can both write MBR boot code.  But gpart(8) is the new tool, and can handle MBR, GPT, and other partitioning schemes.


----------



## Mriedstra95 (Dec 17, 2012)

I am happy to report my switch from Linux is pretty much complete, I still run Arch on my Desktop and Gentoo on my laptop mainly for graphics support, and I don't see that changing any time soon :\ Although I've come to really enjoy how FreeBSD is put together more so than either version of Linux.

I now have one flash drive that will boot into either Arch Linux or FreeBSD upon my choice. I'm feeling great about this switch and happy to know there's a good natured community that's helpful getting everything working. The same sadly cannot be said about the forums of many Linux distros.


----------

