LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 12-03-2011, 11:59 AM   #1
sdfi
Member
 
Registered: Oct 2011
Distribution: debian
Posts: 107

Rep: Reputation: Disabled
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???
 
Old 12-03-2011, 12:45 PM   #2
odiseo77
Senior Member
 
Registered: Dec 2004
Location: London, UK
Distribution: Debian Sid, OpenSUSE 13.1
Posts: 1,016

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
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.

Last edited by odiseo77; 12-03-2011 at 10:18 PM.
 
Old 12-03-2011, 01:55 PM   #3
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,290

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Quote:
Originally Posted by odiseo77 View Post
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.
 
Old 12-03-2011, 02:19 PM   #4
62chevy
Member
 
Registered: Mar 2002
Location: West (By God) Virginia
Distribution: Debian Squeeze - Sid
Posts: 281

Rep: Reputation: 44
In Sid update-grub2 is a symbolic link to update-grub. In Squeeze I still have both in /usr/sbin.
 
Old 12-03-2011, 04:54 PM   #5
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,290

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Quote:
Originally Posted by 62chevy View Post
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.
 
Old 12-03-2011, 06:03 PM   #6
62chevy
Member
 
Registered: Mar 2002
Location: West (By God) Virginia
Distribution: Debian Squeeze - Sid
Posts: 281

Rep: Reputation: 44
Quote:
Originally Posted by widget View Post
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.
 
Old 12-03-2011, 08:06 PM   #7
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,290

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Quote:
Originally Posted by 62chevy View Post
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.
 
Old 12-03-2011, 08:06 PM   #8
odiseo77
Senior Member
 
Registered: Dec 2004
Location: London, UK
Distribution: Debian Sid, OpenSUSE 13.1
Posts: 1,016

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
Quote:
Originally Posted by widget View Post
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.
 
Old 12-03-2011, 10:13 PM   #9
odiseo77
Senior Member
 
Registered: Dec 2004
Location: London, UK
Distribution: Debian Sid, OpenSUSE 13.1
Posts: 1,016

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
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.

Last edited by odiseo77; 12-03-2011 at 10:19 PM.
 
Old 12-04-2011, 05:17 PM   #10
sdfi
Member
 
Registered: Oct 2011
Distribution: debian
Posts: 107

Original Poster
Rep: Reputation: Disabled
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? ?
 
Old 12-04-2011, 05:38 PM   #11
sdfi
Member
 
Registered: Oct 2011
Distribution: debian
Posts: 107

Original Poster
Rep: Reputation: Disabled
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'.
 
Old 12-04-2011, 06:24 PM   #12
odiseo77
Senior Member
 
Registered: Dec 2004
Location: London, UK
Distribution: Debian Sid, OpenSUSE 13.1
Posts: 1,016

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
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.
 
1 members found this post helpful.
Old 12-04-2011, 06:31 PM   #13
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,290

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Quote:
Originally Posted by odiseo77 View Post
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
 
Old 12-04-2011, 06:58 PM   #14
sdfi
Member
 
Registered: Oct 2011
Distribution: debian
Posts: 107

Original Poster
Rep: Reputation: Disabled
i've attached it since it doesn't format properly with notepad;
Attached Files
File Type: txt RESULTS.txt (24.5 KB, 10 views)
 
Old 12-04-2011, 07:46 PM   #15
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,290

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
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.
 
  


Reply

Tags
grub, install, mbr


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] cannot install grub (grub-probe says 'unknown fs' with ext4 and md raid) cusco Linux - Software 3 03-15-2011 02:58 AM
Grub - Does fedora automatically install a bootloader like grub? or... mitchell7man Linux - Software 10 05-09-2007 11:49 AM
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 01:55 PM
Need to (re)install GRUB: fedora c4 rescue cd (and GRUB) unable to see the harddisk whencat Fedora 4 03-05-2006 03:01 PM
Grub 0.97 issues on slackware - grub-install is very slow, & updating menu.lst fails dieyouspammer Linux - Software 1 02-27-2006 02:06 PM


All times are GMT -5. The time now is 10:04 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration