help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Query about GRUB comand line functionality


From: Simon Hobson
Subject: Re: Query about GRUB comand line functionality
Date: Wed, 25 Feb 2015 09:30:19 +0000

Bret Busby <address@hidden> wrote:

> The system is completely broken, due to attempting to install an extra
> operating system, which now appears to me, to be a trojan horse.
> 
> The system previously had installed, MS Windows 8 (which got lost,
> when Debian Linux was installed, but, the loss of MS Windows 8, on
> that computer, has not been a problem, for me), Debian Linux 7.x and
> Ubuntu Linux 14.04 LTS.
> 
> That is the order in which the operating systems were installed,
> before the additional one broke the system.
> 
> When Debian Linux was added, GRUB showed only the Debian Linux OS.
> 
> When Ubuntu Linux was added, the Ubuntu GRUB showed the boot options
> of Ubuntu and Debian.
> 
> When the trojan horse operating system was added, the bootloader shows
> only the trojan horse operating system, which does not boot.
> 
> In trying to restore the system to the state before the trojan horse
> operating system, I have found how to get to a GRUB command line
> prompt, which shows above specified version of GRUB as being present.

Often the easiest way to fix things is to boot a live CD/USB drive close to one 
of the installed OSs and work from there. I know some of the Debian installers 
(everything but the "Net install ?) have an option for rescue and live modes. 
In Rescue mode, you can specify a partition to mount as your root volume, and 
from there you have a working system that you can use to repair the rest.

What I'd do is :

Boot from a Live CD/USB drive.
Mount each partition one at a time and have a look at what it contains - a 
listing of the partitions will also tell you what type it is, if Win8 is still 
there then that should show as NTFS. If there's a /etc/fstab then that's a 
Linux/Unix root filesystem and you can see from the contents of the file what 
other partitions it uses. You can also look for files like /etc/debian_version 
which will give you a bit more clue as to which is which.

Once you have identified a suitable root partition, use rescue mode to start 
the system and mount that as the root filesystem - actually I think it does a 
chroot. You can mount it's other filesystems (mount -a) and then have a booted 
system. From there, you can use update-grub and grub-install to put a working 
bootloader back in place.
Whether grub shows all the other systems depends on the settings you give it, 
and/or what the distro configures it to do. From memory, I think Debian 
defaults to looking for others.

The tricky thing with multiple OSs is managing the bootloader. By default, each 
one will want to install it's own. So whenever you do anything in Ubuntu that 
needs an update to the boot config, it'll do it's own thing and install the 
grub that's installed in Ubuntu. Similarly for Debian. And of course, Windows 
will just blow away anything it feels like !

So it may be best to remove (uninstall & purge) the grub package(s) from all 
but one OS. You then have to reboot into that one OS whenever your need to 
update grub - but you'll have a more consistent experience.

The tricky one is that many installers will want to install their own by 
default - and it may or may not be difficult to persuade them not to screw up 
your current install. From memory, Debian does ask before installing grub, and 
it asks if you want to scan for other OSs. I have a feeling that some others, 
especially in "easy install" mode, may just go ahead and do what they like.


PS - what was the last OS you installed that broke it ?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]