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/)

sdfi 12-03-2011 10:59 AM

Grub install f up
 
I have a system with voyage linux, and i wanted to put a regular debian install on the same machine, also. So i followed the install CD.. resized the exisiting partition, made new ones, all went well. Until GRUB.. i selected to install it (assuming it would pick up on the fact there already was a GRUB install..

as it picked up 'unknown linux distro' i went ahead and installed it to the MBR. Now my HDD doesn't boot. What do i do???

Hungry ghost 12-03-2011 11:45 AM

Do you have some liveCD from which you can repair grub? If you do, try the following from the liveCD:

Code:

mkdir /mnt/debian
mount /dev/your_debian_partition /mnt/debian
mount -o bind /dev /mnt/debian/dev
mount -o bind /sys /mnt/debian/sys
mount -t proc none /mnt/debian/proc
chroot /mnt/debian /bin/bash
update-grub2
grub-install /dev/sda

You could also download Super Grub Disc, and try to fix your grub install from there (I haven't used it, but I've read that it's very handy for these cases).

Regards.

widget 12-03-2011 12:55 PM

Quote:

Originally Posted by odiseo77 (Post 4541095)
Do you have some liveCD from which you can repair grub? If you do, try the following from the liveCD:

Code:

mkdir /mnt/debian
mount /dev/your_debian_partition /mnt/debian
mount -o bind /dev /mnt/debian/dev
chroot /mnt/debian /bin/bash
update-grub2
grub-install /dev/sda

You could also download Super Grub Disc, and try to fix your grub install from there (I haven't used it, but I've read that it's very handy for these cases).

Regards.

Use the directions above. Much better choice than third party tools.

Here is a link to more complete instructions;
https://help.ubuntu.com/community/Gr...stalling_GRUB2

Should work with either of your installs but I would go with the Debian as being more reliable than voyage that does not seem to be designed for real computer use anyway so may have some problems with file system paths.

I have not looked at voyage seriously so may just be blowing that out of some unnamed orifice. I would not trust it anyway for boot duty.

The command "update-grub2" is obsolete, by the way. It is just "update-grub". Both will still work but the "grub2" usage ended 2 years ago when support for grub-legacy was dropped.

62chevy 12-03-2011 01:19 PM

In Sid update-grub2 is a symbolic link to update-grub. In Squeeze I still have both in /usr/sbin.

widget 12-03-2011 03:54 PM

Quote:

Originally Posted by 62chevy (Post 4541139)
In Sid update-grub2 is a symbolic link to update-grub. In Squeeze I still have both in /usr/sbin.

If you try "update-grub" in Sid it will work fine. This is a native command for grub.

Documentation is a problem with grub-pc an Debian, much as I love it, is not always on top of the newest things. It is a surprise to me just how little is actually known about grub-pc and how to use it.

On the other hand I know that it is a moving target and that I am way behind the thing too. One of these days I really need to spend a couple, three days and catch up, probably totally screwing my grub a few times.

62chevy 12-03-2011 05:03 PM

Quote:

Originally Posted by widget (Post 4541245)
If you try "update-grub" in Sid it will work fine. This is a native command for grub.

Documentation is a problem with grub-pc an Debian, much as I love it, is not always on top of the newest things. It is a surprise to me just how little is actually known about grub-pc and how to use it.

On the other hand I know that it is a moving target and that I am way behind the thing too. One of these days I really need to spend a couple, three days and catch up, probably totally screwing my grub a few times.

One of my biggest complaints with Debian is the Documentation is either old or not there. Some docs date back to Sarge.

widget 12-03-2011 07:06 PM

Quote:

Originally Posted by 62chevy (Post 4541278)
One of my biggest complaints with Debian is the Documentation is either old or not there. Some docs date back to Sarge.

Grub has not done too well themselves with documentation.

The best is in the Ubuntu community documentation and
http://ubuntuforums.org/showthread.php?t=1195275

which is written by the guy guilty of most of the Ubuntu documentation. I prefer the forum thread. Only the first post is needed as he keeps it up to date.

It also has valuable links at the end. Many are other, specialty threads by the same guy, drs305, who was one of us that got hit at Ubuntu 9.10 alpha2 time with grub2 and NO documentation. That was fun.

The post linked above was actually started in that testing cycle put together with all the discoveries by those of us that were working on grub along with his extensive experimentation. He continues to experiment extensively and knows things that the Grub guys are not real sure about.

His thread on passwords in grub is worth reading for the paranoid.

You can also learn to mess with all the scripts in grub to get just what you want. He can pretty much get it to sit up and beg.

I stick with messing with symbolic menu entries and have no trouble with booting to a HDD that is really screwed and recovered through testdisk but can't be read by e2fscheck or os-prober. Generated menu entries do not work there at all.

Symbolic ones do.

for Debian branch Linux this works great if edited to your drive and partition table;
Code:

echo "Adding Squeezy on sda7" >&2
cat << EOF
menuentry "Squeezy on sda7" {
    set root=(hd0,7)
        linux /vmlinuz root=/dev/sda7 ro quiet
        initrd /initrd.img
}
EOF

This works for RH branch Linux;
Code:

echo "Adding Squeezy on sda7" >&2
cat << EOF
menuentry "Mandriva-Gnome" {
        linux (hd0,12)/boot/vmlinuz
        initrd (hd0,12)/boot/initrd.img
}

Add to your /etc/grub.d/40_custom file and save as 06_custom after editing. Anything can be used that you want between the "" marks. The first set is what you see in terminal when running "update-grub". The second is what you see on your screen menu.

The position of the { and } is critical.

If you have a long instruction string in the Debian branch entry do not have line wrapping enabled in you test editor.

These entries will always boot to the newest kernel on the defined partition.

The RH example is old (09). Don't even have Mandriva on here. I just used it last week, edited for my new install of an extremely bloated PCLOS FullMonty edition. Works like a charm.

Hungry ghost 12-03-2011 07:06 PM

Quote:

Originally Posted by widget (Post 4541126)
The command "update-grub2" is obsolete, by the way. It is just "update-grub". Both will still work but the "grub2" usage ended 2 years ago when support for grub-legacy was dropped.

Yes, I know. For some reason, I have the custom of using update-grub2 instead of just update-grub. Maybe a reminiscence of old times when grub2 started being implemented :)

Cheers.

Hungry ghost 12-03-2011 09:13 PM

To the OP: I forgot, the above commands won't work because you will need at least /sys mounted (and probably /proc as well), so try only one of the following options:

a) Follow the commands above but execute these couple of commands before the chroot command:

Code:

mount -o bind /sys /mnt/debian/sys
mount -t proc none /mnt/debian/proc

or b) execute the following (with the debian partition mounted on /mnt/debian):

Code:

grub-install --root-directory=/mnt/debian /dev/sda
(Sorry for the misleading advice in my first post, I forgot you need /sys and /proc mounted on the chrooted Debian in order for the commands to work. I edited my post to include these couple of commands).

Regards.

sdfi 12-04-2011 04:17 PM

wow I wish I always got this many responses! Anyway, after grub-install /Dev/sda I get;

this ms-dos style partition label has no post mbr gap embedding won't be possible. .. grub can only be installed using blocklists --unreliable and discouraged. use --force? ?

sdfi 12-04-2011 04:38 PM

well I caved and ran it with --force. it said no problems occurred. however, my system still fails to boot, still complaining 'hard disk boot sector invalid'.

Hungry ghost 12-04-2011 05:24 PM

hmm, strange. Could you download this script, uncompress it, give it execution permissions (chmod +x boot_info_script.sh) and run it like this?: ./boot_info_script.sh. Then please, attach the RESULTS.txt file here, so we can see it. One question: did you create an extra /boot partition for Debian, or only a root (/) partition? (In case you have created an extra /boot partition, which one is it?)

Regards.

widget 12-04-2011 05:31 PM

Quote:

Originally Posted by odiseo77 (Post 4541988)
hmm, strange. Could you download this script, uncompress it, give it execution permissions (chmod +x boot_info_script.sh) and run it like this?: ./boot_info_script.sh. Then please, attach the RESULTS.txt file here, so we can see it. One question: did you create an extra /boot partition for Debian, or only a root (/) partition? (In case you have created an extra /boot partition, which one is it?)

Regards.

+112

sdfi 12-04-2011 05:58 PM

1 Attachment(s)
i've attached it since it doesn't format properly with notepad;

widget 12-04-2011 06:46 PM

Ah, the wonders of using an OS made for imbedded use on a pc. This looks like fun.

You have a completely screwed grub installation and it will take some thought to straighten this out.

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.

How this was done is beyond me but I would really like to know. Trying to duplicate that may be a good idea on another box so that a bug could be filed with what ever caused it. Has to be one grub or the other.

I will study more on your results.

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.

62chevy 12-08-2011 01:43 PM

Quote:

Originally Posted by sdfi (Post 4544631)
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?


What CD are you using because the the only one I get those in is Lenny's installer every Squeeze install gave me the option to reinstall grub.

Hmmm the live CD? Didn't try that , let me test.


EDIT: Just checked the Squeeze live DVD and it lets you reinstall Grub too.

sdfi 12-09-2011 11:41 AM

Quote:

Originally Posted by widget (Post 4545262)
I don't know how you removed it.

Yes, i deleted the lines. It was stupid, i know. What i am trying to get at is exactly what do i need to enter back in.

62chevy - It is squeeze CD 1. This.

widget 12-09-2011 02:23 PM

Use the rescue option to drop into a shell and use the command in my script, one at a time, starting with the "mkdir" line.

When you do the last line, starts with "chroot", do;
Code:

apt-get update
then the grub removal stuff and then;
[code]
apt-get install grub-pc grub-common
[code]
then, to be sure it will boot to your install;
Code:

grub-mkconfig
this will print out the /boot/grub/grub.cfg file to your terminal. Check it to see if the entry for your Debian install is there.

If so boot to it and we will get the others to boot from there (easier from there).

If it is not there then do;
Code:

update-grub
and run the mkconfig command again to check.

You should watch when grub is installed to make sure it is also installed on the MBR. You should see a line saying the install is finished with no errors (can't remember the exact wording).

If you are worried that it is not installed or not sure, run;
Code:

grub-install /dev/sda
Should do the trick.

62chevy 12-09-2011 02:35 PM

1 Attachment(s)
This a screenshot of the .iso you used.

widget 12-09-2011 05:53 PM

You should not send such good screen shots. I tried to click on the menu window to close it.

sdfi 12-10-2011 10:50 AM

Right. Done everything as suggested by widget. I got apt-get install grub-pc grub-common to work.. [i think there was a problem with my sources.list but fixed now.] Although it reported the error
Code:

error processing grub-pc (--configure):
subprocess installed post-installation script returned error exit status 255

I could only see that grub found installations on /dev/sda1 (voyage) and not /dev/sda5 (debian). I ran all your suggestions in the last post and it hasn't changed my boot situation.

Note; 'cp /etc/resolv.conf /mnt/debian-root/etc/resolve.conf' - both should be resolv.conf AFAICT.
62chevy; i only get that if i select /dev/sda1 as my root filesystem. If i pick /dev/sda5 i do not get a grub option.

62chevy 12-10-2011 12:01 PM

Quote:

Originally Posted by sdfi (Post 4546602)
Right. Done everything as suggested by widget. I got apt-get install grub-pc grub-common to work.. [i think there was a problem with my sources.list but fixed now.] Although it reported the error
Code:

error processing grub-pc (--configure):
subprocess installed post-installation script returned error exit status 255

I could only see that grub found installations on /dev/sda1 (voyage) and not /dev/sda5 (debian). I ran all your suggestions in the last post and it hasn't changed my boot situation.

Note; 'cp /etc/resolv.conf /mnt/debian-root/etc/resolve.conf' - both should be resolv.conf AFAICT.
62chevy; i only get that if i select /dev/sda1 as my root filesystem. If i pick /dev/sda5 i do not get a grub option.

That doesn't sound right something had to go wrong. Run the Debian CD again in Rescue Mode but this time do not choose a partition to work from instead choose ' Do not use a root file system ' then ' Execute a shell in the installer environment ' then ' continue ' when you get a command prompt use ' fdisk -l ' to see what partitions show up. It's possible you are mistaken on the partition number or something went wrong when you created the partition. If /dev/sda5 is there then run ' e2fsck /dev/sda5 '. Let us know how that works out for you.

widget 12-10-2011 03:38 PM

Quote:

Originally Posted by 62chevy (Post 4546649)
That doesn't sound right something had to go wrong. Run the Debian CD again in Rescue Mode but this time do not choose a partition to work from instead choose ' Do not use a root file system ' then ' Execute a shell in the installer environment ' then ' continue ' when you get a command prompt use ' fdisk -l ' to see what partitions show up. It's possible you are mistaken on the partition number or something went wrong when you created the partition. If /dev/sda5 is there then run ' e2fsck /dev/sda5 '. Let us know how that works out for you.

Yes. Do that.

sdfi 12-10-2011 03:42 PM

Quote:

Originally Posted by fdisk -l
/dev/sda1 Linux
/dev/sda2 Extended
/dev/sda5 * Linux
/dev/sda6 Linux Swap

sda5 is labelled as boot. I don't know why there is no sda3/4? or what sda2 is about.

Quote:

Originally Posted by fsck /dev/sda5
../dev/sda5 was not cleanly unmounted... [checking..] ..optimizing directories.. [more checking...]
*****FILE SYSTEM WAS MODIFIED*****
xyz/123 files, abc/def blocks


widget 12-10-2011 04:42 PM

First. Sda1 is a primary partition. You are limited to only 4 primaries. Sda2 is an extended partition. This is a type of primary partition that you can put a number of other "logical" partitions inside of.

Sda5 and sda6 are logical partition within sda2. Logical partition numbers always start with 5. You could have 4 primary partitions 1,2,3 and 4 with 4 being an extended partition. Thus 5 makes sense to start logical partition numbers with.

Try setting up grub again. Get in with the rescue disk and run, as root;
Code:

dpkg --configure grub-pc grub-common
then rerun;
Code:

update-grub
and
Code:

grub-mkconfig
check what it is picking up now.

This is interesting as other OS' are detected by /etc/grub.d/30_os-prober and the install on which grub is actually installed, Debian in this case, is detected by /etc/grub.d/10_linux. 2 different scripts for 2 different jobs.

I do not understand why one would be working and not the other. Of the two 10_linux is by far the most reliable.

sdfi 12-10-2011 05:16 PM

Well thanks for clearing up about the partitions. I'm not sure what you are hoping here as it seems i've done all that before. It wasn't clear so I tried it first by chrooting into the debian install as there was no dpkg in installer environment;

Things 'dpkg --configure grub-pc grub-common' complains about; several complaints related to no default locale, 'unkown terminal: bterm Check the TERM environment variable'
dpkg: error processing grub-pc (--configure): subprocess installed post-installation script returned error exit status 255
dpkg:error processing grub-common (--configure): package grub-common is already installed and configured

update-grub only mentions /dev/sda1

then i used /dev/sda5 as root from the installer and 'dpkg --configure grub-pc grub-common' brought up a config window, i selected to install on /dev/sda. I passed over the option of installing it to /dev/sda5... following this, still only mentions of install in /dev/sda1. I tried running it again to also add grub to /dev/sda5 but it wouldn't let me saying it was already configured.

The thing that is really bugging me about this is that grub is supposedly finding the voyage install on /dev/sda1, and yet it is still not possible to boot into even this?? Nor do i get any grub screen, just 'Hard disk boot sector invalid'.

62chevy 12-10-2011 06:15 PM

1 Attachment(s)
Go back to ' Rescue Mode ' like you did when you used the command ' fdisk -l '.

This time I want you to mount /dev/sda5 like this.

Code:

mount -t auto /dev/sda5 /mnt
Then 'cd /mnt ' and do an ' ls '.

If mount gives you an error tell us what the error is, write it down verbatim, it's important to what what error is given and why.

If no error then have a look around and see if everything is installed. Check /etc, /boot, /lib, bin, /sbin and /usr.

Some directories will be empty. If you want mount /dev/sda1 to /media and compare the two but should not be exactly the just similar.

The last thing I would like for you to do is ' df -h '. This will give the size of the partition and amount used and unused.

Code:

chevy@debian:~$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1            114G  38G  71G  35% /
tmpfs                7.9G    0  7.9G  0% /lib/init/rw
udev                  7.9G  220K  7.9G  1% /dev
tmpfs                7.9G    0  7.9G  0% /dev/shm
/dev/sdb1            294G  170G  109G  61% /home/chevy/Storage
chevy@debian:~$


widget 12-10-2011 06:36 PM

Yes you need to be in sda5 to do anything to sda5. Glad that dpkg finally got those packages installed.

Grub has no reason to be installed on sda5 in this context. The only place for it is /sda. That puts it on the MBR.

sdfi 12-11-2011 08:29 AM

No error with mount -t auto /dev/sda5. /etc, /boot, /lib, bin, /sbin and /usr all present. df -h reports nothing that looks odd.. sda5 is using 664M of 27G.

@widget; i thought the same, just clutching at straws.

Again, why won't voyage or even grub itself boot?

widget 12-11-2011 12:19 PM

You are getting some sort of screen menu, this is a good sign.

Try to get the detailed partition info asked for in post 42.

Something else that we should have asked for long ago was for you to rerun the boot script again. Please do both of these things.

There is another thing I would like you to try that would be much easier from a Live CD for you to do. That is to add a couple entries to your /etc/grub.d/40_custom file. As both of the installs are Debian based they should work. I would not do this until you have gotten the above requested info as doing so will change some things that we need to know about the current conditions.

These are the menu entries;
Code:

echo "Adding Debian on sda5" >&2
cat << EOF
menuentry "Debian on sda5" {
    set root=(hd0,5)
        linux /vmlinuz root=/dev/sda5 ro quiet
        initrd /initrd.img
}
EOF

echo "Adding Voyage on sda1" >&2
cat << EOF
menuentry "Voyage on sda1" {
    set root=(hd0,1)
        linux /vmlinuz root=/dev/sda1 ro quiet
        initrd /initrd.img
}
EOF

After getting the partition and boot info and posting it, go to a Live Session if you can and just copy/paste these into the /etc/grub.d/40_custom file. You will have to do this as root.

After doing this you will probably find it easiest to go back to the Debian install disk to chroot back to sda5 and run;
Code:

update-grub
and then to see if they will show up;
Code:

grub-mkconfig
If they show up they you should reboot and see if they work. They should be below the entry that you currently see on your menu screen.

sdfi 12-11-2011 03:21 PM

I thought i'd given the relevant information from df -h but here is exactly what it says, when i have mounted both sda1 and sda5
Code:

Filesystem        Size        Used        Available        Use%        Mounted on
tmpfs                124.7M        32.0K        124.7M                0%        /dev
/dev/sr0        648.0M        648.0M        0                100%        /cdrom
/dev/sda5        27.0G        664.6M        25.0G                3%        /mnt/sda5
/dev/sda1        9.2G        2.9G        5.8G                33%        /mnt/sda1

Quote:

rerun the boot script again.
How?

widget 12-11-2011 04:08 PM

Use this link from a Live Session and post the results.text completely.
http://bootinfoscript.sourceforge.net/

sdfi 12-11-2011 05:54 PM

1 Attachment(s)
results.txt

Edit: done the rest of post #45.. the 40_custom file was printed, but i saw no recognition of /dev/sda5 containing linux.
Quote:

They should be below the entry that you currently see on your menu screen.
Just to make it clear (again) I do NOT see any menu screen on booting the HDD. Grub does NOT load.

widget 12-12-2011 01:56 AM

I am about knackered.

As far as the boot info script goes in section one. Grub should load.

Have you had Voyage on there a long time? There seems to be a lot of kernels for it installed.

How are you using the internet? Are you on a different box or using a Live CD?

Sdb claims to have grub legacy installed on the MBR but no files to go to. Where is it getting this idea from, any idea? Was Voyage handling the MS boot?

Back to sda there is no mention of MS in the grub.cfg file (grub) or for that matter in your menu.lst (grub-legacy). Boot info script makes no real sense of either Debian or Voyage grub files. They appear to be faulty as hell.

I thought about trying to restore the grub-legacy from Voyage to the MBR but I think that is a waste of time as it doesn't look at all healthy either.

I have seen a lot of boot info script results. Even, ineptly, helped folks get MS to boot even though I don't use it and don't like it a bit. I have never seen a script result like this.

I really think this one has me whipped. Have no real idea at all where to go with this one.

The only thing I can think of is, if you are using or have a Debian Live CD you could boot to it, us apt to install "testdisk" on the live session and use it. May straighten your drive out, I just do not know.

Other wise I would back up your data from sda, format the bugger and start over.

Hopefully someone will jump in here with a lot better idea and we will both learn something.

Sorry, I am just out of options.

hurry_hui 12-12-2011 08:31 AM

Quote:

Originally Posted by sdfi (Post 4547476)
results.txt

Edit: done the rest of post #45.. the 40_custom file was printed, but i saw no recognition of /dev/sda5 containing linux.Just to make it clear (again) I do NOT see any menu screen on booting the HDD. Grub does NOT load.

Grub (both grub) does not load because it cannot find certain files.

We need to use manual check whether grub can see files it need to load.

We also need supergrub disk.

I will use grub2 to detect and boot manually via grub prompt (to access, on grub menu press C to enter command-line); hence we need supergrub disk or any bootable cd which boots grub2 (usually they boot isolinux). We only use device (hd0,1) and (hd0,5).

First we need to find files needed by (hd0,1)/boot/grub/menu.lst

Code:

ls (hd0,1)/
expected results vmlinuz, initrd.img

Code:

ls (hd0,1)/boot/
expected results vmlinuz-2.6.38-voyage, initrd.img-2.6.38-voyage (+ several vmlinuz and initrd.img)

Code:

ls (hd0,1)/boot/grub/
expected results stage2, menu.lst

----------------------------------------------

you can do similarly with (hd0,5)
directory we need to check:
(hd0,5)/boot/ ---> vmlinuz-2.6.32-5-686, initrd.img-2.6.32-5-686
(hd0,5)/boot/grub/ ---> core.img, grub.cfg

----------------------------------------------

having found expected files we need to type following line by line followed by ENTER and pay attention to output before executing next line

Code:

set root=(hd0,1)
linux /boot/vmlinuz-2.6.38-voyage root=/dev/sda1 ro
initrd /boot/initrd.img-2.6.38-voyage
boot

likewise you can do above for (hd0,5) and change parameter as necessary.

HTH


All times are GMT -5. The time now is 04:05 AM.