Solved

GRUB Problem

Posted on 2014-09-22
12
1,279 Views
Last Modified: 2014-09-25
Hi

I rebooted my Centos 5.10 64 bit server after a long time and it did not come back. This is a dedicated server hosted with OVH. I don't have KVM available but got into the rescue mode.

root@rescue:~# mount /dev/md2 /mnt/
root@rescue:~# chroot /mnt
[root@rescue /]# grub-install /dev/sda
/dev/sda does not have any corresponding BIOS drive.
[root@rescue /]# grub-install /dev/md2
dev/sda2 does not have any corresponding BIOS drive.
[root@rescue /]# grub-install /dev/sda2
/dev/sda2 does not have any corresponding BIOS drive.
[root@rescue /]# grub
Probing devices to guess BIOS drives. This may take a long time.


    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename.]
grub> root (hd0,1)
root (hd0,1)

Error 22: No such partition
grub> root (hd0,0)
root (hd0,0)
 Filesystem type unknown, partition type 0xee
grub> setup (hd0)
setup (hd0)

Error 17: Cannot mount selected partition
grub>

This is running software RAID 1.

md2:

   Number   Major   Minor   RaidDevice State
       0       8        2        0      active sync   /dev/sda2
       1       8       18        1      active sync   /dev/sdb2

md4:

   Number   Major   Minor   RaidDevice State
       0       8        4        0      active sync   /dev/sda4
       1       8       20        1      active sync   /dev/sdb4


Can someone please help me fix the issue?

Zulqarnain
0
Comment
Question by:sysautomation
  • 6
  • 5
12 Comments
 
LVL 10

Accepted Solution

by:
Ganesh Kumar A earned 500 total points
Comment Utility
First find the correct partition
# grub

grub> find /grub/grub.conf
find /grub/grub.conf
 (hd0,2)
 (hd1,2)

grub> quit
======================================================
You really should do searches for both /boot/grub/grub.conf and /grub/grub.conf (no separete /boot vs. separate /boot partition, respectively) to cover all the bases.

after the update /boot/grub/menu.lst contains

root (hd0)

for the default boot entry but should contain

root (hdx,y)
0
 

Author Comment

by:sysautomation
Comment Utility
Thanks. I tried both but failed:

grub> find /grub/grub.conf
find /grub/grub.conf

Error 15: File not found

grub> find  /boot/grub/grub.conf
find  /boot/grub/grub.conf

Error 15: File not found


Whereas the file is present in O/S:

[root@rescue /]# ll /boot/grub/grub.conf
-rw------- 1 root root 544 Sep 22 03:47 /boot/grub/grub.conf

Any ideas what's wrong?
0
 

Author Comment

by:sysautomation
Comment Utility
Can this be due to chroot ?
0
 
LVL 10

Expert Comment

by:Ganesh Kumar A
Comment Utility
Error 15 mens that a file you have named in grub.conf does not exist in /boot, so grub cannot load it.

$kernel /boot/xfkernel01 root=/dev/ram0 real_root=/dev/sdax (x denotes your hard drive)

Tells grub to load the file /boot/xfkernel01 - does that file exist?

You may also be trying to load an initrd file. The same rules apply - file names mentioned in grub.conf must exit in /boot and be identical.

You run update-grub which wrapps all the grub needed to boot system

Try this : https://wiki.gentoo.org/wiki/GRUB_Error_Reference
0
 
LVL 13

Expert Comment

by:Sandy
Comment Utility
raise a ticket to OVH support and ask them to unplug and plug the HDD from disk bays.. it is not detecting the disks.. In case it won't work ask them to check the HW properly..

They do this and this happens to OVH server quiet often.,, General container issues.

TY/SA
0
 

Author Comment

by:sysautomation
Comment Utility
Hi Ganesh

Here's my grub.conf

default=0
timeout=5

        title CentOS (2.6.18-371.12.1.el5xen)
        kernel /boot/xen.gz-2.6.18-371.12.1.el5 dom0_mem=2048
        module /boot/vmlinuz-2.6.18-371.12.1.el5xen root=/dev/md2  ro
        root (hd0,1)
        module /boot/initrd-2.6.18-371.12.1.el5xen.img
        title CentOS (2.6.18-348.4.1.el5xen)
        kernel /boot/xen.gz-3.4.4 dom0_mem=2048
        module /boot/vmlinuz-2.6.18-348.4.1.el5xen root=/dev/md2  ro
        root (hd0,1)
        module /boot/initrd-2.6.18-348.4.1.el5xen.img
        title linux centos5_64
        kernel /boot/bzImage-3.2.13-xxxx-grs-ipv6-64 root=/dev/md2  ro
        root (hd0,1)

Open in new window


Both the files are present in the given path

[root@rescue /]# ll  /boot/xen.gz-2.6.18-371.12.1.el5
-rw-r--r-- 1 root root 429710 Sep  3 16:15 /boot/xen.gz-2.6.18-371.12.1.el5
[root@rescue /]# ll /boot/vmlinuz-2.6.18-371.12.1.el5xen
-rw-r--r-- 1 root root 2219956 Sep  3 18:33 /boot/vmlinuz-2.6.18-371.12.1.el5xen

Open in new window


update-grub is not present in the system.
[root@rescue /]# update-grub
bash: update-grub: command not found

Open in new window


Hi Sandy

See the output of mdadm. It is showing both disk so I don't think it is a HW problem.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 10

Expert Comment

by:Ganesh Kumar A
Comment Utility
Try to input :

grub> cat (hd0,0)/grub/grub.conf

or

grub> find /grub/stage1

and post the result.
0
 

Author Comment

by:sysautomation
Comment Utility
grub> cat (hd0,0)/grub/grub.conf
cat (hd0,0)/grub/grub.conf

Error 17: Cannot mount selected partition
grub> find /grub/stage1
find /grub/stage1

Error 15: File not found
grub> find /boot/grub/stage1
find /boot/grub/stage1

Error 15: File not found
grub>
0
 
LVL 10

Expert Comment

by:Ganesh Kumar A
Comment Utility
Please perform the following steps:

Boot from CentOS installation disc (for example, CD #1 or DVD).
For CentOS-4 or CentOS-5 type "linux rescue" at the "boot:" prompt. For CentOS-6 pick "Rescue installed system" from the boot menu.
Mount all filesystems in read-write mode.
Change root to real root ('/') on your hard disk:
# chroot /mnt/sysimage
Re-install bootstrap code (GRUB).
If you wish to re-install GRUB to the MBR on a SCSI or SATA disk (/dev/sda):
# grub-install /dev/sda
If you wish to re-install GRUB to the PBR of Partition #2 on a SCSI or SATA disk (/dev/sda2):
# grub-install /dev/sda2
If you wish to re-install GRUB to the MBR on an IDE disk (/dev/hda):
# grub-install /dev/hda
0
 

Author Comment

by:sysautomation
Comment Utility
Booted into rescue mode

root@rescue:/# mount /dev/md2 /mnt/
root@rescue:/# chroot /mnt

[root@rescue /]# grub-install /dev/sda1
The file /boot/grub/stage1 not read correctly.

[root@rescue /]# grub-install --recheck /dev/sda1
Probing devices to guess BIOS drives. This may take a long time.
The file /boot/grub/stage1 not read correctly.

[root@rescue /]# grub-install --recheck /dev/sda2
Probing devices to guess BIOS drives. This may take a long time.
The file /boot/grub/stage1 not read correctly.

[root@rescue /]# grub-install --recheck /dev/sdb1
Probing devices to guess BIOS drives. This may take a long time.
/dev/sdb1 does not have any corresponding BIOS drive.

[root@rescue /]# grub-install --recheck /dev/sdb2
Probing devices to guess BIOS drives. This may take a long time.
/dev/sdb2 does not have any corresponding BIOS drive.
0
 
LVL 10

Expert Comment

by:Ganesh Kumar A
Comment Utility
Based on previous results second HDD has issues due to soft raid or may be HDD is faulty.

Check the below command combination and post the results.
# grub
grub> root (hd0,0)        
grub> root (hd0,1)
grub> root (hd1,0)
grub> root (hd1,1)
0
 

Author Closing Comment

by:sysautomation
Comment Utility
Thanks
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now