Solved Install FreeBSD from Linux

Hello,
is there any way (simple..) to install FreeBSD from running OS (CentOS) or from grub? My VPS provider isn't able to mount FreeBSD image to virtual...

Thanks for reply!
 
Last edited by a moderator:
Maybe this may be of some help?

Edit: This may get you to a working 7.0 release, if it does not work with more current versions. Upgrading from 7.0 to -current (or whatever you want) should then be possible.
 
Grub2 can boot from ISO: https://wiki.gentoo.org/wiki/GRUB2/Chainloading#ISO_images
So the idea:
1. You should have at least two partitions. One for Linux and another for FreeBSD.
2. Install and boot linux.
3. Download FreeBSD's iso.
4. Edit grub2.
5. Reboot and choose the FreeBSD ISO.
6. Install FreeBSD to the FreeBSD-dedicated partition (and install FreeBSD's boot loader too).
7. Reboot and use FreeBSD. You can format Linux-partition to UFS and can mount to /usr/local, or /home, or...

I think it should work.

Copy from Gentoo-wiki:
The new ISO (or loop) chainload mechanism makes chainloading a breeze. It is actually possible to chainload ISO images (LiveCD/DVDs) with GRUB Legacy, however there exists no way to pass kernel cmd line arguments before boot. In any case, the ISO images in question should be built keeping kernel cmd line arguments in mind.

Without kernel cmd line options, booting ISO images with GRUB2 will fail in the physical media check/test stage of the ISOs boot process. Gentoo liveCD is handy because it has a minimal shell which lets the user mount the squashed image to the correct location and then press the Esc key to continue the boot process. This makes it possible to have a handy way to install an operating system with everything in RAM, especially for "light weight" LiveCDs. No more need to listen to a whining CD/DVD drive on each new command!

To chainload an ISO with custom or default kernel command line arguments, an entry similar to the following can be added to GRUB2's grub.cfg file:

FILE /boot/grub/grub.cfgExample entry for chainloading an ISO file
menuentry "SYSRESCUECD" {
set iso=/systemrescuecd-x86-3.8.1.iso
loopback loop ${iso}
linux (loop)/isolinux/rescue64 nomodeset vga=791 docache setkmap=fr isoloop=${iso}
initrd (loop)/isolinux/initram.igz
}
 
So I try many things, but still can’t boot FreeBSD ISO :( I try for example this:
Code:
menuentry "FreeBSD 9.0 Release" {
  set isofile="/boot/iso/FreeBSD-9.0.iso"
  loopback loop $isofile
  kfreebsd (loop)/boot/kernel/kernel
  kfreebsd_module (loop)/boot/mfsroot.gz type=mfs_root
  set kFreeBSD.vfs.root.mountfrom=ufs:/dev/md0
}

I'm not an expert in grub (I did not use Linux since 2005). I cant load kFreeBSD module or don't know how to do this...

I also try console in grub to mount image:
Code:
grub> drivemap (hd0,0)/bsd/freebsd.iso (hd1)
grub> chainloader (hd1)+1
grub> rootnoverify (hd1)
grub> boot

But anything not working...

I think I can create partition on HDD and extract FreeBSD ISO image on it, but how can I set up grub to boot from this partition?
 
Try without kfreebsd, kfreebsd_module and kFreeBSD:
Code:
menuentry "FreeBSD" {
  loopback loop /boot/iso/FreeBSD-9.0.iso
}
 
Still no progres :( this is standard grub commands for boot Debian (grub console):

http://pasteboard.co/PvMHvx6.png

Here is my partition list:

Code:
#fdisk -l

Device Boot  Start  End  Blocks  Id  System
/dev/sda1  *  2048  499711  248832  83  Linux
/dev/sda2  501758  20969471  10233857  5  Extended
/dev/sda3  20969472  41943039  10486784  8e  Linux LVM
/dev/sda5  501760  20969471  10233856  8e  Linux LVM

FreeBSD ISO is located in root - /bsd.iso

Any ideas how to boot it?
 
I think it would be a lot easier to ditch this VPS provider and get one that does allow you to install FreeBSD.
 
So the last chance... I have installed Windows Server on VM. I download program called EasyBCD and add FreeBSD.

ISO file is loaded into ram and I can boot kernel. Now it looks for CDROM, which isn't in VM (Trying to mount from cd9960...). How do I fix it?

Code:
mountroot> ufs:/dev/md0
Mounting from ufs:/dev/md0 failed with error 19.

I also can create partition with FAT filesystem and extract FreeBSD ISO on it, but I don't know how to boot from it...
 
So iI finally made it! I install Windows instead Linux on VPS and proceed this steps:
  • In computer manager shrink disk about 250 MB (/dev/sda3).
  • Create new partition, but not format.
  • Download and install Cygwin and EasyBCD.
  • Download FreeBSD memstick IMG and bootonly ISO.
  • Start Cygwin and use dd command:
ls /dev/
dd if=C:/memstick.img of=/dev/sda3

  • Reboot server to FreeBSD kernel.
mountroot> ?
mountroot> ufs:/dev/ufs/FreeBSD_Install


Installation media now boot fine. Next iI have to use gpart(8) on command line and create filesystem and MBR manually. This page helped me a lot:
http://www.wonkity.com/~wblock/docs/html/disksetup.html

So all are working fine now! Thanks for help! :)
 
Back
Top