LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Grub2 reinstall after Debian downgrade from Jessie to Wheezy (https://www.linuxquestions.org/questions/debian-26/grub2-reinstall-after-debian-downgrade-from-jessie-to-wheezy-4175529979/)

chris.j 01-04-2015 02:39 AM

Grub2 reinstall after Debian downgrade from Jessie to Wheezy
 
Hello again!

And so I've messed up! I'm building a NAS based on Debian 7.6 Wheezy x64, but was trying to get realtek-firmware package and have enabled the testing repository in my APT sources.list. It wouldn't be a problem if I would disable this repo right after installing the realtek-firmware package, but I've forgotten about this entry and performed
Code:

apt-get update & apt-get upgrade
commands. My Debian installation upgraded to Debian 8 Jessie testing distribution, but I didn't execute the apt-get dist-upgrade command, so hopefully not whole system has got updated. I've decided to roll back the system to Wheezy in order to have again the stable release, so I've followed the guide here. Unfortunatelly my Grub2 package still remains in the beta 2.2 version, and after the downgrade, when I boot up my system I get a message "Loading initial ramdisk" and right after then "Press any key to continue". If I don't press any key the system will boot up normally after few seconds, but those few seconds bother me enough to write a post here :) . This is a NAS system based on SSD drive, so whole boot up process took 21 seconds before the downgrade. Now it's a bit longer and doesn't look very nice when throwing some suspicious messages at boot time. I've Googled this "Press any key to continue" warning message and have found that this is probably related to broken Grub2 configuration, so I've decided that I'll delete Grub2 package from my system using
Code:

apt-get purge grub2
and then will install it again from the booted up system, but from the stable repository, so all the configuration files will be regenerated again. There aren't many resources on the Internet on how to install Grub2 on a running system, and I'm not totally sure about how to do it, so I decided to ask you for help. Could you tell me in step-by-step process how to install Grub2 using apt-get on a already running system. My root filesystem on the SSD drive is in /dev/sda but there's also my data 3-disk RAID5 array on /dev/md0 which shouldn't be broken by what I'm trying to do here, because there's 500+GB of valuable data.

Many thanks for all the help and advices.

EDIT:
I've found some new information concerning this topic: I've check the apt-show-versions command and have found out that the Grub2 package in my system is indeed from Debian Wheezy (the package version is 1.99 and not 2.2-beta), but still the Grub2 working in my MBR (stage1 I guess) is Grub 2.2-beta which may cause the errors. So I think the right solution here would be to reinstall Grub 1.99 to my MBR on /dev/sda, but here's another problem: I don't have the grub-install command on that system. Could you point me to the right package containing this file?

Best regards,
Chris.

chris.j 01-04-2015 03:07 AM

Solution
 
Hehe, that was easy :) ...
I've found a user with similar problem here. The solution was to reinstall grub-pc package with apt-get install --reinstall grub-pc command and to install grub2 to MBR with grub-install /dev/sda. Everything is working fine now!

Cheers!


All times are GMT -5. The time now is 08:03 AM.