LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Booting problem with Grub (https://www.linuxquestions.org/questions/linux-newbie-8/booting-problem-with-grub-890955/)

evsam 07-10-2011 01:46 PM

Booting problem with Grub
 
Hello All,
My system refuses to boot after a power failure.
It boots to Grub prompt after starting Stage2.

The power failure resulted in the boot partition being trashed. No files could be read.

I have tried many things to resolve, but to no avail. Here is what I have tried:

Used Knoppix Live CD and disk utils to try and recover the files. All failed with unknown partition type. Knoppix Live CD does not support virtual disks (I have LVM2 as main vol) so now using Fedora Live CD.

I then used disk utility to name the boot partition 'boot' and ext3 type. This seems to resolve the problem with the disk utils but still had the same boot problem.

I have managed to add a second disk and copied all the files from the LVM2 volume (os files and data).

Tried grub_install from live cd but same result. Interestingly, I could not find grub.conf file.


Questions
As the LMV2 partition is intact, as far as I know, are the boot partition files stored anywhere on it?

Is there anyway to get this working without a full install?

I do not have the original install disk, as the system was setup 3+ years ago by others who cannot be traced. Indeed, I find it hard to ID the version of Linux used, but think it was Red Hat.

Any help is appreciated.

Evsam

alfredo10 07-10-2011 01:54 PM

Hi!
With a SuperGrubDisk you can start Linux or repair Grub:
http://www.supergrubdisk.org/
alfredo

evsam 07-10-2011 02:22 PM

Hello Alfredo10,
Thanks for your quick reply.
I wish I had asked the question earlier before messing around. Tried the SuperGrub Disk but the following were returned (erros only) all others were yes or succeeded.

checking if "/boot/grub/stage1" exists... no

findf /boot/grub/menu.lst /grub/menu.lst /boot/grub/grub.conf /grub/grub.conf

Error 15: File not found

Is there anyway to create the above files? Should these files exist in both locatons /boot/grub and /grub?

Thanks again
Evsam

qrange 07-10-2011 03:54 PM

grub.conf is a text file. it lists operating systems and similar (grub menu items). you could create it manually. but perhaps its better to do it with update-grub command. you might need to chroot first.
you should state the OS and grub version.
btw, it might be easier to reinstall the whole thing.

michaelk 07-10-2011 04:07 PM

If your /boot partition is trashed and you can not read or recover any files from it then restoring grub will not fix your computer. /boot contains the kernel files which are not stored anywhere else. Did you try running fsck on the /boot partition? I suspect it is unrecoverable.

Since you can access / see if you have a file called /etc/fedora-release, redhat-release or similar. The contents will tell us the version.

evsam 07-10-2011 05:02 PM

Hello Grange,
I was able to manually create grub.conf but as Michaelk mentioned, this did not help as kernel files were missing.

Re-installing is the very last option, as I have no idea how to install and configure the SQL database that was running on this machine.

What I have done:
Attached an old IDE disk to the machine and install Fedora on it.
Copied all files from the new install to original boot partition.
Edit grub.conf as best I could for a single drive.
Copy all files from LVM2 volume to IDE disk (glad this was safe).
Shutdown and remove the IDE disk and reboot hoping this would do the trick. Did not work, got the Grub prompt but does not say 'loading Stage 2 anymore.

Used supergrub disk and manage to get the system to boot (part way), discovered:
Red Hat Enterprise was originally installed.
Red Hat 3.4.6-2 Linux ver 2.6.9-42.EL (got these from conf files).
On booting Fedora/Red Hat (call it Fedora from now on) discovered unclean shutdown and checked /boot but discovered an superblock error.
Now prompting for root password to run disk utils. I do not have, of course.

It seems this disk in not reliable and needs replacing.
So looking at a new install the question I have is, having a backup of the whole hard disk with database how can this be recovered to put on a new install?

Thank Michael for your response.

evsam

michaelk 07-11-2011 07:37 AM

Do you know the database? mysql, postgresql Oracle etc.
The root password should be the one created when you installed Fedora.

evsam 07-11-2011 12:47 PM

No, I don't know which database.
Looking at the files on the disk there are MDB2 files but I am not sure if this is a database server.
I can see many php files.

Do you have any hints on where to look for database files?

Evsam

michaelk 07-11-2011 01:07 PM

Look in /var/lib for mysql or postgresql directories.

evsam 07-11-2011 02:11 PM

Hello Michael,

Found mysql directory in /var/lib
I will attempt to download and install.
Ev


All times are GMT -5. The time now is 09:13 PM.