View Full Version : [Solved] Install freebsd over linux
MrJake
October 8th, 2009, 03:57
I have recently inherited of a Dell 860 which does not have a crdom or refuses to boot from usb which is also running debian.
I want to install freebsd to learn freebsd on this server to eventually switch from linux completely. Now once upon a time I did a remote install of linux by disabling the swap and using it as a partition to install a minimal install of linux to then boot on that dist to then reinstall linux in the real partition and then reboot on that, format the swap and do a swapon.
now i was wondering is that something that can be done for freebsd? and If yes I cant find a howto :(
So i would really love to be able to convert this poor server to freebsd to then convert myself which is so green with freebsd which looks so lovely and rock solid.
Thanks in adavance for whoever can help me with this pickle.
Oh ya here are some stats on the server and its current partitions. also i do have a KVM ip switch connected to the server. My problem like i said is to no be able to boot from anything but the hard drive:
CPU inter xeon dual core 3ghz
Ram 256mb (ya i know ouch ill upgrade that surely soon)
HD 80GB
/ = 73GB
swap = 1 GB
aragon
October 8th, 2009, 04:09
It is possible, but tricky.
First off, are you able to create bsdlabels and file systems under linux?
Second, what boot manager are you currently using?
MrJake
October 8th, 2009, 04:13
first what are bsd labels :( and yes i can create file systems
second im using grub
Thanks
aragon
October 8th, 2009, 04:26
Ok, grub should make things a bit easier.
BSD labels are a storage structure that group UFS file systems together. Of particular value here is the boot loader in the first 512 bytes of the BSD label, something which is crucial to a bootable FreeBSD system. I know linux is able to read BSD labels, but I suspect it lacks the tools to create them.
I think you should try and download the 8.0-RC1 memstick image. It is just under 1 GB in size. Disable swap and use linux's fdisk to set the swap partition type to 165 (0xA5). Then dd the memstick image to that partition, and add an option to grub to chain load that partition. Reboot and choose the boot option you created. Hopefully the FreeBSD installer should start.
aragon
October 8th, 2009, 04:36
If it works, don't go ahead and wipe out your linux install just yet. You said the drive was 80 GB and only 74 GB allocated? Rather install to a new partition first to make sure all works before overwriting your linux partition.
MrJake
October 8th, 2009, 12:51
Thats sounds straight forward enough. Now can I sue the boot-only image or I need the memstick absolutely. Because this server is sitting behind a firewall so with operational networking I could get the rest of the packages i need to make it the server i want.
Another thing is the swap itself. Freebsd must surely use a swap file like any other OS right? How do I regain that partition. Do i convert it aswell once done to a A5 partition type?
Thanks
phoenix
October 8th, 2009, 20:16
Do a google search for "depenguinator". That's a handy, automated method for replacing a Linux install with a FreeBSD install. :)
aragon
October 8th, 2009, 22:08
Now can I sue the boot-only image or I need the memstick absolutely.
The other images are written with an optical disc boot loader, so don't think they'll work.
Another thing is the swap itself. Freebsd must surely use a swap file like any other OS right? How do I regain that partition. Do i convert it aswell once done to a A5 partition type?
You could reuse the same partition as swap, and it can be any partition type I think. Usually though, swap is a partition within the BSD label that you create during install.
MrJake
October 9th, 2009, 02:16
ya i learned the hard way that you dont extract a iso to a ufs filesystem but instead to a type 96. anyways I bricked the install when I fubared grub. For some reason if you put an invalid root path in the first element in menu.1st then grub will act wierd. My KB isnt even responding in the grub menu. I tried to type c to get to console to then manually boot into my old linux to fix my poopoo.
Anyways tomorrow I will setup a PXE server on another server on the same lan and then attempt to install Freebsd from pxe instead just to make it more spicy. I believe after this I wont be a freebsd virgin as much as I am today hehe. But im loving the challenge. found this beautiful howto http://tomclegg.net/pxe
Pretty clear and simple. this will permit me to run freebsd from the network to then do whatever I want with this servers hard drive to then permanantly install it on the machine to then not have to depend on my network boot.
Gonna be fun fun :)
Thanks anyways for the help. My advice is never attempt to install freebsd in your swap when its very late at night and your out of coffee.
dennylin93
October 9th, 2009, 13:09
How about temporarily plugging in an optical drive? It might work.
MrJake
October 9th, 2009, 14:39
problem in that dell 860 is I have a IDE slot and even a cabel that goes to the empty slot but no power. The only available power is a 4pin floopy, or a sata power.
but PXE is gonan be fun. Im setting it up in one of my esx server sitting on the same lan. So I will only start the PXE when I need to install a distro in vmware or on a server. I guess a pxe server will serve usefull and at the same time very educational. Optical would make it to easy anyways :P
But thanks for the suggestion
MrJake
October 9th, 2009, 20:59
alrighty server is back to almost square one hehe. Unfortunately I was not able to install freebsd with PXE (i suck) but was able to reinstall debian with pxe since that was more comfortable for me. So now my main partition is 77gb my swap is 2.7gb. I did a swapoff -a and also disabled swap from fstab.
now what I would like to accomplish is to install in the swap partition the memstick version of freebsd example then setup grub to boot from it. then from that version i can attempt to reinstall freebsd but in my main partition to then reboot on that one to then format my swap partition to use with freebsd.
How is my question. I did dig a bit and found alot of ways to actually do it from a usb stick but no how to do it from HD. So i want to install freebsd from hard drive booting from grub :)
If it fails it doesnt matter since my pxe install of debian is only 1ms away :)
Thanks for the help in advance
sossego
October 9th, 2009, 21:06
Is the swap a primary or extended partition?
2.7 gigs is going to be bare bones.
MrJake
October 9th, 2009, 21:14
its ext and the point is to use that partition to install something to boot on to install freebsd on main partition. See this server has no optical drives and does not boot on usb.
it can bootp or PXE. but I dunno how to install freebsd with bootp or PXE and didnt find a good howto do it from a linux distro.
So my only other option is to install from HD and its currently partitioned 77gb / then ext with a swap of 2.7gb
sossego
October 9th, 2009, 22:04
How's the setup? A main and an extended or the system has a few extended for /home /tmp /var?
If everything is on a main partition save swap, then use an external tool such as knoppix or gparted to resize the Debian install. You can then remove the extended and create a few primary partitions. Fstab can be edited to mount a new partition number and the swapon can initiate that.
You're going to need 4gigs to make a decent installation with desktop and whatnot.
I'd say make a 4g slice. mark it bootable.
Let grub stay with Debian- don't edit master boot record- and add the freebsd entry after reboot.
Make the partitions such as: everything in one section / and 256 to 512m swap. Fixed partition sizes in a limited space can cause trouble.
MrJake
October 9th, 2009, 22:43
im just trying to make the swap partition the equivilant of a CD so i can copy a ISO content to it them point grub to boot from sad5 instead of sda1 so that then i can install freebsd in sda1 to then reformat sda5 to be a freebsd swap
is that possible?
sossego
October 10th, 2009, 01:27
I'm not trying to pass a product here but only to ,facilitate the process. Are you keeping or removing Debian?
You can use unetbootin- make it simple if you are having trouble- and use the programs. You can download the image and boot from it- which is what you want, it seems.
Do that and start installing.
aragon
October 10th, 2009, 01:48
Since you can fall back to another PXE debian install if the FreeBSD install fails, this shouldn't be too difficult or risky. Never tried this, but installing from a hard drive should be pretty much the same as installing from a memstick.
Anyhow, I'm guessing your partition layout is still the same - 1 big primary partition as your debian root, and one extended partition for your swap.
Use fdisk and change the extended partition to a FreeBSD one as indicated earlier, then dd the memstick image to it.
Next step is grub which I can't help with unfortunately. I'm too indoctrinated with the elegant simplicity of the FreeBSD boot manager. :P
gcampton
October 10th, 2009, 04:11
add a simple entry same as windows,
title FreeBSD
boot /dev/sda3
chainloader+1
that's pretty much it i think sorry if I'm wrong I'm going off memory.
I definitely know you don't need the kernel path, just a simple chainloader+1
sossego
October 10th, 2009, 05:36
It's
title FreeBSD
root (hd0,x)
chainloader +1
You can add the kernel path if you want.
The drive will be seen as /dev/ad4sx or similar to it in a FBSD install.
MrJake
October 10th, 2009, 06:13
k i am dl 8.0 memstick as we speak then will dd it to the a5 FS i converted my swap too then ill setup grub and see how she goes.
brb
MrJake
October 10th, 2009, 06:32
alrighty this is how i copied the iso to the freebsd partition. nothing to fancy
dd if=8.0-RC1-i386-memstick.img of=/dev/sda2
setup grub and reooted and now im running freesd install :)
so far so good
MrJake
October 10th, 2009, 06:35
i think this will work hehe its installing from ftp atm. my other question is once im rebooted and running freebsd in my main partition, how do i reclaim my other 2.7gb partition to become a swap
Thanks
aragon
October 10th, 2009, 07:54
my other question is once im rebooted and running freebsd in my main partition, how do i reclaim my other 2.7gb partition to become a swap
In your fstab, just specify that device for swap, and also see swapon.
MrJake
October 10th, 2009, 15:57
pretty much like linux right? anyways im quite lost in the but the important thing is its installed and debian is gone hehe. Now I only feel I dropped back in time because I already miss apt-get or aptitude.
So to install stuff you do it like old school where you get the src code then
./configure
make
make install
there is no packag manage but only packages u can add and remove with pkg_add right?
would there happen to be a gui made with curse or anything close from that or I have to stop being lazy hehe
MrJake
October 10th, 2009, 16:00
gotta love this freebsd handbook. I see i can install and remove shit using sysinstall which is exactly what I need.
Thanks again for all your help guys. without you I would have had to get out a shovel and dig so much more.
Thanks many times
aragon
October 11th, 2009, 05:01
Take a look at ports too. It's in the handbook.
Well done with your unorthodox and successful install!
MrJake
October 11th, 2009, 14:15
lol yes it was fun. Ya im quickly noticing that sysinstall is not the best way to go. Im having much more success in /usr/ports
make
make config
make install
But I also noticed that freebsd is not as lazy as debian and ubuntu. Like if you install via ports apache or mysql it wont even start the server for you lol
You need to setup rc.conf then launch it manually. Its not a bad thing since it forces me to check it over once more to be sure everything is up to par. But up to now Im really liking freebsd. These guys have travelled light years since 3.51 hehe
next im gonna make my kernel slimmer and see how much ram i can save it :)
Damien
October 11th, 2009, 18:22
Hi
I've got quite the same problem as you, but I can't make it work...
In fact I don't know how to convert my free partition into a FreeBSD one, using Debian.
Can you help me, thx.
MrJake
October 11th, 2009, 20:42
ok do this:
first u have to know what drive your partition is on. example /dev/hda or /dev/sda etc..
then call it with fdisk
fdisk /dev/sda
then the partition u want to convert chose p to list the partition and if its partition 5 xample the type t
then it will ask for partition number enter 5
then it will ask to chose a partition type enter a5
then if that partition was on same drive as your debian partition it wont be able to write the changes right away. to write changes just chose w i think it is. then reboot if needed.
once back download the iso of 8.0-RC1 memstick and dd it to new partition. example if your partition was /dev/sda5 you will type
dd if=/home/joeblow/8.0-RC1-i386-memstick.img of=/dev/sda5
that will it a nutshell make your freebsd partition the same as the content of that iso. then u need to configure grub to boot on that.
So what you do is enter this in your grub config
ass this to /boot/grub/menu.1st
title FreeBSD
root (hd0,4)
chainloader +1
this is always assuming your partition was sda5
remember in linux partition are counted from 1 but grub will count from 0
so /dev/sda3 = hd0,2
/dev/sdc6 = hd2,5
and so on.
Then reboot and you should chose freebsd from grub menu and if all went well you should be soon in the freebsd installer.
Keep us posted
Damien
October 13th, 2009, 00:08
Well I'm afraid it didn't work...
In fact I want to install pfsense and I only have the iso of a livecd, and I can't boot on it...
If you know how I can do it I'm open to all solution available, so far, nothing worked...
thx
MrJake
October 13th, 2009, 13:49
so you have an optical drive in that machine then. so you just need to boot on the freebsd cd1 and install from there
danger@
October 13th, 2009, 21:31
Here is a complete working howto that I wrote a while ago:
http://www.freebsd.org/doc/en/articles/remote-install/
tankist02
October 13th, 2009, 22:02
http://www.daemonology.net/blog/2008-01-29-depenguinator-2.0.html
danger@
October 14th, 2009, 07:30
as far as I know, depuinginator doesn't work with recent versions of FreeBSD and mfsBSD which is used in my howto has more features...
Damien
October 30th, 2009, 00:53
Hi,
I'm sorry but it didn't worked...
The problem is that I want to install pfsense, a derivate from freebsd. The boot process is a litlle different and so both the solutions you told were inoperant. They can't build a botable image, I think it's because the files needed to boot are different from freeBSD, and I can't figure out what they are...
The only way to install this distrib is via the livecd but my cdrom drive is dead, and I can't replace it.
I'll try to install it via a virtual machine but I doesn't like the idea...
If you have any clue...
Thanks
astadtler
October 30th, 2009, 20:34
ports > dpkg crap
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.