GRUB 2

Colin Law clanlaw at googlemail.com
Wed Mar 2 09:41:23 UTC 2011


On 2 March 2011 08:56, Loïc Grenié <loic.grenie at gmail.com> wrote:
> ...
>    The problem is that one every three boots must be on XP the two
>  others on Linux. The idea is that you can remotely reboot the
>  machine and after at most three attempts you get XP.

Is the *real* problem that you would like to decide remotely which OS
to boot into next?

It is easy enough when in Ubuntu to decide that you wish to boot into
XP next by editing /etc/default/grub and running sudo update-grub.
This could be done via a script so that manual edit is not required
each time.
The problem arises when in XP and you wish to boot into Ubuntu.  It is
possible to access an ext3 file system from Linux, see
http://www.go2linux.org/access-ext2-ext3-from-xp for example, there
may be other possibilities, but so it would be possible to edit
/etc/default/grub, but I don't think it would be possible to run
update-grub so this route will not work.  You could, however, edit
/boot/grub/grub.cfg to achieve the same result.  One should not
normally edit this file as it is generated by update-grub, but in this
case I think there is a valid argument for so doing.  In fact if this
route is taken to switch back to Ubuntu, since /etc/default/grub has
not been changed, then to get from Ubuntu back to XP it is only
necessary to run sudo update-grub to restore /etc/default/grub back to
its normal state.

So the conclusion:
1. Install tools to allow access to Ubuntu partition from XP
2. In Ubuntu edit /etc/default/grub so that the default is XP.
3. Write a windows script that edits /boot/grub/grub.cfg so that the
next boot will be into Ubuntu.
4. When running Ubuntu, to set next boot to XP simply run sudo
update-grub to restore /etc/default/grub to boot into XP

Colin

>
>       Loïc
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>




More information about the ubuntu-users mailing list