# Fresh FreeBSD 9.0 Install



## cableguy1115 (Apr 27, 2012)

Hello,

I am just downloading the FreeBSD 9.0 memstick.img release and preparing myself both spiritually and ph*y*sically to install it on my laptop.

At first *I* tried thousands of ways to boot the DVD .iso image from a USB device, but nothing worked, so I will install the memstick image from a pendrive and install the complete packages from the DVD .iso file I will mount when the install succeeds.

First of all, here are the partitions (on a single 500 G*B* hard disk):

400 G*B*, ext4, Installed Linux Ubuntu 12.04.
25 G*B*, ext4, Installed Backtrack 5 R2.
25 G*B*, ext4, Here is where I will install FreeBSD.
16 G*B*, extended.
16 G*B*, Linux Swap.


For now, both OS's are working great, fixed the boot issue Backtrack had, and everything just fine (yep, it was me alone, and therefor*e* just me and no one else than me doin' it :e ).

As I mentioned, I will install FreeBSD using a USB boot device, and I expect the install will be quite intuitive, formatting third partition, etc. I will use a method I saw on a thread (http://forums.freebsd.org/showthread.php?t=30136):


> _You just could install the base FreeBSD system from the working memstick.img, afterwards mount dvd1.iso to that file system with mdconfig (see below how to) and *pkg_ad*d the needed packages from there, presuming the package collection is what you need from the DVD. No need to buy a USB DVD burner._
> 
> 
> ```
> ...



I am quite new on UNIX/Linux enviro*n*ment, been using for less than half a year, and here comes the annoying questions.


Are 25 G*B* en*o*ugh for a FreeBSD complete install? The install purpose is educational only, not that I am going to install huge programs/games, etc. Maybe some development and programming...
Will the boot configuration going to be screw*e*d (as I was warned)?
Do I have to create another partition for a separated SWAP for FreeBSD or it will use the same Linux Swap partition?
On long term, will the hard disk become unstable because of implementing so many partitions or filesystems?
Is FreeBSD kwnown to have problems with Optimus technology on nVidia Cards?

And, if anyone needs to know, the laptop has:

IntelÂ® Coreâ„¢ i5-480M 2.66 Ghz (with integrated graphics on itself).
Nvidia Geforce GT 540M 1GB (with that badass Optimus technology).
4 G*B* DDR3.

And, if anyone has the divine intention of reading (and even more, responding) I will personally pray for your souls and bless you in the name of the almighty Joe Pesci.
Thank you.


----------



## cableguy1115 (Apr 28, 2012)

Hi again,

I burned the memstick.img file on the pendrive (16 GB, Kingston) using UNetBootin (v568), as a diskette (it selects automatically).

Plug it on the laptop, UNetBootin message pops up, select the "default" (and only) option. Tons of code starts loading. And the FreeBSD menu pops with seven commands. I hit enter to boot, again loads of commands start apearing and it stops. The text that appears is:


```
Trying to mount root from ufs:/dev/ufs/freeBSD_Install [ro, noatime]...
mountroot: waiting for device /dev/ufs/FreeBSD_Install ...
Mounting from ufs:/dev/ufs/FreeBSD_Install failed with error 19.

Loader variables:
   vfs.root.mountfrom=ufs:/dev/ufs/FreeBSD_Install
   vfs.root.mountfrom.options=ro, noatime

Manual root filesystem specifications:
   <fstype>:<device> [options]
      Mount <device> using filesystem <fstype>
      and with the specified (optional) option list.

     eg. ufs:/dev/da0s1a
         zfs:tank
         cd9660:/dev/acd0 ro
            (wich is equivalent to: mount -t cd9660 -o ro /dev/acd0 /)
...

mountfrom:
```

If I leave the blank line and hit enter the system reboots, jumps again at the UNetBootin menu, but this time it goes differently: instead of loading to the FreeBSD menu, this is what happens:


```
Loading /ubnkern..
Loading /ubninit..................................
CHS: Error 8001 reading sector 1147515 (71/110/34)
EDD: Error 8000 reading sector 1148928 (71/132/61)
```

Th*ese*s two erro*r*s repeat themsel*ves* in pair, on and on, and only the sector number changes (and the numbers in parenthes*e*s). I shutdown the system, unplug/plug again the pendrive, but the loading part never passes the above errors. Keyboard doesn't respond, shutdown button either. I unplug it, reboot (holding the button some secs), the GNU GRUB (version 1.98-1ubuntu13) is intact (nothing to worry about here). 

I formatted the pendrive (FAT32) on my PC and burned again the image, but when I plug it *in*to the laptop, the same errors keep coming up. Just what the hell?


----------



## wblock@ (Apr 28, 2012)

Use dd(1) to write the image file to the USB drive.  It is the same for Linux as for FreeBSD, only the device name differs.  See http://www.freebsd.org/doc/en_US.IS...nstall-pre.html#BSDINSTALL-INSTALLATION-MEDIA.


----------



## cableguy1115 (Apr 28, 2012)

Instal*l*ation was successfull (thank you Mister wblock  ), etc. But when *the* system started again there was no FreeBSD option in the GRUB Loader, so I plug*g*ed again the pen with the FreeBSD image and started a shell. In the shell I typed some commands I found *i*n that manual:
`# fdisk -B -b /boot/boot0 ada0`

Nothing happened so I typed:
`# fdisk -B ada0`

Now big time problems that I have: *the* system boots and *the* FreeBSD menu loads directly, without giving me the chance to choose between Backtrack, Ubuntu or FreeBSD (yes, I screwed it up, thank you). And now I can't try the LILO option because I can't load Ubuntu 

I know the slices are still there:


```
ada0		  465 GB	MBR
  ada0s1	  400 GB	linux-data
  ada0s2	   25 GB	linux-data
  ada0s3	   25 GB	BSD
    ada0s3a	   23 GB	freebsd-ufs
    ada0s3b	  1.3 GB	freebsd-swap
  ada0s4	   15 GB	EBR
    ada0s5	   15 GB	linux-swap
```

Is there any way to solve this?


----------



## wblock@ (Apr 28, 2012)

Grub has its own methods for modifying the menu.  I can't help you on how to restore that; it probably won't be too hard.  All that you did was overwrite the MBR with the standard FreeBSD MBR, which boots the active partition.

FreeBSD has a very bare-bones multi-boot loader which can be installed with boot0cfg(8).  That may let you boot into the Linux installations, which could then be used to reinstall the Grub MBR.  Then you will have to edit the Grub files to add an entry for FreeBSD.


----------



## cableguy1115 (Apr 28, 2012)

So far so good 

What I did is still better than what I expected. Following that manual page, I wrote:

`# boot0cfg -Bv ada0`
`# boot0cfg -m 0xf ada0`

*_0xf was displayed as all four slices_

Now (finally!) when *the* system boots, it prompts me with a simple menu:

```
F1 Linux
F2 Linux
F3 FreeBSD
F4 ?

F6 PXE
Boot:  F2
```

The only problem is, every key I press only types "#" (unless, of course, the shutdown button): the F1-F12 keys, backspace key, space key, every one. Tested with *the* laptop keyboard and *a* USB keyboard and still the same thing. What am I missing? Do I have to install some package? Is the boot0cfg badly configured? 

In advance, thanks again for the replies.


----------



## cableguy1115 (Apr 28, 2012)

My bad: the only key allowed me is F3 (the actual FreeBSD installation). I will look forward to how to configure boot0cfg so it will accept the other systems (w*ei*rd thing though, because if it displays both Linuxes it should be working :/ )


----------



## wblock@ (Apr 28, 2012)

The multi-boot loader detects partition types based on the ID, but there could be other magic required to boot those Linux partitions.  I suggest you start a new thread about the Grub issue.  There are people here that use Grub, but it needs to be in the thread title to get their attention.


----------



## cableguy1115 (Apr 28, 2012)

Thanks for the idea. I guess I can consider this thread solved.


----------

