Unix Technical Forum

Problems reinstalling grub/lilo (they always hang at boot time ...)

This is a discussion on Problems reinstalling grub/lilo (they always hang at boot time ...) within the Linux Operating System forums, part of the Unix Operating Systems category; --> I suddenly cannot boot my ubuntu (5.04) linux system anymore (nor windows). Everything worked fine until yesterday, but since ...


Go Back   Unix Technical Forum > Unix Operating Systems > Linux Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-18-2008, 05:47 PM
Olaf
 
Posts: n/a
Default Problems reinstalling grub/lilo (they always hang at boot time ...)

I suddenly cannot boot my ubuntu (5.04) linux system anymore (nor windows).
Everything worked fine until yesterday, but since I last shut down my linux
system I cannot boot any OS

Grub hangs after displaying the following messages:

Grub loading Stage1.5
Grub loading, please wait...

I've booted my system via the SystemRescueCD and
I've followed the instructions on the Grub wiki
http://grub.enbug.org/GrubLegacy in the troubleshooting section, but
unfortunately without any success. Using the described method via chroot
actually does not work since grub-install then cannot find "sort" and other
tools. But if I only mount the /boot partition I can then reinstall grub,
but the loader then still hangs ...

One possible problem I've noticed is, that I get a warning when I mount
the /boot partition. It is a ext3 partition, but is only mounted as ext2
(ext2_fill_super warning). Is there anything I need to (can) do about this?

Next I tried to install lilo:

I booted via SysRescCD and mounted /dev/hdb1 as /boot
and /dev/mapper/vg00-root as /mnt/sysimage. I then ran

lilo -C /mnt/sysimage/etc/lilo.conf -b /dev/hdb

Unfortunately this also results in lilo hanging as follows:

LIL

I would appreciate any help in order to get my linux system booted again

My setup is as follows:
/dev/hda - used for Windows XP (Windows actually also fails to boot)
/dev/hdb Ubuntu, with /root and /home dirs via LVM,
/boot on /dev/hdb1 (ext3)

I used to chainload grub via the XP bootloader.

Thanks,
Olaf
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-18-2008, 05:47 PM
Douglas Mayne
 
Posts: n/a
Default Re: Problems reinstalling grub/lilo (they always hang at boot time ...)

On Tue, 25 Apr 2006 00:42:05 +0200, Olaf wrote:

> I suddenly cannot boot my ubuntu (5.04) linux system anymore (nor windows).
> Everything worked fine until yesterday, but since I last shut down my linux
> system I cannot boot any OS


Were you making changes to your system? Did you accidentally delete files
from /boot/grub?

>
> Grub hangs after displaying the following messages:
>
> Grub loading Stage1.5
> Grub loading, please wait...
>
> I've booted my system via the SystemRescueCD and
> I've followed the instructions on the Grub wiki
> http://grub.enbug.org/GrubLegacy in the troubleshooting section, but
> unfortunately without any success. Using the described method via chroot
> actually does not work since grub-install then cannot find "sort" and other
> tools. But if I only mount the /boot partition I can then reinstall grub,
> but the loader then still hangs ...
>
> One possible problem I've noticed is, that I get a warning when I mount
> the /boot partition. It is a ext3 partition, but is only mounted as ext2
> (ext2_fill_super warning). Is there anything I need to (can) do about this?


I don't use ext3, but I know an initial ramdisk may be required to load
the ext3 kernel module. Without the module, then it may be fall back to
use ext2 (since ext2 is backward compatible with ext3). You can use an
ext3 partition for strictly boot purposes, but when you start mounting
devices you need to have all of the necessary kernel modules loaded.
Also, your /etc/fstab file should specify the ext3 filesystem for the
partition in question.

>
> Next I tried to install lilo:
>
> I booted via SysRescCD and mounted /dev/hdb1 as /boot and
> /dev/mapper/vg00-root as /mnt/sysimage. I then ran
>
> lilo -C /mnt/sysimage/etc/lilo.conf -b /dev/hdb
>
> Unfortunately this also results in lilo hanging as follows:
>
> LIL
>
> I would appreciate any help in order to get my linux system booted again
>
>
> My setup is as follows:
> /dev/hda - used for Windows XP (Windows actually also fails to boot)


> /dev/hdb Ubuntu, with /root and /home dirs via LVM,
> /boot on /dev/hdb1 (ext3)
>
> I used to chainload grub via the XP bootloader.


Do you mean that you use grub to chainload XP, similar to this:

title Windows
rootnoverify (hd0,0)
makeactive
chainloader +1


>
> Thanks,
> Olaf
>

Decide which loader you want to use, then concentrate on fixing that
loader. I looked at the wiki you referenced, which says grub can hang at
this point if the grub files are damaged. Presumably, you would fix the
files at /boot/grub. Did you attempt to do that?

I don't use ubuntu. Perhaps, reinstalling the grub package will restore
your grub directory. I'll wait for your reply before posting more. I
don't use lilo.

--
Douglas Mayne
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-18-2008, 05:47 PM
Olaf
 
Posts: n/a
Default Re: Problems reinstalling grub/lilo (they always hang at boot time ...)

Douglas,

I'm pretty sure I did not change anything in the /boot/grub directory. I
actually had backups of the bootsectors (first 512 byte of the harddisks)
and they were unaltered (or do these only contain the partition table?).

I did reinstall the files in the /boot/grub directory via grub-install but
the loader still hangs.

I used to load grub from the XP bootloader (and not the other way around as
you suggested), but for now I'm happy if I can directly boot from the disk
where the grub boot loader is located (/dev/hdb).

Thanks for your comments,
Olaf

Douglas Mayne wrote:

> On Tue, 25 Apr 2006 00:42:05 +0200, Olaf wrote:
>
>> I suddenly cannot boot my ubuntu (5.04) linux system anymore (nor
>> windows). Everything worked fine until yesterday, but since I last shut
>> down my linux system I cannot boot any OS

>
> Were you making changes to your system? Did you accidentally delete files
> from /boot/grub?
>
>>
>> Grub hangs after displaying the following messages:
>>
>> Grub loading Stage1.5
>> Grub loading, please wait...
>>
>> I've booted my system via the SystemRescueCD and
>> I've followed the instructions on the Grub wiki
>> http://grub.enbug.org/GrubLegacy in the troubleshooting section, but
>> unfortunately without any success. Using the described method via chroot
>> actually does not work since grub-install then cannot find "sort" and
>> other tools. But if I only mount the /boot partition I can then reinstall
>> grub, but the loader then still hangs ...
>>
>> One possible problem I've noticed is, that I get a warning when I mount
>> the /boot partition. It is a ext3 partition, but is only mounted as ext2
>> (ext2_fill_super warning). Is there anything I need to (can) do about
>> this?

>
> I don't use ext3, but I know an initial ramdisk may be required to load
> the ext3 kernel module. Without the module, then it may be fall back to
> use ext2 (since ext2 is backward compatible with ext3). You can use an
> ext3 partition for strictly boot purposes, but when you start mounting
> devices you need to have all of the necessary kernel modules loaded.
> Also, your /etc/fstab file should specify the ext3 filesystem for the
> partition in question.
>
>>
>> Next I tried to install lilo:
>>
>> I booted via SysRescCD and mounted /dev/hdb1 as /boot and
>> /dev/mapper/vg00-root as /mnt/sysimage. I then ran
>>
>> lilo -C /mnt/sysimage/etc/lilo.conf -b /dev/hdb
>>
>> Unfortunately this also results in lilo hanging as follows:
>>
>> LIL
>>
>> I would appreciate any help in order to get my linux system booted again
>>
>>
>> My setup is as follows:
>> /dev/hda - used for Windows XP (Windows actually also fails to boot)

>
>> /dev/hdb Ubuntu, with /root and /home dirs via LVM,
>> /boot on /dev/hdb1 (ext3)
>>
>> I used to chainload grub via the XP bootloader.

>
> Do you mean that you use grub to chainload XP, similar to this:
>
> title Windows
> rootnoverify (hd0,0)
> makeactive
> chainloader +1
>
>
>>
>> Thanks,
>> Olaf
>>

> Decide which loader you want to use, then concentrate on fixing that
> loader. I looked at the wiki you referenced, which says grub can hang at
> this point if the grub files are damaged. Presumably, you would fix the
> files at /boot/grub. Did you attempt to do that?
>
> I don't use ubuntu. Perhaps, reinstalling the grub package will restore
> your grub directory. I'll wait for your reply before posting more. I
> don't use lilo.
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-18-2008, 05:47 PM
Douglas Mayne
 
Posts: n/a
Default Re: Problems reinstalling grub/lilo (they always hang at boot time ...)

On Tue, 25 Apr 2006 08:55:41 +0200, Olaf wrote:

> Douglas,
>
> I'm pretty sure I did not change anything in the /boot/grub directory. I
> actually had backups of the bootsectors (first 512 byte of the harddisks)


Do you mean the bootsector of a partition or the MBR of the disc? The
first 512 bytes of the entire disk is the MBR (master boot record).

> and they were unaltered (or do these only contain the partition table?).


The _MBR_ of a disk contains id signatures, boot code, and space to define
four primary partitions.

The _bootsector of a partition_ contains id signatures, boot code, and
filesystem parameters.

Which of these did you compare and verify they had been unaltered?

>
> I did reinstall the files in the /boot/grub directory via grub-install
> but the loader still hangs.


Do the "stage" files exist at the /boot/grub directory? Does grub-install
report any errors? I looked closer at your first post, and you say that
/dev/hdb1 is a boot partition; therefore, look for the grub directory
relative to /dev/hdb1 (/grub, not /boot/grub). BTW, what environment is
available when you boot with the rescue CD? Are you working directly with
your setup, or is it using a "live CD" where you have to manually mount
your partitions, etc.

>
> I used to load grub from the XP bootloader (and not the other way around
> as you suggested),


OK, the fact you can't boot XP any more is a good clue to what is broken
on your system. Because XP's loader is set to control the bootup, is the
Windows menu displayed which offers choices to start XP or Ubuntu?

> but for now I'm happy if I can directly boot from the disk where the
> grub boot loader is located (/dev/hdb).
>

<snip>
>

Note: comments inline.

Also, please don't top post replies.

--
Ripley: And you let him in.
http://us.imdb.com/title/tt0078748/quotes
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-18-2008, 05:49 PM
Olaf
 
Posts: n/a
Default Re: Problems reinstalling grub/lilo (they always hang at boot time ...)

Douglas Mayne wrote:

> On Tue, 25 Apr 2006 08:55:41 +0200, Olaf wrote:
>
>> Douglas,
>>
>> I'm pretty sure I did not change anything in the /boot/grub directory. I
>> actually had backups of the bootsectors (first 512 byte of the harddisks)

>
> Do you mean the bootsector of a partition or the MBR of the disc? The
> first 512 bytes of the entire disk is the MBR (master boot record).


Yes this is what I am referring to.

>> and they were unaltered (or do these only contain the partition table?).

>
> The _MBR_ of a disk contains id signatures, boot code, and space to define
> four primary partitions.
>
> The _bootsector of a partition_ contains id signatures, boot code, and
> filesystem parameters.
>
> Which of these did you compare and verify they had been unaltered?


I only compared the MBRs of the disks with the backups that I had.

>> I did reinstall the files in the /boot/grub directory via grub-install
>> but the loader still hangs.

>
> Do the "stage" files exist at the /boot/grub directory? Does grub-install
> report any errors? I looked closer at your first post, and you say that
> /dev/hdb1 is a boot partition; therefore, look for the grub directory
> relative to /dev/hdb1 (/grub, not /boot/grub). BTW, what environment is
> available when you boot with the rescue CD? Are you working directly with
> your setup, or is it using a "live CD" where you have to manually mount
> your partitions, etc.


Yes the stage file exist in the /boot/grub (or /grub from /dev/hdb1 point of
view). Is there anyway I can verify that they are ok (e.g. calculating a
checksum or something similar).

I am using a live CD (SysRescCD) and I need to mount my partitions.

>>
>> I used to load grub from the XP bootloader (and not the other way around
>> as you suggested),

>
> OK, the fact you can't boot XP any more is a good clue to what is broken
> on your system. Because XP's loader is set to control the bootup, is the
> Windows menu displayed which offers choices to start XP or Ubuntu?


Yes I get the choice menu and I can select either OS, but as soon as I press
enter the computer hangs ...

>> but for now I'm happy if I can directly boot from the disk where the
>> grub boot loader is located (/dev/hdb).
>>

> <snip>
>>

> Note: comments inline.
>
> Also, please don't top post replies.


Some readers don't support inlining e.g. google groups UI ...

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-18-2008, 05:49 PM
Douglas Mayne
 
Posts: n/a
Default Re: Problems reinstalling grub/lilo (they always hang at boot time ...)

On Fri, 28 Apr 2006 00:10:55 +0200, Olaf wrote:

> Douglas Mayne wrote:
>
>> On Tue, 25 Apr 2006 08:55:41 +0200, Olaf wrote:
>>
>>> Douglas,
>>>
>>> I'm pretty sure I did not change anything in the /boot/grub directory. I
>>> actually had backups of the bootsectors (first 512 byte of the harddisks)

>>
>> Do you mean the bootsector of a partition or the MBR of the disc? The
>> first 512 bytes of the entire disk is the MBR (master boot record).

>
> Yes this is what I am referring to.
>
>>> and they were unaltered (or do these only contain the partition table?).

>>
>> The _MBR_ of a disk contains id signatures, boot code, and space to define
>> four primary partitions.
>>
>> The _bootsector of a partition_ contains id signatures, boot code, and
>> filesystem parameters.
>>
>> Which of these did you compare and verify they had been unaltered?

>
> I only compared the MBRs of the disks with the backups that I had.
>
>>> I did reinstall the files in the /boot/grub directory via grub-install
>>> but the loader still hangs.

>>
>> Do the "stage" files exist at the /boot/grub directory? Does grub-install
>> report any errors? I looked closer at your first post, and you say that
>> /dev/hdb1 is a boot partition; therefore, look for the grub directory
>> relative to /dev/hdb1 (/grub, not /boot/grub). BTW, what environment is
>> available when you boot with the rescue CD? Are you working directly with
>> your setup, or is it using a "live CD" where you have to manually mount
>> your partitions, etc.

>
> Yes the stage file exist in the /boot/grub (or /grub from /dev/hdb1 point of
> view). Is there anyway I can verify that they are ok (e.g. calculating a
> checksum or something similar).
>
> I am using a live CD (SysRescCD) and I need to mount my partitions.
>
>>>
>>> I used to load grub from the XP bootloader (and not the other way around
>>> as you suggested),

>>
>> OK, the fact you can't boot XP any more is a good clue to what is broken
>> on your system. Because XP's loader is set to control the bootup, is the
>> Windows menu displayed which offers choices to start XP or Ubuntu?

>
> Yes I get the choice menu and I can select either OS, but as soon as I press
> enter the computer hangs ...
>
>>> but for now I'm happy if I can directly boot from the disk where the
>>> grub boot loader is located (/dev/hdb).
>>>

>> <snip>
>>>

>> Note: comments inline.
>>
>> Also, please don't top post replies.

>
> Some readers don't support inlining e.g. google groups UI ...
>

The fact that the boot menu is displayed indicates that the Window's
boot drive bootsector is ok. However, the fact that neither Windows or
Linux will load (using the Windows loader) indicates something is
probably wrong with the windows partition's ability to read more files
beyond the bootsector and ntldr (these are not broken because the menu is
displayed.) Have you made any changes to your BIOS settings, or crashed
Windows recently? Because you have two discs, I think chances are good
that whatever has damaged your system, it is isolated to one disc or the
other. All clues point to your Windows partition being damaged. I am
assuming you haven't damaged your system by making a mistake in the
recovery process or by attempting to change something else just before the
failure.

You should also rule out hardware failure. There are some tests
which you can perform on your hard discs. Do you have the hard disc
manufacturer's diagnostic CD for your hard discs? Most diagnostic CDs have
read only tests which do simple checks to verify your hardware is working.
If you don't have that disc, you can use the GNU/Linux command dd.


I could post a grub bootable CD image if you think that would help.

--
Douglas Mayne
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-18-2008, 05:49 PM
CBFalconer
 
Posts: n/a
Default Re: Problems reinstalling grub/lilo (they always hang at boot time ...)

Olaf wrote:
> Douglas Mayne wrote:
>

.... snip ...
>>
>> Also, please don't top post replies.

>
> Some readers don't support inlining e.g. google groups UI ...


Nonsense. Just edit your reply appropriately.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-18-2008, 05:49 PM
Grant
 
Posts: n/a
Default Re: Problems reinstalling grub/lilo (they always hang at boot time ...)

On Thu, 27 Apr 2006 22:36:02 -0600, Douglas Mayne <doug@localhost.localnet> wrote:

>The fact that the boot menu is displayed indicates that the Window's
>boot drive bootsector is ok. However, the fact that neither Windows or
>Linux will load (using the Windows loader) indicates something is
>probably wrong with the windows partition's ability to read more files
>beyond the bootsector and ntldr (these are not broken because the menu is
>displayed.)


I wonder if OP inserted a partition, moving the windoze one? (PQmagic
will do that) ntldr enumerates partitions on boot, for example this
box I type on uses C: for boot / temp / paging, and winxp is on first
primary (D partition on second drive.

boot.ini has: "default=multi(0)disk(0)rdisk(1)partition(1)\WINDO WS"

The partition number may need changing? I'd like to see if output
of fdisk -l matches bootloader's. Also check BIOS boot drive selection.

Grant.
--
Memory fault -- brain fried
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 01-18-2008, 05:49 PM
iforone
 
Posts: n/a
Default Re: Problems reinstalling grub/lilo (they always hang at boot time ...)


Douglas Mayne wrote:

> I could post a grub bootable CD image if you think that would help.
>



This would most certainly help me in the future :-)


[ Concerning the OP's GRUB problem ]
*Considerations*;
I *have not* used XP in a dual-boot situation.
I *have not* run into this issue (yet, thankfully) using 2 physical
HDDs.

I *have* run into very similar issues with GRUB dual-booting win98 and
Debian.
I *have* always installed GRUB into the MBR.

Perhaps;
Just to get XP to boot again, and since the OP is booting through XP's
Boot.ini, Ntdetect.com and Ntldr (and whatever else gets placed on C:\
in this situation, such as in a LiLo config) - and chainloading through
Boot.ini (instead of GRUB);
I might suggest the OP boot into XP CDROM and run the commands;
CHKDSK C: /r
FIXMBR
FIXBOOT
BOOTCFG /rebuild

Then, perhaps reinstalling GRUB.

I only suggest above, because I'm unsure of how to directly clear up
the GRUB issues.

NOTE: ** Some of this info _below_ may be inaccurate or non-precise **

It appears either 1 or both HDDs xMBR is damaged...(allow me to try and
explain - and note; some of this *not* exact! ...nor precise).
Windows (atleast Fat32 on win98) uses an *xMBR* (e'X'tended MBR) which
is larger than the typical "standard" Boot sector size of 512Bytes.
This xMBR (Douglas refers to this xMBR as the
*partition_boot_sector(s)*) can/does span across atleast 6 more 512Byte
sectors (in a Ext'd win95 LBA partitioning scheme, this area on the HDD
is usually Logical sectors 63-69). IIRC - one of these sectors contains
the BPB(BIOS Parameter Block), which is hit along the way, during a
boot.

The MBR/MPT area of a physical HDD (512Bytes), as Douglas has
explained, is only large enough to contain the 4 Primary partition (or
3 Pri + 1 Ext'd) entries, some code, and other id info only.

One a single solitary HDD dual-boot installation using Debian Sarge - I
noticed GRUB, (_when_installed_to_the_MBR_), lives in the area(sectors)
*between* the MBR and the xMBR (especially the Stage 1.5 and Stage 2
aspects). I've confirmed this using the 'dd' utility. I can venture
into much further detail, but at the moment I will refrain.

Installing LiLo, IMHO, would likely only make things worse and more
confusing (though I'm unsure if it is actually _damaging_), in this
situation - yet unfortunately the OP has past the time for that
decision.

Windows also will place the MBR (and/or it's mirror copy) wherever it
likes on the HDD, including at the "end of the disk".

/NOTE: ** Some of this info _above_ may be inaccurate or non-precise **

Grant and Douglas have much more experience in this area than do I, so
please await their further replies, before acting upon the information
I have posted. Plus, I'm fairly new to GNU/Linux as well :-)

Regards

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 01-18-2008, 05:49 PM
Olaf
 
Posts: n/a
Default Re: Problems reinstalling grub/lilo (they always hang at boot time ...)

Douglas Mayne wrote:

> On Fri, 28 Apr 2006 00:10:55 +0200, Olaf wrote:
>
>> Douglas Mayne wrote:


>>
>> snip
>>


> The fact that the boot menu is displayed indicates that the Window's
> boot drive bootsector is ok. However, the fact that neither Windows or
> Linux will load (using the Windows loader) indicates something is
> probably wrong with the windows partition's ability to read more files
> beyond the bootsector and ntldr (these are not broken because the menu is
> displayed.) Have you made any changes to your BIOS settings, or crashed
> Windows recently? Because you have two discs, I think chances are good
> that whatever has damaged your system, it is isolated to one disc or the
> other. All clues point to your Windows partition being damaged. I am
> assuming you haven't damaged your system by making a mistake in the
> recovery process or by attempting to change something else just before the
> failure.
>
> You should also rule out hardware failure. There are some tests
> which you can perform on your hard discs. Do you have the hard disc
> manufacturer's diagnostic CD for your hard discs? Most diagnostic CDs have
> read only tests which do simple checks to verify your hardware is working.
> If you don't have that disc, you can use the GNU/Linux command dd.
>
>
> I could post a grub bootable CD image if you think that would help.
>


Douglas, yes if you can point me to a grub bootable CD image that would
provide some help. The first thing I'll do is reinstall XP since I have no
clue how to recover that, on the other hand I'm pretty sure I can recover
the Linux installation

Thanks for your help.
Olaf
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:51 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com