grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
* Switching to another boot device on failure
@ 2014-11-18 10:51 Venkata Subbarao
  2014-11-19  3:16 ` Andrei Borzenkov
  0 siblings, 1 reply; 6+ messages in thread
From: Venkata Subbarao @ 2014-11-18 10:51 UTC (permalink / raw)
  To: grub-devel

Hi All,

I am working on a task on XUbuntu OS in which due to any reason if booting
fails I would like to switch to another boot device by zeroing the MBR of
current boot disk. Is this possible ?

For example instead of showing following prompt, I would like to zero out
the MBR so that the BIOS can select next boot device upon reset.

error: no such partition
grub rescue>


Thanks in advance,
Venkata Subbarao



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Switching to another boot device on failure
  2014-11-18 10:51 Switching to another boot device on failure Venkata Subbarao
@ 2014-11-19  3:16 ` Andrei Borzenkov
  2014-11-19 13:59   ` Arbiel Perlacremaz
       [not found]   ` <CAFQyPcp7XO+Vs+fO-oYSPjvdHdTiB=oj8GCGbOLxmf6vs7YZGA@mail.gmail.com>
  0 siblings, 2 replies; 6+ messages in thread
From: Andrei Borzenkov @ 2014-11-19  3:16 UTC (permalink / raw)
  To: Venkata Subbarao; +Cc: grub-devel

В Tue, 18 Nov 2014 10:51:00 +0000 (UTC)
Venkata Subbarao <rao.subba.venkata@gmail.com> пишет:

> Hi All,
> 
> I am working on a task on XUbuntu OS in which due to any reason if booting
> fails I would like to switch to another boot device by zeroing the MBR of
> current boot disk. Is this possible ?
> 
> For example instead of showing following prompt, I would like to zero out
> the MBR so that the BIOS can select next boot device upon reset.
> 
> error: no such partition
> grub rescue>
> 

grub supports only very limited and controlled ways to write to
device/file. Doing something like this in unattended manner is probably
way too dangerous.

What would be possible is to optionally exit grub (after timeout) in
this case; then BIOS should proceed to next boot device.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Switching to another boot device on failure
  2014-11-19  3:16 ` Andrei Borzenkov
@ 2014-11-19 13:59   ` Arbiel Perlacremaz
       [not found]   ` <CAFQyPcp7XO+Vs+fO-oYSPjvdHdTiB=oj8GCGbOLxmf6vs7YZGA@mail.gmail.com>
  1 sibling, 0 replies; 6+ messages in thread
From: Arbiel Perlacremaz @ 2014-11-19 13:59 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 1399 bytes --]

Switching to the next boot device should not be done without advertising
the user, so that he or she has the opportunity to fix the primary
device's booting process.

By the way, how is the "recordfail" environment variable reset ?

And wouldn't it be possible to implement a "next_boot_device"
environment variable to answer Venkata's need ?

Arbiel
Le 19/11/2014 04:16, Andrei Borzenkov a écrit :
> В Tue, 18 Nov 2014 10:51:00 +0000 (UTC)
> Venkata Subbarao <rao.subba.venkata@gmail.com> пишет:
>
>> Hi All,
>>
>> I am working on a task on XUbuntu OS in which due to any reason if booting
>> fails I would like to switch to another boot device by zeroing the MBR of
>> current boot disk. Is this possible ?
>>
>> For example instead of showing following prompt, I would like to zero out
>> the MBR so that the BIOS can select next boot device upon reset.
>>
>> error: no such partition
>> grub rescue>
>>
> grub supports only very limited and controlled ways to write to
> device/file. Doing something like this in unattended manner is probably
> way too dangerous.
>
> What would be possible is to optionally exit grub (after timeout) in
> this case; then BIOS should proceed to next boot device.
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Switching to another boot device on failure
       [not found]   ` <CAFQyPcp7XO+Vs+fO-oYSPjvdHdTiB=oj8GCGbOLxmf6vs7YZGA@mail.gmail.com>
@ 2014-11-20 13:38     ` Venkata Subbarao
       [not found]       ` <20141120202316.5afdeaab@opensuse.site>
  2014-11-28 19:24       ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 2 replies; 6+ messages in thread
From: Venkata Subbarao @ 2014-11-20 13:38 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: grub-devel

[-- Attachment #1: Type: text/plain, Size: 1555 bytes --]

Once again Thank you Andrei.
Modified the grub source and added grub_exit (). After this BIOS booted
from next device.

I am now working on a solution where if the UUID present in the grub.cfg
goes bad.
One way I am thinking is to check the CRC of the grub.cfg and other image
files required for booting. This may be bit lengthy.
Let me know if you have suggestions.

Thanks,
Subbarao

On Wed, Nov 19, 2014 at 8:57 AM, Venkata Subbarao <
rao.subba.venkata@gmail.com> wrote:

> Thank you very much Andrei.
> I will try out this and update.
>
>
> - Subbarao
>
> On Wed, Nov 19, 2014 at 8:46 AM, Andrei Borzenkov <arvidjaar@gmail.com>
> wrote:
>
>> В Tue, 18 Nov 2014 10:51:00 +0000 (UTC)
>> Venkata Subbarao <rao.subba.venkata@gmail.com> пишет:
>>
>> > Hi All,
>> >
>> > I am working on a task on XUbuntu OS in which due to any reason if
>> booting
>> > fails I would like to switch to another boot device by zeroing the MBR
>> of
>> > current boot disk. Is this possible ?
>> >
>> > For example instead of showing following prompt, I would like to zero
>> out
>> > the MBR so that the BIOS can select next boot device upon reset.
>> >
>> > error: no such partition
>> > grub rescue>
>> >
>>
>> grub supports only very limited and controlled ways to write to
>> device/file. Doing something like this in unattended manner is probably
>> way too dangerous.
>>
>> What would be possible is to optionally exit grub (after timeout) in
>> this case; then BIOS should proceed to next boot device.
>>
>
>

[-- Attachment #2: Type: text/html, Size: 2523 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Switching to another boot device on failure
       [not found]       ` <20141120202316.5afdeaab@opensuse.site>
@ 2014-11-21 13:29         ` Venkata Subbarao
  0 siblings, 0 replies; 6+ messages in thread
From: Venkata Subbarao @ 2014-11-21 13:29 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: grub-devel

[-- Attachment #1: Type: text/plain, Size: 2363 bytes --]

I purposefully modified grub.cfg and changed the UUID in the line starts
with "linux /boot/vmlinuz...... root=UUID=XXXX"
Ended up in the (initramfs) prompt because such partition is not present.
Hence, I was thinking of checking CRC.

Thanks and Regards,
Subbarao

On Thu, Nov 20, 2014 at 10:53 PM, Andrei Borzenkov <arvidjaar@gmail.com>
wrote:

> В Thu, 20 Nov 2014 19:08:10 +0530
> Venkata Subbarao <rao.subba.venkata@gmail.com> пишет:
>
> > Once again Thank you Andrei.
> > Modified the grub source and added grub_exit (). After this BIOS booted
> > from next device.
> >
> > I am now working on a solution where if the UUID present in the grub.cfg
> > goes bad.
> > One way I am thinking is to check the CRC of the grub.cfg and other image
> > files required for booting. This may be bit lengthy.
> > Let me know if you have suggestions.
> >
>
> grub supports automatic signature verification for files; in case of
> mismatch file open fails. Does it help?
>
> > Thanks,
> > Subbarao
> >
> > On Wed, Nov 19, 2014 at 8:57 AM, Venkata Subbarao <
> > rao.subba.venkata@gmail.com> wrote:
> >
> > > Thank you very much Andrei.
> > > I will try out this and update.
> > >
> > >
> > > - Subbarao
> > >
> > > On Wed, Nov 19, 2014 at 8:46 AM, Andrei Borzenkov <arvidjaar@gmail.com
> >
> > > wrote:
> > >
> > >> В Tue, 18 Nov 2014 10:51:00 +0000 (UTC)
> > >> Venkata Subbarao <rao.subba.venkata@gmail.com> пишет:
> > >>
> > >> > Hi All,
> > >> >
> > >> > I am working on a task on XUbuntu OS in which due to any reason if
> > >> booting
> > >> > fails I would like to switch to another boot device by zeroing the
> MBR
> > >> of
> > >> > current boot disk. Is this possible ?
> > >> >
> > >> > For example instead of showing following prompt, I would like to
> zero
> > >> out
> > >> > the MBR so that the BIOS can select next boot device upon reset.
> > >> >
> > >> > error: no such partition
> > >> > grub rescue>
> > >> >
> > >>
> > >> grub supports only very limited and controlled ways to write to
> > >> device/file. Doing something like this in unattended manner is
> probably
> > >> way too dangerous.
> > >>
> > >> What would be possible is to optionally exit grub (after timeout) in
> > >> this case; then BIOS should proceed to next boot device.
> > >>
> > >
> > >
>
>

[-- Attachment #2: Type: text/html, Size: 3479 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Switching to another boot device on failure
  2014-11-20 13:38     ` Venkata Subbarao
       [not found]       ` <20141120202316.5afdeaab@opensuse.site>
@ 2014-11-28 19:24       ` Vladimir 'φ-coder/phcoder' Serbinenko
  1 sibling, 0 replies; 6+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2014-11-28 19:24 UTC (permalink / raw)
  To: The development of GNU GRUB, Andrei Borzenkov

[-- Attachment #1: Type: text/plain, Size: 2494 bytes --]

On 20.11.2014 15:38, Venkata Subbarao wrote:
> Once again Thank you Andrei.
> Modified the grub source and added grub_exit (). After this BIOS booted
> from next device.
> 
> I am now working on a solution where if the UUID present in the grub.cfg
> goes bad.
> One way I am thinking is to check the CRC of the grub.cfg and other
> image files required for booting. This may be bit lengthy.
> Let me know if you have suggestions.
> 
What is the scenario you want to protect against? checksums are mainly
useful against hardware failure but if hardware is defective the only
way to surely bring it back is to replace failing components.
The most common way for UUID to go unsync is because of software or
operator error and both are likely to recompute checksum or change
actual disk UUID without changing grub.cfg.
> Thanks,
> Subbarao
> 
> On Wed, Nov 19, 2014 at 8:57 AM, Venkata Subbarao
> <rao.subba.venkata@gmail.com <mailto:rao.subba.venkata@gmail.com>> wrote:
> 
>     Thank you very much Andrei.
>     I will try out this and update.
> 
> 
>     - Subbarao
> 
>     On Wed, Nov 19, 2014 at 8:46 AM, Andrei Borzenkov
>     <arvidjaar@gmail.com <mailto:arvidjaar@gmail.com>> wrote:
> 
>         В Tue, 18 Nov 2014 10:51:00 +0000 (UTC)
>         Venkata Subbarao <rao.subba.venkata@gmail.com
>         <mailto:rao.subba.venkata@gmail.com>> пишет:
> 
>         > Hi All,
>         >
>         > I am working on a task on XUbuntu OS in which due to any
>         reason if booting
>         > fails I would like to switch to another boot device by zeroing
>         the MBR of
>         > current boot disk. Is this possible ?
>         >
>         > For example instead of showing following prompt, I would like
>         to zero out
>         > the MBR so that the BIOS can select next boot device upon reset.
>         >
>         > error: no such partition
>         > grub rescue>
>         >
> 
>         grub supports only very limited and controlled ways to write to
>         device/file. Doing something like this in unattended manner is
>         probably
>         way too dangerous.
> 
>         What would be possible is to optionally exit grub (after timeout) in
>         this case; then BIOS should proceed to next boot device.
> 
> 
> 
> 
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-11-28 20:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-18 10:51 Switching to another boot device on failure Venkata Subbarao
2014-11-19  3:16 ` Andrei Borzenkov
2014-11-19 13:59   ` Arbiel Perlacremaz
     [not found]   ` <CAFQyPcp7XO+Vs+fO-oYSPjvdHdTiB=oj8GCGbOLxmf6vs7YZGA@mail.gmail.com>
2014-11-20 13:38     ` Venkata Subbarao
     [not found]       ` <20141120202316.5afdeaab@opensuse.site>
2014-11-21 13:29         ` Venkata Subbarao
2014-11-28 19:24       ` Vladimir 'φ-coder/phcoder' Serbinenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).