LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Installed Debian on secondary hard drive, but can't boot (https://www.linuxquestions.org/questions/debian-26/installed-debian-on-secondary-hard-drive-but-cant-boot-4175414554/)

Cramps 07-02-2012 10:16 PM

Installed Debian on secondary hard drive, but can't boot
 
Hello. I'm new to this forum and Linux in general. I wasn't sure whether I should post this here since it's Debian-related or in Linux - Newbie. I apologize for any inconveniences this may bring!

Alright, so I installed Debian to my laptop and it worked perfectly fine. Now I'm trying to run Debian on my desktop computer, but something seems to have gone wrong and I have run out of ideas!
My desktop runs Windows 7 on sda, and I've got two extra hard drives, sdb and sdc. I formatted sdc and then installed Debian on it. At the end of the installation, it asked me if I wanted to install GRUB on master boot, and I agreed to, however, when I turn the computer on it just runs into Windows 7 as if GRUB had never been installed. I tried reinstalling Debian and making sure I accepted the GRUB installation and it didn't work.

So then I said, "oh, well, no GRUB... that's alright for now, I'll just use BIOS to boot using the hard disk I installed Debian in", but it didn't work. All I saw was a black screen. Is that normal? I want GRUB, but do I need GRUB to run the kernel or should I be able to boot Debian through BIOS? Since I have Windows 7 on sda, do I need to configure GRUB somehow for it to work?

I also ran the Debian CD in Rescue mode which allowed me to open shell as root when mounting on sdc1, so I guess the Debian installation succeeded, but as I said, there's no GRUB for me to choose Debian from and booting from BIOS isn't working. What am I doing wrong here? Did I miss something?

I'm sorry for the question bombardment, and I'm looking forward to reading your replies. Any help is not only welcome but also well appreciated.

Thanks for your time,
Cramps

pixellany 07-02-2012 10:50 PM

Try this:

Boot up from any Linux LiveCD (I think your Debian CD qualifies)

Open a terminal and do "fdisk -l" to determine which drive is which. Mount the drive (partition) with Debian and check to be sure that /boot/grub/menu.lst is there--and that it is correct for that installation.

Then run the grub shell and install grub to that drive

Now it should be selectable and bootable from the BIOS setup.



Let me know if I've lost you somewhere and I'll back up. Also, I'm hoping that Debian uses grub 0.97---I'm not smart about grub-2

Hungry ghost 07-02-2012 10:53 PM

Hi, and welcome to LQ.

As for your issue, boot some Linux live CD, download the bootinfo script, become root and execute it like this:

Code:

./bootinfoscript
Then post the RESULTS.txt file here, so we can know where the problem is.

edit: Didn't see pixellany's reply before posting.

cynwulf 07-03-2012 04:20 AM

Quote:

Originally Posted by pixellany (Post 4717727)
Let me know if I've lost you somewhere and I'll back up. Also, I'm hoping that Debian uses grub 0.97---I'm not smart about grub-2

Debian uses grub2.

I would suspect that your grub was installed to the MBR of one drive, but the grub files probably reside on another. Try booting from the install CD with just the drive you installed Debian on connected up. chroot into the system and
Code:

# grub-install /dev/sda
(or sdb, sdc, etc)
Code:

# update-grub
Then shutdown, connect up the other HDD(s) and see if you can boot into the system, if it boots, once you're logged in
Code:

# os-prober && update-grub
That should add the grub entries to chain load other OS.

(I advise to remove the drives you're not installing on, as udev detects and sets up storage devices in an order you may not find intuitive, it's easy for a noob to hose existing operating systems if they're not careful...)

Cramps 07-03-2012 05:10 AM

Quote:

Originally Posted by pixellany (Post 4717727)
Open a terminal and do "fdisk -l" to determine which drive is which. Mount the drive (partition) with Debian and check to be sure that /boot/grub/menu.lst is there--and that it is correct for that installation.

Then run the grub shell and install grub to that drive

Thanks a lot, everybody. pixellany had me a little lost at first but I somehow managed to figure it out and get it to work. It was indeed what caravel suspected: the grub was installed on a disk, sda, however my master boot drive is actually sdb, which is my Windows 7 drive. "fdisk -l" helped me determine that. I got it to work by simply using:
Code:

# grub-install /dev/sdb
Problem solved!


All times are GMT -5. The time now is 08:01 PM.