Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
My bootloader seems to be FUBAR. Please help, I'm going mad!
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
MidnightCommando
n00b
n00b


Joined: 15 May 2007
Posts: 19
Location: Sydney, Australia

PostPosted: Thu Jul 01, 2010 9:17 am    Post subject: My bootloader seems to be FUBAR. Please help, I'm going mad! Reply with quote

Hi guys.

I've somehow managed to completely break my bootloader.

Symptoms:
- System boots up to :
Code:
 Booting from CD/DVD... No
 GRUB loading...
 stage 1.5

and then suddenly my system reboots. Ad infinitum. As you can imagine, this is not the Gentoo Linux experience I'm used to.


This started when I attempted to compile memtest86+ with the floppy USE flag, thinking that it'd run from a floppy disk, thus allowing me to have a simple diagnostic disk.
It pulled in sys-boot/grub-0.97 as a dependency, and I didn't really think very hard about that (I'm pretty sure I was using sys-boot/grub-static beforehand).

Portage did its thing, I rebooted ready to use memtest86+ to check my memory, only to discover that I couldn't even get to the grub menu.

I hadn't done the grub-install thingy after emerging grub, which I thought may have done it. I have a 32-bit liveCD that's recent, no amd64 liveCDs (i need ext4 to work with my rootfs) ... and I don't have the ability to download a 64-bit liveCD. Chrooting into gentoo isn't an option at this stage due to the above consideration - I don't think I can force ext4 to mount as ext3 without doing A LOT of damage, somehow. (if I can, I might have a CD that would work.)

I did decide, from the 32-bit liveCD, to run
Code:
/mnt/gentoo/sbin/grub --no-floppy

and follow the instructions from the handbook for manual MBR installation of grub - to no avail; the same symptoms described above recurred.

All of my system is intact, except for the bootloader. I /really/ don't want to start again. I've invested too much time and energy into getting things just the way I like them over the past few years, and I'm not sure I care much for downloading all the source archives either, if I can't download something as comparatively small as a rescue CD.

Any help that members of the forums could offer would be appreciated so very much.

Thanks kindly,
-- Horst.
_________________
How many kernels must a geek compile, before he is called a geek?
The answer, my friend, is blowing in the wind, the answer is blowing in the wind.
Back to top
View user's profile Send private message
maltinator
n00b
n00b


Joined: 14 Jan 2004
Posts: 50
Location: Aachen, Germany

PostPosted: Thu Jul 01, 2010 10:17 am    Post subject: Reply with quote

Hi Horst,

Can you download sth. the size of floppy? In that case I would recomend the Suber Grub Disk. It's 1.44Mb small an fits on a floppy and ist great for restoring demaged grubs, or gives you the possibility to manually enter a boot command. So if you know your partition table, and were you stored your kernel, you just enter your stuff und can boot your beloved gentoo.

malte
_________________
De Oecher send der Düvel ze lous
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54317
Location: 56N 3W

PostPosted: Thu Jul 01, 2010 11:37 am    Post subject: Reply with quote

MidnightCommando,

grub-static is only needed by amd64/no-multilib purests. Grub is mostly 32 bit code that will not build in a no-multilib environment.
Since we can conclude that your grub built, you don't actually need grub-static, even if you were using it before.

I'm pretty sure that you have an old grub stage1/stage1.5 (in the area before the filesystem) and a new stage2 in /boot/grub.
As you say, all will be well again if you can install a grub to the MBR that matches the stage2 in /boot/grub

Grub patches its stage1 and stage1.5 during the install, so a dirty hack to fix that is unlikely - more later.
If you can boot a CD then mount your /boot you should be able to run the grub install manually.

To fix stage1 and stage1.5 you need someone with the same boot layout to donate you the first 63 sectors of their drive which contains the patched stage1 and stage1.5 that you need. It also contains their partition table, which you would not want.

You can mount some ext4 filesystems as ext3 ... it depends on the features you have used in ext4. If you try, you get an error from mount about unsupported features.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
MidnightCommando
n00b
n00b


Joined: 15 May 2007
Posts: 19
Location: Sydney, Australia

PostPosted: Thu Jul 01, 2010 12:06 pm    Post subject: Reply with quote

Vielen dank, maltinator! I know my disk geometry, and where the kernel is - I can also get hard copy of my grub.conf if i use ubuntu and transcribe the file to paper by hand (Finally, a worthy and epic use for my Lamy pen ehehe).

Repair would be lovely - I'll gladly settle just for having the ability to boot, though - I'm hardly averse to using a floppy on each reboot.


NeddySeagoon, I'm glad that you concur with my prognosis - as you say, a direct transplant of the entire Master Boot Record would be undesirable at best and damaging at worst.

I have attempted to rebuild grub several times already using the canonical procedure, to no avail - hopefully the Super Grub Disk mentioned by maltinator will afford me some better luck. I'll report back if it works, or doesn't.


Regards,
-- Horst.
_________________
How many kernels must a geek compile, before he is called a geek?
The answer, my friend, is blowing in the wind, the answer is blowing in the wind.
Back to top
View user's profile Send private message
MidnightCommando
n00b
n00b


Joined: 15 May 2007
Posts: 19
Location: Sydney, Australia

PostPosted: Thu Jul 01, 2010 1:16 pm    Post subject: Reply with quote

Good news and bad news. I was able to boot into Gentoo using the Super GRUB Disk ...

where i promptly rebuilt grub (just to be on the safe side), noticed the warning about doing grub-install this time around, did grub-install, rebooted to see if it worked ...

and landed back at square one.

What do, guys? I fear irrepairable damage to my 1337 system :P

(I can boot into gentoo manually from the grub commandline of the floppy disk - just can't seem to make grub "take" in the MBR properly it seems.)
_________________
How many kernels must a geek compile, before he is called a geek?
The answer, my friend, is blowing in the wind, the answer is blowing in the wind.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54317
Location: 56N 3W

PostPosted: Thu Jul 01, 2010 5:13 pm    Post subject: Reply with quote

MidnightCommando,

If you emerged grub, we know your grub binaries are self consistent.

Since you got the same issue after you reinstalled grub to the MBR, I conclude that the install failed, or it installed correctly but to the wrong place.
You might not have noticed the fail. Many BIOS provide boot sector virus protection. When that is on, writes to the MBR appear to work but nothing is written.

How many drives do you have?
Did you have any USB storage devices attached when you did the grub install?

Sight of your
Code:
fdisk -l
output would be good as would a copy of the command used to install grub and last but not least the device.map file, which shows how grub mapped kernel device names to grub device names.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
MidnightCommando
n00b
n00b


Joined: 15 May 2007
Posts: 19
Location: Sydney, Australia

PostPosted: Fri Jul 02, 2010 7:24 am    Post subject: Reply with quote

Code:
Disk /dev/sda: 320.1 GB, 320071851520 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
Disk identifier: 0x000dd677

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14         274     2096482+  82  Linux swap / Solaris
/dev/sda3             275       38913   310367767+  83  Linux

Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      182401  1465136001   83  Linux


To clarify: sda1 is ext2 and /boot, sda3 is ext3 and / - sdb1 is ext4 and /home .

I did not have any USB storage attached when I did the grub install, no.

The installation of grub was done with
Code:
# grub
> root (hd0,0)
> setup (hd0)
> quit
# logout


device.map follows:
Code:
(hd0)   /dev/sda


I believe my MBR is not invisibly protected, as initial GRUB installation was flawless. No BIOS option is present to switch this on or off, also...
_________________
How many kernels must a geek compile, before he is called a geek?
The answer, my friend, is blowing in the wind, the answer is blowing in the wind.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54317
Location: 56N 3W

PostPosted: Fri Jul 02, 2010 4:24 pm    Post subject: Reply with quote

MidnightCommando,

That looks good, except your device.map should have a line for /dev/sdb too
delete device.map and reinstall grub to the MBR. Check that device map has been updated
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
dol-sen
Retired Dev
Retired Dev


Joined: 30 Jun 2002
Posts: 2805
Location: Richmond, BC, Canada

PostPosted: Sat Jul 03, 2010 12:35 am    Post subject: Reply with quote

NeddySeagoon, MidnightCommando

Just be aware that grub can build in a 64 bit environment without dieing. I just did it in an selinux kvm. IT DID NOT RUN, just segfaults. The only installation error was missed by portage because the ebuild did not have the "|| die" added to the line that runs a "/sbin/grub --batch..." command near the end of the ebuild. So portage will think all is well and installed without a problem.


Oh, if you just complied a new kernel, make sure that you still have "IA32 Emulation" selected in "Executable file formats / Emulations --->" if you run a 64 bit system.
_________________
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54317
Location: 56N 3W

PostPosted: Sat Jul 03, 2010 1:21 pm    Post subject: Reply with quote

dol-sen,

That will be a bug then. I'm a /no-multilib/ 64 bit purest, so I have to use grub-static
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum