LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-14-2007, 01:51 AM   #1
narz
Member
 
Registered: May 2007
Location: US
Distribution: slackware
Posts: 186

Rep: Reputation: 37
Bootloader gurus please HELP


guys im not doing good at all right now. i seriously have stuff on my notebook i CANT lose.
here is the problem step by step. i reinstalled windows along side debian. so i had to reinstall the grub bootloader to rid the windows overwrite loader.
then i set up a new NTFS partition under windows and then got a grub error at boot time.
i think when i made that new partition, the partition numbers on my hard drive changed so the linux root changed from #3 to #4. so i was like shit, ill just remount my linux partitions from the rescue cd and reinstall grub again. no such luck, grub is refusing to reinstall. it says something like "FATAL ERROR, GRUB CANNOT REINSTALL"
so then i tried to restore the windows bootloader from the XP cd to clean up the mess on the MBR since i figured windows is so good at destroying stuff, but now windows wont even load after i restored its own bootloader, i just get the message "NO OPERATING SYSTEM FOUND" on boot.
Someone please help me to clean up this mess ive created, i have an internal SATA HD, but dont know much about bootloader geometry or how many bootloaders i have scattered around my hard drive right now.
A reinstall is almost out of the question, i have too much stuff i cant lose.
Please, please, please help.
It would be wrong for a man to cry over their computer not booting.
 
Old 06-14-2007, 02:10 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,056

Rep: Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915Reputation: 1915
From your Debian CD, let's see the output from the following, run as root
Code:
fdisk -l
dd if=/dev/sda count=1 | hexdump -C | egrep -i "(ntfs|lilo|grub)"
The first just lists your partitions, the second will pull the eyecatcher from the boot record.
 
Old 06-14-2007, 02:25 AM   #3
narz
Member
 
Registered: May 2007
Location: US
Distribution: slackware
Posts: 186

Original Poster
Rep: Reputation: 37
fdisk just lists my partitions, everything looks fine, when i used that other script you wrote i get "hexdump: not found" the built in shell to the cd is ash.
i have to go to sleep now though, ive had 2 sleepless nights over all this and need some sleep, hope you or someone else can give me pointers in the meantime as to how to completely remove the old grub bootloader so i can overwrite with a new one or something along those lines.
thanks.
see you guys in a few hours.
 
Old 06-14-2007, 03:08 AM   #4
thloh85
Member
 
Registered: Apr 2006
Location: Earth
Distribution: BLFS customized
Posts: 160

Rep: Reputation: 31
One solution is to use a live CD to backup your whole harddisk and reinstall your whole system...
2nd solution, try this, not sure if this works though :
1. Boot a live CD
2. Run 'sudo grub'
3. In GRUB, type 'root (hd0,2)' (You might wanne change the hd0 to your harddisk number and 2 to your linux partition, I'm not sure which hdd and partition your linux is in...
4. Type 'setup (hd0)'
5. Reboot

That's all I can give... Good luck...
 
Old 06-14-2007, 07:39 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
If you have valuable data on the drive--and no backup--then don't keep doing things to the disk without a plan. Everything you do reduces the chances of recovering the data.

The safest thing to do would be to clone the drive as ghostdev suggested. From the live CD, you can use dd to clone the drive to an image on---eg--and external USB drive.

No hexdump on a linux distro???? Enter "man hexdump" to be sure.
 
Old 06-14-2007, 12:05 PM   #6
narz
Member
 
Registered: May 2007
Location: US
Distribution: slackware
Posts: 186

Original Poster
Rep: Reputation: 37
ok nothing seems to work and i dont have much more time to dick around figuring it out. i can just delete the root partition and keep my home partition and then just reinstall and that should get me back to getting into both linux and windows right?
or is it possible im going to get another error when i do that too?
i really dont care too much about spending a few hours to reinstall my programs, i just dont want to lose my saved stuff and actually want to be able to use my computer again.
thanks.

edit: about the hexdump, the cd is a minimal net install cd like 100-something MBs so it doesnt have too much stuff on it.
or do any of you know a forum or somewhere where GRUB and hard disk geometry is well versed.

Last edited by narz; 06-14-2007 at 12:19 PM.
 
Old 06-14-2007, 02:42 PM   #7
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by narz
or do any of you know a forum or somewhere where GRUB and hard disk geometry is well versed.
Some of the stuff at my site--link below--may be useful.

Also, the "How it works" site is good---search Google using "HIW partitions"

On of the pre-eminent booting experts is Saikee--find one of his posts here at LQ--and look at his links
 
Old 06-14-2007, 05:38 PM   #8
narz
Member
 
Registered: May 2007
Location: US
Distribution: slackware
Posts: 186

Original Poster
Rep: Reputation: 37
pixellany, thanks for the tips.
i have spent a good part of the day looking into my options. i will try some stuff when i get home tonight and report back my findings later on.
wish me luck.
 
Old 06-14-2007, 08:08 PM   #9
IndyGunFreak
Senior Member
 
Registered: Aug 2003
Location: Indpls
Distribution: Laptops: Debian Jessie XFCE, NAS: OpenMediaVault 3.0
Posts: 1,355

Rep: Reputation: 70
Quote:
Originally Posted by pixellany
If you have valuable data on the drive--and no backup--then don't keep doing things to the disk without a plan. Everything you do reduces the chances of recovering the data.
Bingo...

What in the world provoked you to do all this and not have a current and up to date backup of all your important data?

IGF
 
Old 06-14-2007, 08:19 PM   #10
stealth_banana
Member
 
Registered: Mar 2004
Location: Scotland
Distribution: Debian Sid / Kubuntu
Posts: 170

Rep: Reputation: 30
When you mounted the drives from a live cd, did you chroot into the linux on the hard drive? If not it will be looking for the grub data from your live cd virtual filesystem and not what is on the hard drive.

If your linux partition was on say /dev/hda2 issue

chroot /dev/hda2

then try the grub reinstall. I know this method will happily work using LILO, not tried it with GRUB.

After you got it up, do a backup!!!!!!!

Last edited by stealth_banana; 06-14-2007 at 08:20 PM.
 
Old 06-14-2007, 11:12 PM   #11
narz
Member
 
Registered: May 2007
Location: US
Distribution: slackware
Posts: 186

Original Poster
Rep: Reputation: 37
Quote:
Originally Posted by IndyGunFreak
Bingo...

What in the world provoked you to do all this and not have a current and up to date backup of all your important data?

IGF
dude wasnt exactly my plan that grub wasnt gonna load, but thanks for your insightful comments

Quote:
Originally Posted by stealth_banana
When you mounted the drives from a live cd, did you chroot into the linux on the hard drive? If not it will be looking for the grub data from your live cd virtual filesystem and not what is on the hard drive.
i already used the install cd to reinstall grub and mount my drives and it worked fine.

i think my problem is in the /boot/grub/menu.lst file, because when i made that new partition under windows, it somehow reassigned the linux root partition to (0,3) when it was at (0,2) beforehand. i dont know how to get into that file as i cannot boot up into my root partition or see the files under it, dont know how to anyways. i could use some help on this.

i would imagine grub is trying to load from the old partition and cant and thats why its not letting me reinstall or anything, i could be wrong as i dont know much about this but it seems to be a viable reason for it right?
 
Old 06-15-2007, 03:35 AM   #12
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
Quote:
Originally Posted by narz
then i set up a new NTFS partition under windows and then got a grub error at boot time.
i think when i made that new partition, the partition numbers on my hard drive changed so the linux root changed from #3 to #4.
Sounds to me like you failed to mention that you shrunk your Windows partition and created a new partition with the new free space which was before your Linux / partition. So, why not reverse this disastrous move and boot up Linux and Windows to back up your data before trying it again with a better plan?. Delete the new partition, you might not have to use up the free space if your Linux partitions did not get moved in the process. Then again, the size of your Windows partition has changed in the MBR partition information, so that might create a problem, chances are it won't.
 
Old 06-15-2007, 03:39 AM   #13
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
In this thread, I posted instructions on how to restore Windows XP boot loader to undo the damage you done from within Windows. Or to retrieve data from that partition, which ever applies.

Last edited by Junior Hacker; 06-15-2007 at 04:15 AM.
 
Old 06-15-2007, 04:28 AM   #14
stealth_banana
Member
 
Registered: Mar 2004
Location: Scotland
Distribution: Debian Sid / Kubuntu
Posts: 170

Rep: Reputation: 30
You could boot a live cd then go and edit /etc/fstab to reflect the new disc partitioning system. If what was /dev/hda2 is now /dev/hda3, how will the system know?
 
Old 06-15-2007, 05:41 AM   #15
IndyGunFreak
Senior Member
 
Registered: Aug 2003
Location: Indpls
Distribution: Laptops: Debian Jessie XFCE, NAS: OpenMediaVault 3.0
Posts: 1,355

Rep: Reputation: 70
Quote:
Originally Posted by narz
dude wasnt exactly my plan that grub wasnt gonna load, but thanks for your insightful comments
I've rarely heard of an "expected" computer problem/crash...

Certainly common sense dictates when messing with installing multiple OS's, etc, to have a current backup..

I really hope you get your data back, unfortunately we all have to learn the hard way sometimes.

IGF
 
  


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
Windows 2000 Bootloader vs. Mandriva LILO Bootloader Dregnan Mandriva 7 12-03-2007 10:55 PM
For the cd burning gurus out there ! synapse Slackware 7 04-07-2006 05:34 AM
How can I disable the grub bootloader and enable the lilo bootloader? abefroman Linux - General 1 08-06-2005 09:53 AM
I need create bootloader. How make bootloader? swipple Fedora - Installation 3 01-23-2005 01:22 PM
Need gurus' help... fxlee Linux - Networking 1 01-28-2002 10:47 AM


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

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration