openSUSE Forums > Install/Boot/Login » Installing GRUB after removing HDD

Go Back   openSUSE Forums > Install/Boot/Login
Forums FAQ Members List Search Today's Posts Mark Forums Read


Install/Boot/Login Questions about installation, login, boot issues, partitioning, file systems, software that runs at boot (GRUB, LILO, boot scripts)

Reply
Page 1 of 3 1 23
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-Jul-2009, 11:06
Student Penguin
 
Join Date: Jun 2009
Location: State College, PA USA
Posts: 65
rks171 hasn't been rated much yet
Default Installing GRUB after removing HDD

First off, here's a printout of the hardrives on my system.

Code:
Disk /dev/sda: 640.1 GB, 640135028736 bytes
255 heads, 63 sectors/track, 77825 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x87df9c9a

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        1275    10241406   27  Unknown
/dev/sda2   *        1276        7649    51199155    7  HPFS/NTFS
/dev/sda3            7650       77825   563688720    5  Extended
/dev/sda5            7650        9474    14659281   83  Linux
/dev/sda6            9475       10448     7823623+  83  Linux
/dev/sda7           10449       77825   541205721   83  Linux

Disk /dev/sdb: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x9dc96e9e

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1           4       32098+  de  Dell Utility
/dev/sdb2   *           5        4865    39045982+   f  W95 Ext'd (LBA)
/dev/sdb5               5        4865    39044096    7  HPFS/NTFS
Linux is installed on sda5, 6, 7 as you can see. Windows is on sda2, and sda1 is the EISA partition that came with my computer for resetting back to factory settings. sdb is a secondary hardrive used for backing up files. When I installed SUSE 11.1, GRUB was installed onto sdb for some reason. This is the HDD that my computer boots to during startup. I removed the HDD without remembering that GRUB was on it and during startup it went right to XP. So I booted from LiveCD, opened up a terminal and did the following:

Code:
# mkdir /media/root
# mount /dev/sda5 /media/root
# grub-install --root-directory=/media/root /dev/sda#
In place of #, I tried sda5 and sda1 when sda5 didn't work. Either way, this pops up the GRUB installer window. I tried selecting boot from MBR when I selected both sda5 and sda1, but either way, I get the same error during reboot after it says loading GRUB.

(hd1,4)/boot/message: file not found

Then it goes to an MS-DOS looking boot menu that lists OpenSUSE 11.1 and Windows. I try selecting either one and I get the error:

Error 18: Selected cylinder exceeds max. supported by BIOS.

I have a feeling it's my EISA partition, which is at the beginning of my HDD that's screwing stuff up by taking up all the cylinders at the beginning of my HDD, but then again, how does the Windows boot loader work then? BTW, I want to remove the secondary HDD, but I need to first get GRUB working from sda.
Reply With Quote
  #2 (permalink)  
Old 02-Jul-2009, 12:36
caf4926's Avatar
Global Moderator
 
Join Date: Jun 2008
Location: The English Lake District. UK - GMT/BST
Posts: 12,769
caf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputation
Send a message via MSN to caf4926
Default Re: Installing GRUB after removing HDD

HowTo Boot into openSUSE when it won't Boot from the Grub Code on the Hard Drive
__________________
Box: Fedora 11 | (KDE4.3.2) | M2N4-SLI | AMD 64 X2 5200+ | nVidia 8500GT | 4GB RAM
Lap: openSUSE 11.2 | Celeron 550 | (KDE4.3.3)"3" | Intel 965 GM | Lenovo R61e | 3GB RAM
Reply With Quote
  #3 (permalink)  
Old 02-Jul-2009, 13:46
Student Penguin
 
Join Date: Jun 2009
Location: State College, PA USA
Posts: 65
rks171 hasn't been rated much yet
Default Re: Installing GRUB after removing HDD

I tried...

Broken Grub menu: boot to the menu, drop to a console and boot openSUSE direct

...and it seemed like it booted, but it didn't go to the GUI. It ended up asking me for linux login. I tried typing but couldn't. As a note, I have to add noacpi acpi=off to my boot menu to make the mouse and keyboard work.

I tried...

Reinstall Grub in the Master Boot Record and link it to the existing Grub menu in openSUSE

... and it caused the same error as the first time. Error 18: file not found. BIOS doesn't support booting from above such and such cylinder.

I tried...

Boot from the SuperGrub Disk: see Super Grub Disk Homepage

... and again got the same error as originally

I couldn't try the last option in your link because I could never boot into SUSE without that second hard drive connected. I assume if I choose MBR in YaST in my current configuration (with the sdb still attached) it will just put it in the MBR of sdb, which wouldn't get me anywhere.

I feel like I need to get GRUB installed at the beginning of my hard drive. Is there any way I can move that EISA partition at the beginning of the hard drive to that secondary hard drive in SUSE?
Reply With Quote
  #4 (permalink)  
Old 02-Jul-2009, 14:12
caf4926's Avatar
Global Moderator
 
Join Date: Jun 2008
Location: The English Lake District. UK - GMT/BST
Posts: 12,769
caf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputation
Send a message via MSN to caf4926
Default Re: Installing GRUB after removing HDD

I doubt it the recovery partition that's causing the problem.

Ideally you would keep the other HD (sdb) in place, and have grub on there - as you say it has been. This is better IMO as it helps preserve the integrity of sda

The CRUCIAL thing is boot order, and in the case of both being SATA drives you may actually have to change the order they are plugged in to the mobo. If sdb is a pata/ide drive it's ok, but it needs to be Master on the jumper.

Principle ideas here:
Partitioning/Install Guide - openSUSE Forums
__________________
Box: Fedora 11 | (KDE4.3.2) | M2N4-SLI | AMD 64 X2 5200+ | nVidia 8500GT | 4GB RAM
Lap: openSUSE 11.2 | Celeron 550 | (KDE4.3.3)"3" | Intel 965 GM | Lenovo R61e | 3GB RAM
Reply With Quote
  #5 (permalink)  
Old 02-Jul-2009, 14:17
Student Penguin
 
Join Date: Jun 2009
Location: State College, PA USA
Posts: 65
rks171 hasn't been rated much yet
Default Re: Installing GRUB after removing HDD

sdb is IDE and the jumper is set to cable-select. If you're saying that sdb has to stay, though, then I guess I don't have to change anything since SUSE loads fine with the second hard drive connected. I'll just keep the disk on as a place to make backups and stop fudging with the bootloader.

Thanks for the help.
Reply With Quote
  #6 (permalink)  
Old 02-Jul-2009, 14:31
caf4926's Avatar
Global Moderator
 
Join Date: Jun 2008
Location: The English Lake District. UK - GMT/BST
Posts: 12,769
caf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputation
Send a message via MSN to caf4926
Default Re: Installing GRUB after removing HDD

Set sdb to Master!
Then first in the boot order and if it were me, I would seriously consider re-installing suse.
Double check that grub is going to MBR on sdb

This pic shows it (though it has sda not sdb)
http://files.myopera.com/carl4926/albums/671478/19.png

Double check back here again at the summary that is shows sdb MBR and hasn't reverted back to something else, if it does there is something wrong in bios settings
http://files.myopera.com/carl4926/albums/671478/16.png
__________________
Box: Fedora 11 | (KDE4.3.2) | M2N4-SLI | AMD 64 X2 5200+ | nVidia 8500GT | 4GB RAM
Lap: openSUSE 11.2 | Celeron 550 | (KDE4.3.3)"3" | Intel 965 GM | Lenovo R61e | 3GB RAM
Reply With Quote
  #7 (permalink)  
Old 02-Jul-2009, 14:45
Student Penguin
 
Join Date: Jun 2009
Location: State College, PA USA
Posts: 65
rks171 hasn't been rated much yet
Default Re: Installing GRUB after removing HDD

I could set sdb to master and it already is first in line for booting.

As for reinstalling SUSE, I'll consider it, but I've already lost so much productivity dealing with the first install, I really don't think I have the time to go at it again (especially if it's as painful as the first install). Are the consequences dire? GRUB is already on MBR of sdb, isn't it?
Reply With Quote
  #8 (permalink)  
Old 02-Jul-2009, 17:31
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,187
ken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud of
Default Re: Installing GRUB after removing HDD

You didn't say what kind of drive sda was, is it SATA? If sda is SATA and sdb is PATA, that would explain why the system reverted to sda when sdb was removed. When you have a mixed system like that, there can also be a preferred booting order where PATA overrrides SATA if installed.

When you removed sdb, it reverted to the original setup. So situation at that point is one where you have installed Linux but have no GRUB at all. So the original Windows bootloader took over.

You didn't say what the mount points of sda[567] are. Those are important. When you install GRUB, using a rescue CD, /boot must be mounted in the same relative position as it would be when running. I suspect that 5 is / and 6 is boot, but you would have to look at /etc/fstab (on sda?) to tell. Then what you have to do is:

mount /dev/sda5 /media/root
mount /dev/sda6 /media/root/boot
grub-install blah blah
Reply With Quote
  #9 (permalink)  
Old 02-Jul-2009, 17:41
swerdna's Avatar
Global Moderator
 
Join Date: Mar 2008
Location: Oz
Posts: 4,831
swerdna is a reputation jewel in the roughswerdna is a reputation jewel in the roughswerdna is a reputation jewel in the roughswerdna is a reputation jewel in the roughswerdna is a reputation jewel in the rough
Default Re: Installing GRUB after removing HDD

This stuff:
Quote:
....but either way, I get the same error during reboot after it says loading GRUB.

(hd1,4)/boot/message: file not found

Then it goes to an MS-DOS looking boot menu that lists OpenSUSE 11.1 and Windows. I try selecting either one and I get the error:

Error 18: Selected cylinder exceeds max. supported by BIOS.
Seems to me to indicate that you've put the Grub boot code for sda onto a high partition rather than in the MBR. Maybe you could try an experiment to see if the setup is at all conducive to booting off of sda. If the sdb is disconnected (pull drive power cable), does a grub menu at all come up when u boot sda or does it go straight to windows bootloader (I know you said something about that but I'm a bit lost)? i.e. when you get the "msdos looking menu", if you press Escape, what happens?
__________________
Drop in and visit some time.
Reply With Quote
  #10 (permalink)  
Old 02-Jul-2009, 17:44
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,187
ken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud of
Default Re: Installing GRUB after removing HDD

Quote:
Originally Posted by ken_yap View Post
mount /dev/sda5 /media/root
mount /dev/sda6 /media/root/boot
grub-install blah blah
Ah yes, re Swerdna's point, the last line cannot be business as usual. You should use:

grub-install --root-directory=/media/root /dev/sda

not a partition. This will install in the MBR.
Reply With Quote
Reply
Page 1 of 3 1 23

Bookmarks

Tags
boot, grub


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
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2