Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Grub downgraded after adding new OS

Linux Kernel, Network, and Services configuration.
Message
Author
TheDonger
Posts: 1
Joined: 2014-04-12 17:05

Grub downgraded after adding new OS

#1 Post by TheDonger »

Hello,

I installed Kali Linux on my laptop which was already running Debian Wheezy and Win7.
Sadly Kali downgraded my Grub version to 1.99 from 2.0.
If i login to Wheezy the grub controls don't detect Kali.
If i boot Kali it detects it all
Is there a way for me to go back to the Debian Wheezy Grub? Or am i stuck with the Kali Grub now?

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Grub downgraded after adding new OS

#2 Post by phenest »

TheDonger wrote:If i login to Wheezy the grub controls don't detect Kali.
If i boot Kali it detects it all
Can you explain how you are "detecting"? What grub controls? Explain what commands/tools you are using and how you are using them please.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

User avatar
kiyop
Posts: 3983
Joined: 2011-05-05 15:16
Location: Where persons without desire to improve themselves fear to tread, in Japan
Been thanked: 3 times

Re: Grub downgraded after adding new OS

#3 Post by kiyop »

Have you read http://docs.kali.org/introduction/shoul ... kali-linux ?
Is Kali Linux Right For You?

As the distribution developers, one would likely expect us to recommend that everyone use Kali Linux. The fact of the matter is however, that Kali is a Linux distribution specifically geared towards professional penetration testing and security auditing and as such, it is NOT a recommended distribution for those unfamiliar with Linux.

In addition, misuse of security tools within your network, particularly without permission, may cause irreparable damage and result in significant consequences.
If you are looking for a Linux distribution to learn the basics of Linux and need a good starting point, Kali Linux is not the ideal distribution for you. You may want to begin with Ubuntu or Debian instead.
Boot debian and execute with root privilege:

Code: Select all

os-prober
df
for a in $(blkid|grep \ TYPE=\"ext|cut -d: -f1);do mount -t auto $a /mnt -o ro;if [ -e /mnt/boot ];then echo $a;ls /mnt/boot;umount -l /mnt;fi;done
and post the result.

I wonder if "os-prober" cannot detect the linux distributions installed in a partition which is overly mounted by another partition.
In my debian wheezy, also it could not detect the debian installed on a partition, for example /dev/sda1, after

Code: Select all

mount -t ext4 /dev/sda1 /mnt
mount -t ext4 /dev/sda2 /mnt
Openbox, JWM: Jessie, Sid, Arch / Win XP (on VirtualBox), 10
http://kiyoandkei.bbs.fc2.com/

ew-linux
Posts: 46
Joined: 2014-01-13 21:22

Re: Grub downgraded after adding new OS

#4 Post by ew-linux »

You are not stuck with the Kali grub. If you want the Debian grub back, then just login to Debian, open a terminal window, and:

Code: Select all

sudo grub-install /dev/sda
Obviously, if your disk isn't sda, then you need to replace sda in the command above.

This will give you your Debian grub back. Whether it will detect and add a entry for Kali I don't know. Never tried Kali. But if not, it's better to add a manual entry for Kali....

User avatar
kiyop
Posts: 3983
Joined: 2011-05-05 15:16
Location: Where persons without desire to improve themselves fear to tread, in Japan
Been thanked: 3 times

Re: Grub downgraded after adding new OS

#5 Post by kiyop »

"grub-install" does not invoke "update-grub" thus does not invoke "os-prober".

To the OP, TheDonger,

Have you executed "update-grub" on debian?
Do you know that debian wheezy uses grub2 version 1.99-27+deb7u2 now?
https://packages.debian.org/wheezy/grub-common
Openbox, JWM: Jessie, Sid, Arch / Win XP (on VirtualBox), 10
http://kiyoandkei.bbs.fc2.com/

ew-linux
Posts: 46
Joined: 2014-01-13 21:22

Re: Grub downgraded after adding new OS

#6 Post by ew-linux »

The question was if he had to stick with the Kali grub that currently handles the grub on his PC. The answer is NO, he can get his Debian grub back, by installing it as I described....

There is no point in running "update-grub" in his Debian install, before he has installed the Debian-grub. Which has been overwritten by the Kali-grub. So you see, he first has to do grub-install from his Debian-install, and then run "update-grub" if it isn't invoked by grub-install. But many times it is...

Anyway, to make sure, then just:

Code: Select all

 sudo grub-install /dev/sda && sudo update-grub
Happy? :)

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Grub downgraded after adding new OS

#7 Post by phenest »

TheDonger wrote:If i boot Kali it detects it all
Is there a way for me to go back to the Debian Wheezy Grub? Or am i stuck with the Kali Grub now?
If Kali detects it all, does it matter?
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

User avatar
kiyop
Posts: 3983
Joined: 2011-05-05 15:16
Location: Where persons without desire to improve themselves fear to tread, in Japan
Been thanked: 3 times

Re: Grub downgraded after adding new OS

#8 Post by kiyop »

phenest wrote:
TheDonger wrote:If i boot Kali it detects it all
Is there a way for me to go back to the Debian Wheezy Grub? Or am i stuck with the Kali Grub now?
If Kali detects it all, does it matter?
+1.

Furthermore, on grub2 installed by kali linux, the OP can use the config file /boot/grub/grub.cfg in debian wheezy by a Grub2 command "configfile".
Furthermore, without installation of grub2 on debian wheezy, "update-grub" can include a menuentry in /boot/grub/grub.cfg.

Maybe the OP misunderstands something or ... I misunderstand what the OP wrote, possibly because of bad English communication of mine and the OP. :)
If the debian grub2 can not detect kali and if the kali grub2 can detect all the linux (kali and debian), why should the OP install debian grub2 onto the MBR? I cannot understand the reason.
Openbox, JWM: Jessie, Sid, Arch / Win XP (on VirtualBox), 10
http://kiyoandkei.bbs.fc2.com/

ew-linux
Posts: 46
Joined: 2014-01-13 21:22

Re: Grub downgraded after adding new OS

#9 Post by ew-linux »

Perhaps because he intends to keep Debian, while Kali are just visiting his computer? It makes sense to use your main install as the "master-grub". Lot's of people are distro-hopping and multibooting, but they usually have one main OS/distro, and of course, they want that install to handle grub for all the others. Let's say that the OP get's tired of kali in a day or two, and removes it. Then he suddenly has a unbootable system, and then need to fire up Debian in live mode, to write grub to mbr.

So there are many reasons why someone wants a perticular install to handle the grub, but the most important one, is because he wants to. That's the linux way. We don't settle with whatever is the easiest solution in the moment, but we make it work like we want it to..., and really, nobody should have to defend themselves for wanting one solution instead of another. That kind of mentality doesn't belong in Linux. There are no right way, no best way. Just the way you want to do it.

User avatar
kiyop
Posts: 3983
Joined: 2011-05-05 15:16
Location: Where persons without desire to improve themselves fear to tread, in Japan
Been thanked: 3 times

Re: Grub downgraded after adding new OS

#10 Post by kiyop »

ew-linux wrote:Perhaps because he intends to keep Debian, while Kali are just visiting his computer?
(snip by kiyop)
Let's say that the OP get's tired of kali in a day or two, and removes it.
Thank you for your nice guess! :)
Openbox, JWM: Jessie, Sid, Arch / Win XP (on VirtualBox), 10
http://kiyoandkei.bbs.fc2.com/

ew-linux
Posts: 46
Joined: 2014-01-13 21:22

Re: Grub downgraded after adding new OS

#11 Post by ew-linux »

kiyop wrote:
ew-linux wrote:Perhaps because he intends to keep Debian, while Kali are just visiting his computer?
(snip by kiyop)
Let's say that the OP get's tired of kali in a day or two, and removes it.
Thank you for your nice guess! :)
Not a guess. I simply don't question why anyone wants to do something. But the odds of any unskilled user keeping Kali for a long period of time, are rather slim...

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Grub downgraded after adding new OS

#12 Post by phenest »

ew-linux wrote:I simply don't question why anyone wants to do something.
Then you should. Knowing the reason will help provide the best solution. What if the OP doesn't want to remove Kali (they haven't mentioned it)? They may not realise that it's ok to leave it as it is. It can save a lot of frustration on the OP's part.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

User avatar
kiyop
Posts: 3983
Joined: 2011-05-05 15:16
Location: Where persons without desire to improve themselves fear to tread, in Japan
Been thanked: 3 times

Re: Grub downgraded after adding new OS

#13 Post by kiyop »

ew-linux wrote:
kiyop wrote:
ew-linux wrote:Perhaps because he intends to keep Debian, while Kali are just visiting his computer?
(snip by kiyop)
Let's say that the OP get's tired of kali in a day or two, and removes it.
Thank you for your nice guess! :)
Not a guess.
I don't want to communicate with a person who is not logical. ;)
phenest wrote:
ew-linux wrote:I simply don't question why anyone wants to do something.
Then you should. Knowing the reason will help provide the best solution. What if the OP doesn't want to remove Kali (they haven't mentioned it)? They may not realise that it's ok to leave it as it is. It can save a lot of frustration on the OP's part.
+1.
Openbox, JWM: Jessie, Sid, Arch / Win XP (on VirtualBox), 10
http://kiyoandkei.bbs.fc2.com/

User avatar
llivv
Posts: 5340
Joined: 2007-02-14 18:10
Location: cold storage

Re: Grub downgraded after adding new OS

#14 Post by llivv »

TheDonger wrote:Hello,

I installed Kali Linux on my laptop which was already running Debian Wheezy and Win7.
Sadly Kali downgraded my Grub version to 1.99 from 2.0.
If i login to Wheezy the grub controls don't detect Kali.
If i boot Kali it detects it all
Is there a way for me to go back to the Debian Wheezy Grub? Or am i stuck with the Kali Grub now?
make a backup first because there is no guarantee this will work without error.

boot debian
update grub
chroot into kali and purge grub
exit out of kali chroot
update grub again

reboot
with your fingers crossed and your backup ready

there are other ways
ie: liveCD - which you should also have ready along with a recent full backup,

fix the mbr manually - not recommended
In memory of Ian Ashley Murdock (1973 - 2015) founder of the Debian project.

User avatar
kiyop
Posts: 3983
Joined: 2011-05-05 15:16
Location: Where persons without desire to improve themselves fear to tread, in Japan
Been thanked: 3 times

Re: Grub downgraded after adding new OS

#15 Post by kiyop »

Do not do the following, which llivv suggested in the former post of him/her:
llivv wrote:make a backup first because there is no guarantee this will work without error.

boot debian
update grub
chroot into kali and purge grub
exit out of kali chroot
update grub again

reboot
The above may result in the disaster ew-linux expected.
If you dare to carry out the above, execute "grub-install /dev/sda" or so in order to install grub code onto the MBR of /dev/sda or so by debian, before rebooting debian.

I do not know if kali linux is so clever that purging grub restores the original debian grub2 code which had been installed onto the MBR before kali's grub code was installed, or not. I guess no.

There are many possibilities. As the OP has not given enough information, we should ask the OP to give more information.
Now it seems that he can boot kali linux and debian with grub(2) kali linux installed and that debian grub cannot detect kali linux, although the OP may misunderstand the situation. Thus, I think that it is better not to remove grub2 kali linux installed.
After grub2 of debian become able to detect kali linux and generate a menuentry for kali linux, the OP can safely install grub2 code on debian to take over the control of the boot process.
Last edited by kiyop on 2014-04-15 11:57, edited 2 times in total.
Openbox, JWM: Jessie, Sid, Arch / Win XP (on VirtualBox), 10
http://kiyoandkei.bbs.fc2.com/

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Grub downgraded after adding new OS

#16 Post by phenest »

kiyop wrote:Do not do the following, which llivv suggested in the former post of him/her:
It would be nice if him/her replied. I disilike replying to thin air.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

User avatar
llivv
Posts: 5340
Joined: 2007-02-14 18:10
Location: cold storage

Re: Grub downgraded after adding new OS

#17 Post by llivv »

disaster?
if gurb doesn't detect kali
oh no! reinstall kali time.

I'd probably do that - reinstall kali - anyways, but not before Debians grub was working properly.

maybe the OP will learn how not to install two grubs to the mbr on the same system. A good lesson to learn.
imo anyways.

it is the mbr and not the gpt right? oh god.....
In memory of Ian Ashley Murdock (1973 - 2015) founder of the Debian project.

User avatar
kiyop
Posts: 3983
Joined: 2011-05-05 15:16
Location: Where persons without desire to improve themselves fear to tread, in Japan
Been thanked: 3 times

Re: Grub downgraded after adding new OS

#18 Post by kiyop »

llivv wrote:disaster?
if gurb doesn't detect kali
oh no! reinstall kali time.

I'd probably do that - reinstall kali - anyways, but not before Debians grub was working properly.
It is not sure that the OP wants to reinstall (and/or uninstall) kali.
The kali may contain the OP's elaborate settings
Do not assume that the OP wants to do what you would want to do.

The OP just posted:
TheDonger wrote:Hello,

I installed Kali Linux on my laptop which was already running Debian Wheezy and Win7.
Sadly Kali downgraded my Grub version to 1.99 from 2.0.
If i login to Wheezy the grub controls don't detect Kali.
If i boot Kali it detects it all
Is there a way for me to go back to the Debian Wheezy Grub? Or am i stuck with the Kali Grub now?
Openbox, JWM: Jessie, Sid, Arch / Win XP (on VirtualBox), 10
http://kiyoandkei.bbs.fc2.com/

User avatar
llivv
Posts: 5340
Joined: 2007-02-14 18:10
Location: cold storage

Re: Grub downgraded after adding new OS

#19 Post by llivv »

kiyop wrote: It is not sure that the OP wants to reinstall (and/or uninstall) kali.
The kali may contain the OP's elaborate settings
Do not assume that the OP wants to do what you would want to do.
reread : http://forums.debian.net/viewtopic.php? ... 03#p537401
where is the disaster?
In memory of Ian Ashley Murdock (1973 - 2015) founder of the Debian project.

User avatar
kiyop
Posts: 3983
Joined: 2011-05-05 15:16
Location: Where persons without desire to improve themselves fear to tread, in Japan
Been thanked: 3 times

Re: Grub downgraded after adding new OS

#20 Post by kiyop »

If kali's grub is removed, the grub code on the MBR cannot find the necessary files in /boot/grub directory of kali.
Then, the OP may be unable to boot OS. (I would be able to boot.)
Thus, the OP may reinstall kali, which may delete kali's setting.

Thus, as I mentioned, the OP need not remove grub of kali. The first thing to do is not to remove grub of kali, but to continue using grub of kali and found a good way to enable grub of debian to recognize kali.
Openbox, JWM: Jessie, Sid, Arch / Win XP (on VirtualBox), 10
http://kiyoandkei.bbs.fc2.com/

Post Reply