LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 06-20-2006, 07:27 AM   #1
Dark Templar
LQ Newbie
 
Registered: May 2006
Distribution: Fedora Core 4
Posts: 26

Rep: Reputation: 15
Unhappy I can't install grub and i can no longer access linux


Okay,
here the story begins
I had 2 HDDs, one no.1, XP installed. On no.2, Linux installed with grub loader, so that i can use it to either boot into windows or linux.

When i removed one HDD, the other OS couldn't be launched. i.e. if i remove no.1, linux fails to load, if i remove no.2, XP fails to load.

So, it came to my mind to fix the mbr and partition table of no.1, so, i UNPLUGGED no.2 to securely deal with no.1 XP HDD. >>> SUCCEEDED AND I CAN LOG INTO XP BY SELECTING WHICH HDD TO BOOT FROM FROM THE BIOS WINDOW AT PC STARTUP.

Now, i re-plugged no.2 (whcih contained Linux), and unplugged no.1.
As i've expected, linux won't launch, it comes to this screen and stops>>>
Grub _ (blincking cursor).

Now, i'm trying to install grub via the rescue CD. I made tons of searches here and i've tried all this commands but unfortunately, they FAILED
NOTE: what's between square brackets, is the response or the result of command execution >>>

sh-3.00# boot /dev/hdb (my boot partition is hdb1) [COMMAND not found]

sh-3.00# locate grub or find grub [couldn't find group slocate in the /etc/groupfile. Fatal error: this is a result of the group missing something, i can't remember]

sh-3.00# chroot /mnt/sysimage [WORKS]

grub> find /boot/grub/stage1 [not working, i can't remeber the message]

grub> grub-install /dev/hdb1 or hdb2 [both not working]

HOW CAN I INSTALL THIS PIECE OF GRUB CRAP AGAIN? I CAN'T ACCESS MY LINUX, PLEASE GIVE ME ANY CLUES
 
Old 06-20-2006, 07:42 AM   #2
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 31
Try starting up grub (from a grub floppy or your rescue CD or whatever):
Code:
grub> root (hd1,0)
grub> kernel /boot/vmlinuz ro root=/dev/hdb2
grub> boot
This tells grub to boot a file called vmlinuz which is stored in the first partition of your second hard drive, and to tell the kernel to start read-only and use hdb2 as the / partition. If you need clarification on any of the commands just ask. Remember that grub supports autocompletion via the Tab key, similarly to bash. If you aren't sure of the name of your kernel image file this might help you find it. If you can tell us what distro you're using (Fedora 4 from your profile?) and what your hard drive partition arrangement is we might be able to give more specific instructions.

This should allow you to get back into your Linux install. From there you might have more luck with grub-install.

Last edited by Gethyn; 06-20-2006 at 05:44 PM. Reason: Original grub instructions were incorrect, now fixed
 
Old 06-20-2006, 07:42 AM   #3
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Fetch a grub package for your distribution, boot a liveCD or a resucue CD and install grub again. Then alter GRUB config file (usually menu.lst but in some cases grub.conf).

Edit:

Quote:
sh-3.00# boot /dev/hdb (my boot partition is hdb1) [COMMAND not found]

Well, there most definitely is not such command/program in a normal Linux installation such as "boot", that you could run from a normal shell, so this is not a surprise really. In Grub command prompt this might work, maybe, but not in a bash or so.

sh-3.00# locate grub or find grub [couldn't find group slocate in the /etc/groupfile. Fatal error: this is a result of the group missing something, i can't remember]

How come you don't have group slocate? well, if not, then create it: "groupadd slocate" and then edit /etc/group and add yourself in slocate. Do a "updatedb" and after that locate ought to work..find command might not work like "find grub", but try "find / -name grub" instead.


sh-3.00# chroot /mnt/sysimage [WORKS]

Well, this just chroots to /mnt/sysimage so /mnt/sysimage becomes virtually /



grub> find /boot/grub/stage1 [not working, i can't remeber the message]

Again, that syntax might not work. Find works like "find <where to start looking> -<option> <parameter>" so you might use this instead: "find / -name /boot/grub/stage1"



grub> grub-install /dev/hdb1 or hdb2 [both not working]

I'm not familiar with this command; are you intended to run it from a shell like bash, or from the grub command prompt?

Last edited by b0uncer; 06-20-2006 at 07:50 AM.
 
Old 06-20-2006, 08:48 AM   #4
Dark Templar
LQ Newbie
 
Registered: May 2006
Distribution: Fedora Core 4
Posts: 26

Original Poster
Rep: Reputation: 15
Unhappy

Quote:
Originally Posted by Gethyn
Try starting up grub (from a grub floppy or your rescue CD or whatever):
Code:
grub> root hd(1,0)
grub> kernel vmlinuz ro root=/dev/hdb2
grub> boot
I can't understand the >> root hd(1,0) <<
i tried it and it gave Error 11: Unrecognized device string
I'm using FC4,
My partition arrangement came after i typed in >> fdisk -l /dev/hdb >>>
/dev/hdb1 boot=* ID=83 System=linux
/dev/hdb2 ID=84 System=Linux Swap/Solaris
/dev/hdb3 ID=f System=W95 Ext'd (LBA)
/dev/hdb5 7 HPFS/NTFS
/dev/hdb6 C W95 FAT32 (LBA)


When i found it not working, i ignored it (forgive me, this might sound silly, but i'm not a linux hard user)
i tried the next command you wrote, it gave ERROR 12 (invalid device requested)

About your reply b0uncer , well, i don't understand a relatively large part of it , but i'm gonna try the modification of the commands .

About the grub-install commnand, i guess it should work, but it's not working
 
Old 06-20-2006, 09:30 AM   #5
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
here's how i used to do it:

Boot rescue cd

change root / partition with
Code:
chroot /mnt/sysimage
Code:
su -
password

Code:
grub-install /dev/hdx
(where x is your primary drive if you want the bootloader on the mbr) from above it looks like you were selecting a partition, i believe you must give the disk device, not it's partition.)
 
Old 06-20-2006, 11:56 AM   #6
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 31
Oops...sorry, I should have looked at my grub configuration file first, the instruction I gave you was wrong (fixed in previous post in case someone comes to it later on). Try this instead:
Code:
grub> root (hd1,0)
grub> kernel /boot/vmlinuz ro
grub> boot
As I said before, 'vmlinuz' may not be quite the right name. For the second line, I suggest typing 'kernel /boot/vm<Tab> ro' (where <Tab> is the Tab key). This should hopefully find the right filename for you.

You said you didn't understand the root (hd1,0). (I know, I didn't type it correctly last time, sorry about that). It's telling grub what to use as the root directory/partition to find files. For reasons I don't know, grub uses a different convention to Linux. It counts from 0, the first number is the number of the drive, and the second number is the number of the partition. So (hd1,0) is the second drive, first partition. It should correspond to hdb1. Hope that makes more sense!

Once you get into Linux, try doing as ethics says, type (as root) 'grub-install hda' - assuming you want to put grub on the boot sector of your first drive.

Last edited by Gethyn; 06-20-2006 at 05:45 PM.
 
Old 06-20-2006, 01:44 PM   #7
Dark Templar
LQ Newbie
 
Registered: May 2006
Distribution: Fedora Core 4
Posts: 26

Original Poster
Rep: Reputation: 15
Angry

Unfortunately, the problem is persistant. Yes, i found that you've written the first command wrongly, and this is actually not the problem , because i tried after searching the command with the correct parentheses position, BUT IT DIDN'T WORK EITHER. It tells me something like incorrect device, or device not found. Don't tell me you don't know what is your partition config. , because i've tried all possible things>>>hd1,0 hd0,1 hd0,0, hd1,1, etc.......

Quote:
Originally Posted by Gethyn
Code:
grub> root (hd1,0)
grub> kernel /boot/vmlinuz ro
grub> boot


So, i guess the next command won't work either.

As for ethics, i've logged to the root prompt, till i reached your third code command, but it didn't work too, outputting the same error>>>device not found or something like this.

I'm sure i've been trying the commands with all possible combinations with correct typing.

Please give me further help. This is getting really deep
 
Old 06-20-2006, 05:56 PM   #8
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 31
Just a thought: did you use LVM (logical volume management) when setting up your Fedora install? If so, you may well need to feed rather different commands to your grub to get it to boot. This is part of the reason that I avoid LVM.

Now here's an idea, don't know why I didn't think of this before. Can you boot into Windows, with both hard drives plugged in, as they were when you installed Fedora? If so, download a program called explore2fs. This will allow you to read files from your Fedora partition, assuming that you used the default ext3 filesystem. Find the /boot/grub/grub.conf file. This will contain the commands passed to grub at boot time. Try posting the contents of the file up here, and tell us how your drives were arranged at the time of installation.
 
Old 06-21-2006, 10:16 AM   #9
Dark Templar
LQ Newbie
 
Registered: May 2006
Distribution: Fedora Core 4
Posts: 26

Original Poster
Rep: Reputation: 15
Arrow boot/grub/grub.conf FILE

Code:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd1,1)
#          kernel /boot/vmlinuz-version ro root=/dev/hdb2
#          initrd /boot/initrd-version.img
#boot=/dev/hda
default=1
timeout=5
splashimage=(hd1,1)/boot/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.11-1.1369_FC4)
	root (hd1,1)
	kernel /boot/vmlinuz-2.6.11-1.1369_FC4 ro root=LABEL=/ rhgb quiet
	initrd /boot/initrd-2.6.11-1.1369_FC4.img
title Windows XP
	rootnoverify (hd0,0)
	chainloader +1
I hope this might help you.
At installation, i had my one HDD (containing XP) connected as MASTER while the 2nd HDD was connected as SLAVE (on which i installed FC4).
 
Old 06-21-2006, 10:24 AM   #10
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 31
Okay, can you make a grub floppy? If you can, try plugging your hard drives back in as they were at install, and boot the computer from the floppy. When grub starts, try putting in
Code:
grub> root (hd1,1)
grub> kernel /boot/vmlinuz-2.6.11-1.1369_FC4 ro root=LABEL=/ rhgb quiet
grub> initrd /boot/initrd-2.6.11-1.1369_FC4.img
grub> boot
If that doesn't work, I will be very puzzled.
 
Old 06-21-2006, 11:05 AM   #11
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Don't know what the fuss is all about here.

The fist bootable disk is known to Grub as (hd0) and has XP inside.

The second disk is known to Grub as (hd1) and FC resides in it.

Grub has been installed in the MBR and that is always the first bootable disk or (hd0).

Removing (hd1) will deny Grub the access of its configuration file and Grub will be unable to execute this statement and it must stop
Code:
splashimage=(hd1,1)/boot/grub/splash.xpm.gz
Removing (hd0) will not work either because the original (hd1) suddenly becomes (hd0) to Grub while the FC installed disk/partition references are all pointing to the second disk.

Both XP and Linux need the correct disk/partition reference to boot. Any attempt to change it will cause a mismatch. If it is desirable to alter the disk order this should be done once and then revise the disk/partition reference in Linux

/boot/grub/menu.lst and /etc/fstab

For XP it is more complicated and often necessitates a re-installation. However both Grub and Lilo can rearrange the disk order on-the-fly to avoid the re-installation.

Gethyn's suggestion will boot if the the (hd0) and (hd1) are present and the disk order has not been changed.

One can access any Linux with a Live CD. Grub can do everything other boot loader can do. The crap bit is usually user-related. Don't take my word for it. Take a look at the last link of my signature.
 
Old 06-21-2006, 11:33 AM   #12
Dark Templar
LQ Newbie
 
Registered: May 2006
Distribution: Fedora Core 4
Posts: 26

Original Poster
Rep: Reputation: 15
How to make a grub booting floppy?

No, i can't and i don't know how in the first place to create a grub floppy?

Can you make me an image of that floppy if you have it, if applicable, i.e. grub.img using this software >>> http://debian.teleglobe.net/tools/rwwrtwin.zip ?

If you can, please upload it to any free-file hosting websites. I'll be very much pleased if this works


saikee>>> Okay, i'm looking to that link, standby for my feedback...

Last edited by Dark Templar; 06-21-2006 at 11:41 AM.
 
Old 06-21-2006, 04:41 PM   #13
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 31
This page has a grub floppy image file, and instructions on how to write it to a disk in Windows.
 
Old 06-21-2006, 07:25 PM   #14
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
A Linux user can make a bootable Grub floppy from any Live CD that supports Grub, as the stage1 and stage2 files will be inside there.

Full instruction is given by Grub Manual Section 3.1. Do a Google search "Grub Manual".

A Grub floppy created this way has no operating system attached to and as such there is no PC system that it cannot boot!

A Linux Live CD and a Grub floppy are the most lethal weapons in the booting business.
 
Old 06-22-2006, 03:21 PM   #15
Dark Templar
LQ Newbie
 
Registered: May 2006
Distribution: Fedora Core 4
Posts: 26

Original Poster
Rep: Reputation: 15
Talking I enjoyed this BATTLE very much

Guys, i love you . I damn love you. THANK YOU VEEEEEERY MUCH.

Status> MY GRUB + FC ARE BACK ONLINE.

As you said saikee , the GRUB floppy, isn't just a lethal weapon, it's ,, it's ,,, it's an EMP gun (one like that in ERASER )

I've used your LONG command Gethyn and it worked, but instead of just booting, i used this command (for anyone else who has a similar problem)>>>> setup (hd0) , noting that i've only plugged in my linux HDD so that i won't corrupt anything on the XP one (otherwise, my elder brother will KILL ME )

But i'm really happy.

But one more thing
It's been a looooong time since i last used my linux, so, i've forgotten my root password. I can't remember it by any means. I've squeezed my memory cells , but IN VAIN
Is there any way i could reset my root password. (in XP, hiren's boot CD has a utility to reset the Administrator == root (in linux) password), so, isn't there here any similar utility???

Last edited by Dark Templar; 06-22-2006 at 03:23 PM.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to remove grub + linux partition from drive? No longer needed. Boggit Linux - General 7 11-09-2008 12:29 AM
No longer have remote access. warrengf Linux - Networking 2 04-17-2006 07:37 AM
No longer booting into GRUB J_K9 Linux - Newbie 13 03-10-2005 11:40 AM
linux answer no longer links to the main grub post aus9 LQ Suggestions & Feedback 5 09-12-2004 05:09 PM
ran grub-install, no longer sure how to boot windows Golovko Linux - General 6 07-23-2003 11:15 AM


All times are GMT -5. The time now is 11:31 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
Open Source Consulting | Domain Registration