LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 12-04-2009, 01:33 PM   #1
Kcghost
LQ Newbie
 
Registered: May 2006
Posts: 13

Rep: Reputation: 0
Problem in Booting Linux(GRUB2)


Okay, so I had a problem recently with my dual-boot Windows XP and Ubuntu laptop. GRUB2 was installed to MBR and booting fine, but Windows XP started going screwy and I had to reinstall XP to fix it. Due to my attempts to fix XP and re-installation, XP overwrote the MBR so no more GRUB - just boots straight to XP. Now I want it to dual-boot again.

I have actually come across this problem several times before for some reason or another, and I usually just boot GRUB (v.0.95) off a cd, edit up the lines to point to the right initrd, kernel, and root partition - boot up my linux and reinstall grub or lilo. As long as I can boot linux once, I'll have no problem. But GRUB is having problems with my hard drive (there is some sort of strange hardware configuration with this laptop: its a Compaq CQ50-110US - I previously had lots of problems installing Linux at all until I tried the latest Ubuntu)

Anyway I use these commands:
root (hd0,4)
kernel /boot/vmlinuz-(version-stuff)-generic root=/dev/sda5
initrd /boot/initrd.img-(version-stuff)-generic

Not sure if initrd is right, but it doesnt matter it doesnt get past the kernel line, it cant find it. It confirms (hd0,4) is ext4, then complains of a "Bad file or directory type". Any attempts afterwards (even the exact same attempt) give "Disk read error". It seems to me like its just locking up after the root is set, and I doubt I can use GRUB v.0.95 at all.

I also tried Smart BootManager, Gujin, GAG, XOSL, but they all suck and do not let you boot a kernel or sometimes even recognize a linux partition.

I tried booting off my ubuntu install disc as a liveCD and trying things from there. Turns out its either impossible or difficult to reinstall grub with chroot or lilo off a liveCD.


Anyone have any suggestions how to boot up my Ubuntu linux? Better bootloaders? Method of installing a working bootloader from a liveCD? Cosmic Rays? Anything, really. Thanks in advance for any help.

EDIT:
I just solved this myself, sorry for unnecessarily posting - got grub2 re-installed from the liveCD, in a complicated manner. For anyone who ends up in a situation where you get grub-probe errors, try this:
sudo grub-install --recheck --root-directory=/mnt/ /dev/sda
(assuming you mounted the partition to /mnt)

Last edited by Kcghost; 12-04-2009 at 02:00 PM. Reason: Solved
 
Old 12-04-2009, 06:11 PM   #2
aus9
Guru
 
Registered: Oct 2003
Posts: 5,056

Rep: Reputation: Disabled
hi

glad you solved it. In case others google to this page...I find an easier way to USE a live cd with grub2 command to redo grub2 into mbr....as long as the files still exist on the hard drive...is run

Code:
upgrade-from-grub-legacy
 
  


Reply


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
grub2 returns a "invalid magic number" error when booting slackware 13.0's kernel baji Slackware - Installation 4 03-09-2010 06:15 PM
Grub2 (1.96) loopback problem on usb-stick ganimo Linux - General 4 10-01-2009 07:26 AM
grub2 installation problem firewiz87 Linux - Software 4 08-17-2009 02:56 AM
debian sid and grub2 problem jackgu1988 Debian 39 08-08-2009 09:42 PM
grub problem and looking for grub2 docs m-jackson Linux - Newbie 1 10-27-2006 02:18 AM


All times are GMT -5. The time now is 11:37 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