LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Grub install f up (https://www.linuxquestions.org/questions/debian-26/grub-install-f-up-916927/)

Hungry ghost 12-04-2011 06:53 PM

Quote:

Originally Posted by widget (Post 4542034)
It appears that you have a mixed up MBR thinking that you are using grub-legacy while attempting to use the menu from grub-pc.

That's the impression I have, as well.

Anyway, try the following, not sure if it will work, but it won't harm. Boot a live cd, -it has to be a new one that uses grub2-, and execute the these commands logged in as root:

Code:

mkdir /mnt/debian
mount /dev/sda6 /mnt/debian
grub-install --root-directory=/mnt/debian --recheck /dev/sda

(More info about how to reinstall grub2 here). I will keep investigating about this issue, too.

Regards.

widget 12-04-2011 07:11 PM

I have been studying and find the this very confusing.

One problem is that I have never seen the boot info script come up with errors.

How about trying it again but use this link to get the script. It may be the same, I did not check the one you used but the authors ask that folks be directed to this page.
http://bootinfoscript.sourceforge.net/

One problem is that you have grub-legacy installed on an OS using a kernel that was put out long after support for grub-legacy ended. I do not think this is the direct cause of your troubles but when you get back into that install I would install grub-pc on it.

It could be that the lack of info from that install was due to the boot info script errors. Lets try it again and see if it works better with the link above.

sdfi 12-04-2011 07:17 PM

How can i tell if the version of grub on the liveCD is grub2 or grub-legacy? is it 'grub -v' or something?? [liveCD is puppy4, i'd rather not burn another CD if i don't have to]

widget 12-04-2011 07:25 PM

Code:

grub-install -v
is what you are looking for.

There is no need to burn a new CD if it is grub-legacy.

You need to check the repo for grub-pc. If it is there all you do is, as root;
apt-get purge grub grub-common

and then

apt-get install grub-pc grub-common

That will put the correct command knowledge on your ram, will in no way effect the CD itself. When you reboot it will be gone.

CD/DVD RW is your friend. That or a usb stick (I know nothing about them as I do not have one but they seem to be the cats meow).

sdfi 12-04-2011 07:32 PM

Right.. so both voyage's version and puppy 4's version of grub was 0.97.. ie legacy. [sidenote: it really would have been nice for the debian installer to have figured this out.. also WTF is up with seemingly no WPA support??]

I have no wifi with the LiveCD so i'll go try plugging in and see what i can do..

[its 2011, you should really get yourself a USB drive! :)]

widget 12-04-2011 07:49 PM

Quote:

Originally Posted by sdfi (Post 4542068)
Right.. so both voyage's version and puppy 4's version of grub was 0.97.. ie legacy. [sidenote: it really would have been nice for the debian installer to have figured this out.. also WTF is up with seemingly no WPA support??]

I have no wifi with the LiveCD so i'll go try plugging in and see what i can do..

[its 2011, you should really get yourself a USB drive! :)]

I have a usb drive. Dual 320GB WB SATA2 pc type internal drives in an external enclosure.

You are right though, I really should have one of the sticks. Next time I am in some damned town that sells them at a decent price I will get one. Here (population 500) they are do much for me.

sdfi 12-04-2011 07:54 PM

Go on to ebay, i guarantee you'd get a low-ish capacity one for <$2, sent to your door! ..unless you're not a fan of ebay.

ANYWAY; i've ran the grub2 install command, and it has come back at me
Code:

The following command line was extrated from /etc/default/grub or the 'kopt' peram in GRUB Leg's menu.1st Please verify that it is correct and modify it if necessary.
L Command line:
[blank]

just hit OK? [edit: DONE]

sdfi 12-04-2011 08:21 PM

Quote:

Originally Posted by odiseo77 (Post 4542041)
try the following
Code:

mkdir /mnt/debian
mount /dev/sda6 /mnt/debian
grub-install --root-directory=/mnt/debian --recheck /dev/sda


Done, no change. NB: /dev/hda5 (no idea why it went from s to h.. i never got that-- but 6 is the swap partition and it wouldn't let me use that. Also, it complained about post mbr gap again.

widget 12-05-2011 01:06 AM

Quote:

Originally Posted by sdfi (Post 4542105)
Done, no change. NB: /dev/hda5 (no idea why it went from s to h.. i never got that-- but 6 is the swap partition and it wouldn't let me use that. Also, it complained about post mbr gap again.

Sorry for the delay. Had to go to the bar. Yes that does sound weird. This town is the county seat. Biggest town in the county. 500 population. Wife is off tonight but is one of the main bartenders. What does this have to do with me? Would take to long to explain.

Grub-pc has no menu.list. Does not exist. Will never be found.

Does have a /boot/grub/grub.cfg that serves a similar role. It is not editable, not true. Makes no sense to edit it as it is over written every time "update-grub is run.

Do you know how to do a full chroot to your system, preferably the Squeeze install?

The reason I ask is that I have no idea how to deal with Voyage. It is using an obsolete version of grub (one I dearly loved) but will not deal with modern OS's well).

What needs done is to remove grub-pc and grub-commmon from that install. This is not because it is bad. It is to make sure that everything knows it is there. Then it needs to be reinstalled.

As root;
Code:

ap-get install grub-pc grub-common
This will give you the conditions like a new install of Debian Squeeze. Hopefully it works this time.

sdfi 12-05-2011 12:39 PM

urgh this is driving me mad.
I chrooted into debain (like below)
Code:

mkdir /debian
mount /dev/hda5 /debian
chroot /debian

I uninstalled grub with 'apt purge grub grub-common'.
The damn thing was asking for my debian CD for sources, but the CD drive would not open. I changed the sources to use online... and 'apt-get install grub-pc grub-common' returns 'unable to locate package grub-pc', same for grub-common! (although apt-get update works fine)!. urgh. I have figured how to force the CD drive open (there is no eject command found) and now of course i've deleted the line with the CD repo on it and i don't know how to add it back in!

62chevy 12-05-2011 03:39 PM

Quote:

Originally Posted by sdfi (Post 4542764)
urgh this is driving me mad.
I chrooted into debain (like below)
Code:

mkdir /debian
mount /dev/hda5 /debian
chroot /debian

I uninstalled grub with 'apt purge grub grub-common'.
The damn thing was asking for my debian CD for sources, but the CD drive would not open. I changed the sources to use online... and 'apt-get install grub-pc grub-common' returns 'unable to locate package grub-pc', same for grub-common! (although apt-get update works fine)!. urgh. I have figured how to force the CD drive open (there is no eject command found) and now of course i've deleted the line with the CD repo on it and i don't know how to add it back in!


I think the easiest thing to do is use the Debian installer to install grub again.

Boot the CD or USB stick the use the Advance options>Rescue mode enter your keyboard hostname and other info then select the partition your Debian is on then 'Reinstall the Grub Boot Loader '. That should do every thing for you. When done select reboot and you should be in your new Debian install.

It may or may not detect your other Linux install but it should see Window$ XP just fine.

Hungry ghost 12-05-2011 03:40 PM

Well, what I would do to get away of this situation fast would be to download supergrub and a) dd it to a floppy or b) install it into a usb stick. If you have a floppy drive, you can try downloading it from here, then simply execute:

Code:

dd if=/path/to/super_grub_disk_hybrid-1.98s1.iso of=/dev/fd0
(Then boot it and select to display the installed OSs).

For b), check this: http://www.supergrubdisk.org/wiki/SGD_Howto_make

I tried the first method and it let me boot Debian from the floppy drive (yes, I still have one :)).

The idea is that you can boot Debian and then try to reinstall grub from there.

EDIT: You can also try the suggestion by 62chevy above and see if it works for you.

Cheers.

widget 12-05-2011 04:47 PM

I think using the installation disk is the way to go.

Assuming that gets the job done, you had better be checking your /etc/apt/sources.list. Sounds like there could be a problem there.

sdfi 12-07-2011 05:31 PM

There is no 'Reinstall the Grub Boot Loader' option under Advance options>Rescue mode on the install CD. The options are 'execute a shell in [root fs location]' 'execute a shell in installer location', change root fs, and reboot.

widget; like i said, i removed the CD from sources.list. (It has the normal online sources, and they 'hit' fine when running apt-get update.) How do i put the install CD back in sources.list?

widget 12-08-2011 11:34 AM

I don't know how you removed it. If you deleted the lines they need put back in.

If you commented them out (easier to do and restore) just uncomment them.

As it was a default install this may not work but you could try chrooting in again and trying;
Code:

apt-get install --reinstall grub-pc grub-common
if the .debs are in your cache that should work. I am pretty sure they are not.

I use this script when chrooting. It works for partitions that are labeled which at least your Debian partition seems to be.
Code:

#!/bin/sh

echo "Debian"

mkdir /mnt/debian-root
mount /dev/sda5 /mnt/debian-root/
mount -o bind /proc /mnt/debian-root/proc
mount -o bind /dev /mnt/debian-root/dev
mount -o bind /dev/pts /mnt/debian-root/dev/pts
mount -o bind /sys /mnt/debian-root/sys
cp /etc/resolv.conf /mnt/debian-root/etc/resolve.conf
chroot /mnt/debian-root /bin/bash

this should give you full access. I believe this will work as is for you but if not check for typos and change the "sda" to "hda". I think that the "sda" will work.

Just copy this to the desktop of your Live Session, check the permission to make sure it is set to be executed as a program and double click on it. At least with the gnome terminal this will give you some options, just click on the one to run the bugger from terminal.

Run;
Code:

apt-get update
to make sure you have a good connection. Assuming that is good install the 2 packages.

This should install that grub on the MBR. This should get you into your Debian install.

Any further work to get grub working right should be done from there as it is more effective than doing it remotely.


All times are GMT -5. The time now is 06:46 AM.