LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 01-08-2013, 10:52 AM   #1
johnToledo
LQ Newbie
 
Registered: Jan 2013
Distribution: Ubuntu, Fedora, RHEL
Posts: 6

Rep: Reputation: Disabled
RHEL 5 system lost file system info, stuck on GRUB


Hello!

I have a virtualized RHEL server 5 inside a windows 2008 R2 machine.
Recently someone disconnected the VM without shuting it down first
Now, the system got stuck in the grub prompt.

So, when I try to configure grub manually I get this:
Code:
grub> root (hd0,<TAB>
 Possible partitions are:
    Partition num: 0, Filesystem type unknown, partition type 0x83
    Partition num: 1, Filesystem type unknown, partition type 0x8e
    Partition num: 2, Filesystem type unknown, partition type 0x83
So even if I complete the command, grub can't mount the filesystem because it doesn't know the type (Part 0 is ext3, 1 is swap, and 2 ext3 also)

So, enter linux rescue.
With the media inserted y go to linux rescue and it succesfully mount the filesystem in /mnt/sysimage so I chroot /mnt/sysimage, start some services and voila, the system is up and running as always.

When i try to reinstall grub i get the following:
Code:
# grub-install /dev/hda
/dev/hda does not have any corresponding BIOS drive.
parted output:
Code:
(parted) print /dev/hda

Model: Virtual HD (ide)
Disk /dev/hda: 53.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      32.3kB  107MB   107MB   primary               boot
 2      107MB   10.7GB  10.6GB  primary               lvm
 3      10.7GB  53.7GB  42.9GB  primary
Also I've noticed that /boot/grub/grub.conf does not exist. But I've created one based on another RHEL system with the same configuration and nothing happens.

I've spend 2 days trying to fix this, so I give up.

Thanks in advance!

Last edited by johnToledo; 01-08-2013 at 12:11 PM.
 
Old 01-08-2013, 12:38 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,485
Blog Entries: 54

Rep: Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902
Quote:
Originally Posted by johnToledo View Post
When i try to reinstall grub i get the following:
Code:
# grub-install /dev/hda
/dev/hda does not have any corresponding BIOS drive.
(..) Also I've noticed that /boot/grub/grub.conf does not exist.
Before you 'grub-install /dev/hda --recheck' first ensure /boot/grub/ contents remain unaltered, having all the requires stage.*, map, device and whateverelse files?
 
Old 01-08-2013, 01:01 PM   #3
johnToledo
LQ Newbie
 
Registered: Jan 2013
Distribution: Ubuntu, Fedora, RHEL
Posts: 6

Original Poster
Rep: Reputation: Disabled
Ok,
the contents of my /boot/grub directory is as follows:
Code:
-rw-r--r-- 1 root root     30 Jan  8 11:36 device.map
-rw-r--r-- 1 root root   7584 Jan  8 11:36 e2fs_stage1_5
-rw-r--r-- 1 root root   7456 Jan  8 11:36 fat_stage1_5
-rw-r--r-- 1 root root   6720 Jan  8 11:36 ffs_stage1_5
-rw-r--r-- 1 root root   1101 Jan  8 11:36 grub.conf
-rw-r--r-- 1 root root   6720 Jan  8 11:36 iso9660_stage1_5
-rw-r--r-- 1 root root   8224 Jan  8 11:36 jfs_stage1_5
-rw-r--r-- 1 root root   6880 Jan  8 11:36 minix_stage1_5
-rw-r--r-- 1 root root   9248 Jan  8 11:36 reiserfs_stage1_5
-rw-r--r-- 1 root root    512 Jan  8 11:36 stage1
-rw-r--r-- 1 root root 104988 Jan  8 11:36 stage2
-rw-r--r-- 1 root root   7072 Jan  8 11:36 ufs2_stage1_5
-rw-r--r-- 1 root root   6272 Jan  8 11:36 vstafs_stage1_5
-rw-r--r-- 1 root root   8872 Jan  8 11:36 xfs_stage1_5
I assume it has all the stages and files that needs. Or maybe not?

Then, running grub-install again:
Code:
# grub-install /dev/hda --recheck
Probing devices to guess BIOS drives. This may take a long time.
/dev/mapper/VolGroup00-LogVol00 does not have any corresponding BIOS drive.
 
Old 01-08-2013, 03:00 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,356

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Might be damage to (the start of) the container disk file on the host - everything is virtualised, including the MBR, and the "BIOS" boot sequence. As you can chroot into the system o.k., I'd get your data backed up and just stand up another guest and migrate over to that. Simplest way to ensure you have a clean environment to work with.
 
Old 01-09-2013, 06:58 AM   #5
johnToledo
LQ Newbie
 
Registered: Jan 2013
Distribution: Ubuntu, Fedora, RHEL
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thank you syg00. I was thinking the same thing as a plan B.
Its going to take some time to re-building the entire enviroment again, that's why I want it to try to recover from this error.
I'm gonna give it one last try and if it doesn't work, we're gonna build another guest.
 
Old 01-09-2013, 07:24 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,485
Blog Entries: 54

Rep: Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902Reputation: 2902
Quote:
Originally Posted by johnToledo View Post
I assume it has all the stages and files that needs. Or maybe not?
Well, you know what they say about assuming ;-p Since /boot/grub/ contents consist of mostly /usr/share/grub/*/ you could:
Code:
rpm -Vv grub|grep -v '^\.\{8\}[[:blank:]]'
md5sum /usr/share/grub/*/* /boot/grub/* | sort -g | uniq -w32 -d --all-repeated=separate


Quote:
Originally Posted by johnToledo View Post
Code:
# grub-install /dev/hda --recheck
Probing devices to guess BIOS drives. This may take a long time.
/dev/mapper/VolGroup00-LogVol00 does not have any corresponding BIOS drive.
IIRC this has something to do with GRUB not recognizing LVM volumes and leaving them be. I don't have a fix for it at hand but it looks like something that can be worked around. Some posts I've read suggest ensuring all mount points, all LVs mounted when "/" is active, be mounted at their proper location inside /mnt/sysimage before running grub-install.
 
Old 01-09-2013, 08:06 AM   #7
johnToledo
LQ Newbie
 
Registered: Jan 2013
Distribution: Ubuntu, Fedora, RHEL
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
Code:
rpm -Vv grub|grep -v '^\.\{8\}[[:blank:]]'
md5sum /usr/share/grub/*/* /boot/grub/* | sort -g | uniq -w32 -d --all-repeated=separate
They are identical.

I will try to mount manually all the LVs inside /mnt/sysimage and run grub-install
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RHEL(AS3)-Upd(5):System Cannot boot .... LinuxAhmad Linux - General 1 05-16-2007 11:08 AM
RHEL(AS3)-Upd(5):System Cannot boot .... LinuxAhmad Linux - Enterprise 1 05-16-2007 06:23 AM
RHEL(AS3)-Upd(5):System Cannot boot .... LinuxAhmad Linux - Server 1 05-16-2007 06:05 AM
creating boot floppy from RHEL 4 ES system Hotchips Red Hat 3 02-10-2007 05:25 PM


All times are GMT -5. The time now is 10:11 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration