1086f DUAL BOOTING LINUX & FreeBSD - How to restore grub if Bootmgr wipes it out - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Miscellaneous > Howtos & FAQs (Moderated)

Howtos & FAQs (Moderated) Would you like to share some of your solutions for certain problems? Tips or tricks? Post here. All new topics are automatically moderated.

Reply
 
Thread Tools Display Modes
  #1  
Old June 30th, 2009, 06:19
gr1ml0ck's Avatar
gr1ml0ck gr1ml0ck is offline
Junior Member
 
Join Date: Jun 2009
Posts: 32
Thanks: 8
Thanked 37 Times in 3 Posts
Default DUAL BOOTING LINUX & FreeBSD - How to restore grub if Bootmgr wipes it out

NOTE: THIS GUIDE ONLY APPLIES IF YOUR PRIMARY O/S IS LINUX!!!

If you have a linux machine and your wanting to try FreeBSD on a separate partion... you may encounter the problem where the bootmgr (if installed) will wipe out your grub boot loader who's menu.lst file is exists on your linux drive.

DONT PANIC!!!

There is a very simple fix to this problem. The easiest way to do this is to use a live cd/dvd distro (any distro will do)

If your live distro takes you directly to the command prompt then obviously skip this next stop (duh!)

If your live distro takes you to a window manager then load a terminal (duh!?*!)

Code:
 sudo grub
This will take you to the Grub command prompt.

Then type:

Code:
 find /boot/grub/stage1
This should bring you a result back similar to this:

Code:
 grub> find /boot/grub/stage1
 (hd0,0)
This tells us the location (by drive and partion) of the correct drive from which to launch our boot manager.

Now.. still at the grub> prompt, type:

Code:
 root (hd0,0)
Obviously here replacing (hd0,0) with the returned result from the previous command.

Now type (also at the >grub prompt):

Code:
 setup (hd0)
And thats the first part done! Now reboot and your original grub boot loader will be restored!! Yippie!!

But hang about... now you have no entry for your shiny new FreeBSD install?!?!

Simply boot into your Linux O/S and enter a terminal. Then find your menu.lst file (usually located in /boot/grub/).

Edit this file using your usual editing program and add and entry to the the file.

Here is an example for you.. obviously replace the partition number with the correct one that you installed FreeBSD on!!

Code:
title           Ubuntu 9.04, kernel 2.6.28-13-generic (recovery mode)
uuid            f452a305-bdba-4f83-97a3-f87ecfdfc34c
kernel          /boot/vmlinuz-2.6.28-13-generic root=UUID=f452a305-bdba-4f83-97$
initrd          /boot/initrd.img-2.6.28-13-generic

title           Ubuntu 9.04, memtest86+
uuid            f452a305-bdba-4f83-97a3-f87ecfdfc34c
kernel          /boot/memtest86+.bin
quiet

title           FreeBSD 7.2
root            (hd0,2)
chainloader     +1
Usually on a generic Linux install it will be the same as above as your main partion will be 0,0 your swap partition will be 0,1 and therefore your FreeBSD partition will be 0,2.


I hope that anyone attempting to move into FreeBSD from Linux will find this How To usefull. I'm still very much a noob at this FreeBSD stuff .. but would like to share my journey with others also wishing to do the same.

__________________
"Do or Do Not.... there is no try."
Reply With Quote
  #2  
Old April 15th, 2010, 16:51
skido skido is offline
Junior Member
 
Join Date: Apr 2010
Location: Bamberg/Germany
Posts: 22
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thank u. I was searching this all the time. I want to move to FreeBSD too. But I don't have a clue, how to setup my wlan. And how to setup a gnome Desktop. Or the ports.....
Reply With Quote
  #3  
Old June 7th, 2010, 02:54
PhenomII PhenomII is offline
Junior Member
 
Join Date: Jun 2010
Location: the terminal (console)
Posts: 58
Thanks: 9
Thanked 4 Times in 3 Posts
Default

Thanks, that's a good post. I went the other way 'round, and installed FreeBSD first. Then plugged in a spare drive and installed Fedora 13 for comparison. Frdora happily installed grub and an entry for Frdora. But I was disappointed to NOT find an entry for the OGIGINAL install on the first harddrive; FreeBSD - which Fedora fully recognized. This led to much unscheduled reading on how to configure grub.

Thanks again.

__________________
8.1-PRERELEASE/amd64 | AMD PhenomII X3 440 | MSI 880GMA-E45 | NVIDIA G98 (8400 GS)

Reply With Quote
  #4  
Old August 19th, 2010, 17:08
mechanic mechanic is offline
Junior Member
 
Join Date: Jan 2010
Location: UK
Posts: 35
Thanks: 1
Thanked 0 Times in 0 Posts
Default

For those with a more recent Linux distro with Grub2 rather than Grub-legacy, these instructions:
http://grub.enbug.org/Grub2LiveCdInstallGuide
work and are easy to follow.
Reply With Quote
  #5  
Old September 12th, 2010, 18:40
Yampress's Avatar
Yampress Yampress is offline
Junior Member
 
Join Date: Aug 2010
Location: PL
Posts: 36
Thanks: 0
Thanked 3 Times in 2 Posts
Default

grub-install /dev/ad0 ...

Last edited by DutchDaemon; September 12th, 2010 at 22:55.
Reply With Quote
  #6  
Old October 12th, 2010, 00:28
Szputnik Szputnik is offline
Junior Member
 
Join Date: Oct 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Very useful post. Thanks!!
My entry for FreeBSD looks like this:

Code:
title           FreeBSD 8.1
rootnoverify    (hd0,a)
chainloader     +1
Using chainloader was necessary, as my grub doesn't recognize UFS2.
Reply With Quote
  #7  
Old October 12th, 2010, 08:31
sk8harddiefast's Avatar
sk8harddiefast sk8harddiefast is offline
Senior Member
 
Join Date: Mar 2010
Location: Athens, Greece
Posts: 1,722
Thanks: 215
Thanked 143 Times in 89 Posts
Default

Well. I will not use it but I also believe that is a useful post Well done!
__________________
====================================
| -------> UNIX. Live Free Or Die! <-------- |
====================================
You can say: I can't do something because is difficult.
You must say: I tried a lot before say that I can't.
Never Give up.
http://unixsystems.dyndns.org/
I am not an BSD expert. But I really want to help.
Don't afraid to ask me anything. If I can I will help!

Nice wallpapers to make your desktop more hardcore :) ---> http://forums.freebsd.org/showthread.php?t=13416
Reply With Quote
  #8  
Old July 17th, 2011, 08:44
joba1984 joba1984 is offline
Banned
 
Join Date: Jul 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the post ive just started using linux too so i myself am a bit of a noob but i want to gice freebsd a go so i will print this guide off and keep it next to my computer. many thanks gr1ml0ck
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] Windows Vista & FreeBSD (dual-boot problem) Anti_Evil Installing & Upgrading 4 June 24th, 2009 07:29
same asm-code is executed less time on WinXp&Linux than on FreeBSD v40 FreeBSD Development 4 April 24th, 2009 15:41
libc.so.6 && FMOD && FreeBSD Sa3r Userland Programming & Scripting 6 February 5th, 2009 11:54
WinXP&FreeBSD dual boot dima338 Installing & Upgrading 5 January 14th, 2009 17:54
restore a tar archive tape from linux gazj Networking 6 November 19th, 2008 14:44


All times are GMT +1. The time now is 21:26.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0