Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1513
  • Last Modified:

GRUB Problem

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
sysautomation
Asked:
sysautomation
  • 6
  • 5
1 Solution
 
Ganesh Kumar ACommented:
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
 
sysautomationAuthor Commented:
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
 
sysautomationAuthor Commented:
Can this be due to chroot ?
0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 
Ganesh Kumar ACommented:
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
 
SandyCommented:
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
 
sysautomationAuthor Commented:
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
 
Ganesh Kumar ACommented:
Try to input :

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

or

grub> find /grub/stage1

and post the result.
0
 
sysautomationAuthor Commented:
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
 
Ganesh Kumar ACommented:
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
 
sysautomationAuthor Commented:
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
 
Ganesh Kumar ACommented:
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
 
sysautomationAuthor Commented:
Thanks
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now