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 2 of 3 1 2 3
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 03-Jul-2009, 15:09
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

Quote:
You didn't say what kind of drive sda was, is it SATA?
sda is SATA, sdb is IDE

Quote:
You didn't say what the mount points of sda[567] are.
sda5 is /
sda6 is swap
sda7 is /home

I didn't create a partition for /boot. Sources I checked didn't list it as necessary and it wasn't mentioned in another installation thread I was talking in.

Quote:
mount /dev/sda5 /media/root
mount /dev/sda6 /media/root/boot
grub-install blah blah...
grub-install --root-directory=/media/root /dev/sda
I took these steps except I didn't mount /boot since I don't have a separate partition for it. Do I need to mount the /boot directory or something?

Quote:
Seems to me to indicate that you've put the Grub boot code for sda onto a high partition rather than in the MBR.
Yes, this is certainly the case. I remember checking off MBR during install, but it must have put it in MBR of sdb instead of sda. As previously discussed, I tried to reinstall grub on sda with sdb disconnected, but I get the same error. I believe I'll try ken_yap's suggestion of installing grub to /dev/sda instead of any particular partition and see what that does.
Reply With Quote
  #12 (permalink)  
Old 03-Jul-2009, 19:36
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,218
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

Let us know how it goes.
Reply With Quote
  #13 (permalink)  
Old 03-Jul-2009, 20:58
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

Just tried it this evening and nothing. Same error about GRUB being over the maximum number of cylinders on the HDD. What exactly is the MBR? Is it a special spot with space set aside?

I'm thinking when I run the grub-install it must be doing something to the MBR because the windows boot loader is no longer there. I get the error instead of windows starting right up. But something must also be going on elsewhere on the HDD if the error is about being above a max cylinder.
Reply With Quote
  #14 (permalink)  
Old 03-Jul-2009, 21:14
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,218
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

MBR is the first sector of the disk, which also contains the partition table. Also the first track of the disk is reserved for bootloaders. This initial GRUB code loads the stage2 bootloader and after that the kernel and initrd in the /boot directory.

Anything loaded by GRUB has to be reachable by the BIOS because that's all that GRUB has to do disk I/O. On older BIOSes, there is a 128GiB limit due to the size of the arguments to the BIOS I/O calls. It looks like your boot files are beyond this limit. That is why some machines require a /boot partition on the lower cylinders of the disk.

To fix this you need to put the boot files below the 128GiB mark. You may be able to use a gparted rescue to shrink / enough to insert a /boot partition before it and copy the boot files there.
Reply With Quote
  #15 (permalink)  
Old 03-Jul-2009, 21:25
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,218
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

Oh there's one more thing worth checking. If the BIOS offers you the choice of native SATA handling or IDE emulation, try the former.
Reply With Quote
  #16 (permalink)  
Old 04-Jul-2009, 08:12
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

Okay, so the bootloader in the MBR is, in effect, calling to the installation location of GRUB (/boot) and because I have that located on sda5, which is above the 1024 limit, it won't work. So the EISA partition is causing problems. I need to move it out of the way and setup a /boot partition at the beginning of the disk and then install GRUB to that location. I think I have a copy of gparted lying around somewhere, so I'll try to find it and give this a try. I'll fill you in on the results.
Reply With Quote
  #17 (permalink)  
Old 04-Jul-2009, 08:40
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,218
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

Not so fast, there are a few odd things about your situation.

The 1024 cylinder (500MB) limit is really old, it is only found on BIOSes older than 15 years or so.

The 128GiB limit is about 10 years old.

Looking at your partition sizes the puzzling thing is that your first Linux partition should be under the 128GiB limit. Also it did manage to load the kernel when the boot sector was on sdb.

So something fishy is going on.

Do you get an interactive GRUB prompt? If so what happens if you do this:

root (hd0,4)
kernel /boot/vm

At this point you can try to do file completion with TAB and see if you get the BIOS limit message.

You can also try to start GRUB from a rescue disk and see if you can interactively load the kernel.

Also did stage 1.5 get loaded, it should say what stages it is loading. And do you still get the reference to (hd1,4)/boot/message?

Another thing is your menu.lst might be wrong. When you had the IDE disk in place, the SATA disk would pushed back to hd1. Now that you have removed the IDE disk, the SATA disk is back at hd0. So all references to hd1 in menu.lst would have to edited to hd0. That would explain the (hd1,4)/boot/message not found.
Reply With Quote
  #18 (permalink)  
Old 04-Jul-2009, 12:16
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'll have to try your suggestions on monday when i'm back in my office. I believe it does load stage 1.5 and then I get the (hd1,4)/boot/message error.

When I used the grub-install... command with liveCD, shouldn't that have created a new /boot/menu.lst that references hd0 instead of hd1 automatically?
Reply With Quote
  #19 (permalink)  
Old 04-Jul-2009, 19:33
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,218
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

No, grub-install doesn't touch menu.lst. There would be howls of protest if it did since it contains all the info about what OSes are available. In fact menu.lst can be edited at will any time, that's the advantage of GRUB over LILO.

To be really sure of what GRUB is installing, do the steps by hand from the rescue system, after editing menu.lst:

# grub
grub> device (hd0) /dev/sda
grub> root (hd0,4)
grub> setup (hd0)

At this point you will get messages about embedding various parts of GRUB on the disk.
Reply With Quote
  #20 (permalink)  
Old 05-Jul-2009, 16:55
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

Bravo, man, that did the trick. I simply opened up menu.lst with vi and changed all the hd1's to hd0's (and two hd0's to hd1's). Shutdown, pulled the IDE hardrive, started it up and GRUB popped right up. No need to reinstall or use the rescue system. Thanks a lot for the clever solution.
Reply With Quote
Reply
Page 2 of 3 1 2 3

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