Actually i need to construct a server with two hard disks
condition:
condition:
if(hd1 is crashed)
search for blank hard-disk
make grub entry as hd(0,1)
can any one assist me the way.
--
Thanks in advance
Actually i need to construct a server with two hard disks
condition:
condition:
if(hd1 is crashed)
search for blank hard-disk
make grub entry as hd(0,1)
can any one assist me the way.
--
Thanks in advance
If the first disk is trashed, where do you think grub will load from (not from the crashed hard disk).
You can set the BIOS boot order to try each hard disk in turn (until it finds a bootable disk), but that's about it.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Sir,
please look at the structure
BIOS---->GRUB---->Loades OS
idea is like this.
As one Hard Disc fails,it reboots..even after crash at least grub part remains with it
So,i am finding the mechanism that grub part of Crashed hard disc to be changed by some mechanism
and second Hard Disc will come into priority and starts booting.
so can you assist me a way??
Making it more understanding..
i want to edit my /boot/grub/grub.conf or /etc/grub.conf file.
but through some programming mechanism.
If the hard disk has completely failed, then you're not going to be loading grub to begin with.
If the OS somehow managed to trash it's own partition (say corrupted a few files - say malware), then there isn't going to be a reliable test you can do to establish beforehand whether a particular disk image is actually bootable or not. All the necessary files may be there, but it could still lock up somewhere in the boot process.
Have you actually looked at the source code yet?
Somewhere (I'm guessing), a data structure will be created from a grub.conf file.
What you need to do is iterate through that data structure to find each bootable partition/image and perform whatever "validation" tests you feel are necessary. If the test fails, then you delete that entry from the data structure.
You present to the user what is left after you have done this.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Actually i want to edit "grub.conf" like this,
default=1
timeout=8
title Fedora(2.6)
root (hd0,0)
kernel /vmlin ro root=UUID=xxxx-xxxxx-xxxx-xxxx-xxxxx rhgb quiet
initrd /initrd-2.6
title Susee(2.8)
root (hd1,0)
kernel /vmlin ro root=UUID=yyyyyy-yyyyyy-yyyyy-yyyyy-yyyy rhgb quiet
initrd /initrd-2.8
Is it possible..
please add your comments