LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 12-02-2005, 02:01 AM   #1
Crushing Belial
Member
 
Registered: Mar 2005
Location: University of Massachusetts - Lowell
Distribution: Ubuntu, Win 7 Pro, Win 7 Enterprise
Posts: 126

Rep: Reputation: 15
Help with dual booting PC-BSD, and Debian


I recently installed PC-BSD on a spare hard drive, and during the installation, I chose not to touch the MBR, since I had Debian/GRUB installed on my main drive. After everything finished, and I rebooted, my only option was to boot PC-BSD, and GRUB never comes up. Is there a way I can add Debian, which is on hdb (slave) to the PC-BSD loader, or vice versa?

Also, I reinstalled PC-BSD, and I told it to modify the MBR, hoping it would fix things, and it's still the same. I also originally thought GRUB was installed on the MBR, but I think it's actually just on the Debian drive. If someone could shed light on all this, I'd really appreciate it.

Last edited by Crushing Belial; 12-02-2005 at 02:03 AM.
 
Old 12-02-2005, 02:41 AM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
You could boot your system using a live cd like knoppix, chroot to your Debian root partition and reinstall grub to the mbr. You can add an grub entry for PC-BSD which looks something like below,
Code:
title PC-BSD
root (hd1,0,a)
kernel /boot/loader
 
Old 12-02-2005, 03:15 AM   #3
Crushing Belial
Member
 
Registered: Mar 2005
Location: University of Massachusetts - Lowell
Distribution: Ubuntu, Win 7 Pro, Win 7 Enterprise
Posts: 126

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by reddazz
You could boot your system using a live cd like knoppix, chroot to your Debian root partition and reinstall grub to the mbr. You can add an grub entry for PC-BSD which looks something like below,
Code:
title PC-BSD
root (hd1,0,a)
kernel /boot/loader
How can I easily reinstall GRUB to the MBR?
 
Old 12-02-2005, 03:45 AM   #4
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Quote:
Originally posted by Crushing Belial
How can I easily reinstall GRUB to the MBR?
I already gave you a hint in my initial post. Boot your system using a live cd such as knoppix or mepis, switch to root and then chroot to your Debian root partition and then do "gub-install /dev/hda".
 
Old 12-02-2005, 04:04 AM   #5
Crushing Belial
Member
 
Registered: Mar 2005
Location: University of Massachusetts - Lowell
Distribution: Ubuntu, Win 7 Pro, Win 7 Enterprise
Posts: 126

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by reddazz
I already gave you a hint in my initial post. Boot your system using a live cd such as knoppix or mepis, switch to root and then chroot to your Debian root partition and then do "gub-install /dev/hda".
Code:
Kanotix:/# grub-install /mnt/hdb1
Format of install_device not recognized.
Usage: grub-install [OPTION] install_device
Install GRUB on your drive.

  -h, --help              print this message and exit
  -v, --version           print the version information and exit
  --root-directory=DIR    install GRUB images under the directory DIR
                          instead of the root directory
  --grub-shell=FILE       use FILE as the grub shell
  --no-floppy             do not probe any floppy drive
  --force-lba             force GRUB to use LBA mode even for a buggy
                          BIOS
  --recheck               probe a device map even if it already exists

INSTALL_DEVICE can be a GRUB device name or a system device filename.

grub-install copies GRUB images into the DIR/boot directory specfied by
--root-directory, and uses the grub shell to install grub into the boot
sector.

Report bugs to <bug-grub@gnu.org>.
Kanotix:/#
What am I missing?

Last edited by Crushing Belial; 12-02-2005 at 04:19 AM.
 
Old 12-02-2005, 04:29 AM   #6
mugstar
Member
 
Registered: Jun 2004
Location: Scotland
Distribution: Anything that'll install...
Posts: 305

Rep: Reputation: 30
You're trying to install GRUB to a mountpoint. Try again using /dev/hda, as Reddazz told you - that's where the MBR is located. Make sure you don't ignore the chroot step.
 
Old 12-02-2005, 05:02 AM   #7
Crushing Belial
Member
 
Registered: Mar 2005
Location: University of Massachusetts - Lowell
Distribution: Ubuntu, Win 7 Pro, Win 7 Enterprise
Posts: 126

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by mugstar
You're trying to install GRUB to a mountpoint. Try again using /dev/hda, as Reddazz told you - that's where the MBR is located. Make sure you don't ignore the chroot step.
Code:
knoppix@2[knoppix]$ su
root@2[knoppix]# chroot /mnt/hdb1
Kanotix:/# grub-install /dev/hda
/sbin/grub-install: line 485: /dev/null: Permission denied
/sbin/grub-install: line 487: /dev/null: Permission denied
/sbin/grub-install: line 485: /dev/null: Permission denied
/sbin/grub-install: line 487: /dev/null: Permission denied
/sbin/grub-install: line 485: /dev/null: Permission denied
/sbin/grub-install: line 487: /dev/null: Permission denied
/sbin/grub-install: line 485: /dev/null: Permission denied
/sbin/grub-install: line 487: /dev/null: Permission denied
/sbin/grub-install: line 485: /dev/null: Permission denied
/sbin/grub-install: line 487: /dev/null: Permission denied
The file /boot/grub/stage1 not read correctly.
Kanotix:/#
 
Old 12-02-2005, 05:22 AM   #8
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Have you tried switching to root using "su -" instead of "su". Also try another live cd, I have done the same procedure using knoppix.
 
Old 12-02-2005, 05:50 AM   #9
Crushing Belial
Member
 
Registered: Mar 2005
Location: University of Massachusetts - Lowell
Distribution: Ubuntu, Win 7 Pro, Win 7 Enterprise
Posts: 126

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by reddazz
Have you tried switching to root using "su -" instead of "su". Also try another live cd, I have done the same procedure using knoppix.
Using "su -" gives me the same thing.
 
Old 12-02-2005, 08:12 AM   #10
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
OK

You can do it another way if grub-install proves stubborn.

After chroot to Debian you can invoke a Grub shell by typing

grub
root (hd0,1) <----------------I am ssuming your Debian in hda2, make adjustment yourself if it isn't.
setup (hd0) <----------------tell Grub to replicate Grub from the above root partition into the whole disk, which is the MBR
exit
reboot

PCBSD should be a booting choice in your Debian if you have implemented the reddaz's suggestion in #2 post, except I think hd1 should be hd0 unless you install everything in the second disk. Grub always count from 0.

Since you claimed to have denied PCBSD access to the MBR and this should have forced PCDBSD to install its boot loader inside it root partition. Therefore it can be chainloaded out in Grub by these 2 lines

title PSBSD in hda1
chainloader (hd0,0)+1

or Lilo by these 2 lines

other=/dev/hda1
label=PCBSD
 
Old 12-03-2005, 12:17 AM   #11
Crushing Belial
Member
 
Registered: Mar 2005
Location: University of Massachusetts - Lowell
Distribution: Ubuntu, Win 7 Pro, Win 7 Enterprise
Posts: 126

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by saikee
OK

You can do it another way if grub-install proves stubborn.

After chroot to Debian you can invoke a Grub shell by typing

grub
root (hd0,1) <----------------I am ssuming your Debian in hda2, make adjustment yourself if it isn't.
setup (hd0) <----------------tell Grub to replicate Grub from the above root partition into the whole disk, which is the MBR
exit
reboot

PCBSD should be a booting choice in your Debian if you have implemented the reddaz's suggestion in #2 post, except I think hd1 should be hd0 unless you install everything in the second disk. Grub always count from 0.

Since you claimed to have denied PCBSD access to the MBR and this should have forced PCDBSD to install its boot loader inside it root partition. Therefore it can be chainloaded out in Grub by these 2 lines

title PSBSD in hda1
chainloader (hd0,0)+1

or Lilo by these 2 lines

other=/dev/hda1
label=PCBSD
Code:
GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

       [ Minimal BASH-like line editing is supported.   For
         the   first   word,  TAB  lists  possible  command
         completions.  Anywhere else TAB lists the possible
         completions of a device/filename. ]

grub> root (hd1,0)

Error 21: Selected disk does not exist

grub>
root (hd1,0) doesn't work. I checked the GRUB menu list, and that's what it has, so I don't understand why it's not working.
 
Old 12-03-2005, 04:14 AM   #12
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Your root is should be "hd0,1" .
 
Old 12-03-2005, 04:22 AM   #13
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
To investigate if (hd1,0) exists or not is to invoke a Grub shell, then type

geometry (hd0)
geometry (hd1)

to see how Grub sees your partitions.

Do a fdisk -l while in Linux also help. There is a chance the geometry of the hard disk may be in trouble.
 
Old 12-03-2005, 01:31 PM   #14
qs_tahmeed
Member
 
Registered: Nov 2003
Location: Bangladesh
Posts: 101

Rep: Reputation: 15
It may sound silly - I faced a problem of HardDisk Boot Priority. But I was installing Solaris in the Slave HDD.

PLS Check which HDD comes first in case of booting. Have to do it
from BIOS.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dual boot WinXP/Debian, grub error booting WinXP ChemBot Linux - General 5 02-22-2007 04:13 PM
dual booting solaris and debian sh4d0w13 Linux - General 1 03-03-2005 01:57 PM
LILO/GRUB for dual booting Gentoo and Debian. rmanocha Linux - Software 2 02-22-2004 01:23 PM
Dual Booting Debian w/ RH9 General_Tso Debian 9 07-19-2003 06:54 AM
Debian - 2 issues: dual booting & SiS900 module glc Linux - General 0 10-22-2001 02:45 AM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 03:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration