Fedora Linux Support Community & Resources Center
  #1  
Old 16th June 2008, 07:39 PM
punklinux Offline
Registered User
 
Join Date: Dec 2004
Posts: 63
Re-install Grub, Rescue no Linux partition.

Hi, my WinXP crashed and I have to re-install it so I'd like restore my Grub.
I Selected Rescue installed system, Fedora try to mount my partition on /mnt/sysimage, but it say: You don't have any Linux Partition.

I went to the shell type: fdisk -l

/dev/sda1 -> HPFS/NTFS
/dev/sda2 -> Extended
/dev/sda3 -> HPFS/NTFS
/dev/sda5 -> Linux
/dev/sda6 -> Linux swap / Solaris

and I have another HDD for my data /dev/sdb

Any help would be greatly appreciated,

thank you.
Reply With Quote
  #2  
Old 16th June 2008, 08:00 PM
hyperspace Offline
Registered User
 
Join Date: Oct 2006
Location: Lincoln, NE
Age: 56
Posts: 414
So, which one did you try to mount? /dev/sda5 or ?
__________________
lost in hypertime...

Registered Linux User #329061
Reply With Quote
  #3  
Old 16th June 2008, 08:33 PM
punklinux Offline
Registered User
 
Join Date: Dec 2004
Posts: 63
I was able to manually mount: /dev/sda5 -> /mnt/sysimage

After that I'm not sure since I'm not an expert.
I did:
chroot /mnt/sysimage
cat grub.conf (in /boot/grub)

grub-install –recheck/dev/sda (I try /dev/sda1 & sdba5, too)
gave me an error: /dev/sdb not found or not a block device.

I just found out that when I do chroot command, there is nothing in /dev/

So I'm confuse.
Reply With Quote
  #4  
Old 16th June 2008, 10:04 PM
ivancat Offline
Registered User
 
Join Date: Dec 2007
Posts: 596
to restore grub use:
Code:
chroot /mnt/sysimage
grub-install (sd0)
that will install grub into the MBR of your 1st hard drive
__________________
Ivan Cat (registered linux user #471784)
Linux Projects: constat | nconv
Fedora-related: Message In the Bottle

Last edited by ivancat; 16th June 2008 at 10:11 PM.
Reply With Quote
  #5  
Old 16th June 2008, 10:09 PM
JohnVV Offline
Registered User
 
Join Date: Aug 2005
Location: Ann Arbor
Age: 47
Posts: 3,936
grub-install /dev/sda1 or
grub-install '(sd0)' i think

when you did fdisk -l was there a " * "
/dev/sda1 * for the boot part. -- windows boot
and the install disk should be able to find / on it's own
so chroot /mnt/sysimage should be all that is needed
hi you may want to take a look at
Installing GRUB using grub-install ( just replace all hd?? with sd??)
http://www.gnu.org/software/grub/man...ub_002dinstall
or
http://www.linuxselfhelp.com/gnu/gru...er/grub_3.html
http://64.233.169.104/search?q=cache...lnk&cd=9&gl=us
--
i use the win boot loader to start grub so i don't run into this problem .
__________________
OpenSUSE 13.1-64bit & Scientific Linux 6.5-64bit ( fedora 4 to 11) and 19/20 on KVM
My Celestia Downloads

h t t p ://celestiamotherlode.net/catalog/show_creator_details.php?creator_id=10
Reply With Quote
  #6  
Old 17th June 2008, 04:11 AM
stoat Offline
Registered User
 
Join Date: Jun 2006
Posts: 7,550
Quote:
Originally Posted by ivancat

to restore grub use:
Code:
chroot /mnt/sysimage
grub-install (sd0)
that will install grub into the MBR of your 1st hard drive
Quote:
Originally Posted by John VV

grub-install /dev/sda1 or
grub-install '(sd0)' i think

when you did fdisk -l was there a " * "
/dev/sda1 * for the boot part. -- windows boot
and the install disk should be able to find / on it's own
so chroot /mnt/sysimage should be all that is needed
hi you may want to take a look at
Installing GRUB using grub-install ( just replace all hd?? with sd??)

http://www.gnu.org/software/grub/man...ub_002dinstall
Hello ivancat & John VV,

I know that you two know this stuff, and just got yourselves mixed up in what you wrote above. But I think it's important enough to set this part of the record here straight. I hope you understand and agree. I also hope punklinux understands and forgives this momentary distraction.

GRUB refers to drives and partitions differently than does a Linux operating system. In the format for operating system device names such as /dev/sdx and /dev/sdxy, x is always a letter and y is always a number. The same applies to /dev/hdx and /dev/hdxy for pre-Fedora 7 IDE drives and for IDE drives in some present-day Linux distros. On the other hand, GRUB device syntax always has been (as far back as I can remember) and now remains written only in this format: (hdx) and (hdx,y) where both x and y are always numbers.

That first link in John VV's post is to Section 3.3 of the GRUB Manual on the grub-install command. That command is a front-end script for the GRUB shell which does the actual work. But unlike the GRUB shell itself which can run either natively or in an operating system and uses only the GRUB format for drives and partitions, the grub-install command runs only in an operating system and uses syntax for drives and partitions in either the OS device name format or the GRUB format.

So in those GRUB Manual examples for grub-install in John VV's link, some of the examples refer to drives and partitions using the OS device name format, and some use the GRUB format. The ones that use the GRUB format should not be altered to change "hd" to "sd" as suggested above. For example, these two commands suggested above by ivancat and John VV are not corrrect: grub-install (sd0) and grub-install '(sd0)'. But the GRUB manual examples of grub-install that use the OS device name format can be modified as John VV suggested if the target is any drive in Fedora 7 or later, or an SATA or SCSI drive in any Linux system. For example, the command grub-install /dev/sda does work, of course. Sorry folks, I didn't invent this thing.


P.S.: To be sure of my words, I tested (in Fedora 8) the following example formats from Section 3.3 of the GRUB Manual, and they all worked...
Code:
grub-install /dev/sda
grub-install '(hd0)'
grub-install hd0
In the manual, the next one is for HURD. But I tried it anyway, and it understandably did not work for me...
Code:
grub-install /dev/hd0
These two that were suggested above by ivancat and John VV did not work...
Code:
grub-install (sd0)
grub-install '(sd0)'
My actual test results...
Code:
[root@localhost ~]# grub-install /dev/sda
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

# this device map was generated by anaconda
(hd0)     /dev/sda
(hd1)     /dev/sdb
[root@localhost ~]# grub-install /dev/hd0
/dev/hd0: Not found or not a block device.
[root@localhost ~]# grub-install '(hd0)'
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

# this device map was generated by anaconda
(hd0)     /dev/sda
(hd1)     /dev/sdb
[root@localhost ~]# grub-install hd0
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

# this device map was generated by anaconda
(hd0)     /dev/sda
(hd1)     /dev/sdb
[root@localhost ~]# grub-install (sd0)
-bash: syntax error near unexpected token `sd0'
[root@localhost ~]# grub-install '(sd0)'
Format of install_device not recognized.
Usage: grub-install [OPTION] install_device
Install GRUB on your drive.

  -h, --help              print this message and exit
  -v, --version           print the version information and exit
  --root-directory=DIR    install GRUB images under the directory DIR
                          instead of the root directory
  --grub-shell=FILE       use FILE as the grub shell
  --no-floppy             do not probe any floppy drive
  --force-lba             force GRUB to use LBA mode even for a buggy
                          BIOS
  --recheck               probe a device map even if it already exists
                          This flag is unreliable and its use is
                          strongly discouraged.

INSTALL_DEVICE can be a GRUB device name or a system device filename.

grub-install copies GRUB images into the DIR/boot directory specfied by
--root-directory, and uses the grub shell to install grub into the boot
sector.

Report bugs to <bug-grub@gnu.org>.
[root@localhost ~]#
P.P.S.: I have said it before. For me, the best thing that can come with GRUB2 is a better manual.

Last edited by stoat; 18th June 2008 at 07:08 PM.
Reply With Quote
  #7  
Old 17th June 2008, 05:58 AM
dubb Offline
Registered User
 
Join Date: Aug 2007
Location: Escondido, CA
Age: 34
Posts: 334
when you type grub-install have you tried
Code:
grub-install /dev/sda1, or sdb1 (in your case sda5)
add the designated number of the partition

since fdisk show this
Code:
I went to the shell type: fdisk -l

/dev/sda1 -> HPFS/NTFS
/dev/sda2 -> Extended
/dev/sda3 -> HPFS/NTFS
/dev/sda5 -> Linux
/dev/sda6 -> Linux swap / Solaris
__________________
:dance:Fedora 15 (Lovelock), Fedora 14 (Leonidas), Fedora 13, Fedora 12, (Constantine), Fedora 11 (Leonidas), Fedora 10, Fedora 9 (Sulfur), Fedora 8 (Werewolf), Fedora 7
Asus EEE 900 Netbook
Asus P4 Desktop

Last edited by dubb; 17th June 2008 at 06:00 AM.
Reply With Quote
  #8  
Old 17th June 2008, 09:41 AM
ivancat Offline
Registered User
 
Join Date: Dec 2007
Posts: 596
yeah, it should be hd0, not sd0, my bad
__________________
Ivan Cat (registered linux user #471784)
Linux Projects: constat | nconv
Fedora-related: Message In the Bottle
Reply With Quote
  #9  
Old 17th June 2008, 03:23 PM
hyperspace Offline
Registered User
 
Join Date: Oct 2006
Location: Lincoln, NE
Age: 56
Posts: 414
His list shows sdax. If he tried to use sdb5, you'd get an error. So maybe sda5 will work. sdb should be a second disk, right?

I'm confused.
__________________
lost in hypertime...

Registered Linux User #329061
Reply With Quote
  #10  
Old 17th June 2008, 06:59 PM
dubb Offline
Registered User
 
Join Date: Aug 2007
Location: Escondido, CA
Age: 34
Posts: 334
on my desktop I have 3 hard drives
1 sata 2 ide
my array is sort of like this
sda1 (first boot device)
sdb1 (third boot device)
sdc1(second boot device)

the boot record is located on sda1 and my extended parition is on sdc. sdb contains windows. bios boot priority is set to boot sda, sdc, sdb. in that particular order.

depending on what fdisk tells me I figured that the boot record is found in sda1

now I have information about the partition and proceed with

chroot /mnt/sysimage
then
grub-install /dev/sda1

got it working with F9
__________________
:dance:Fedora 15 (Lovelock), Fedora 14 (Leonidas), Fedora 13, Fedora 12, (Constantine), Fedora 11 (Leonidas), Fedora 10, Fedora 9 (Sulfur), Fedora 8 (Werewolf), Fedora 7
Asus EEE 900 Netbook
Asus P4 Desktop
Reply With Quote
  #11  
Old 17th June 2008, 10:02 PM
Keithj Offline
Registered User
 
Join Date: Jun 2008
Location: Thundersley, Essex and Kirby Cane, Norfolk
Posts: 20
I've been trying to re-create the MBR on the hard drive that Fedora 9 zapped for me. Fortunately, I can boot from floppy and use configfile (hd0,0/grub/menu.lst to start the various distros on the machine, but that's a bit of a kludge as a long-term fix.

I tried chroot /mnt/sysimage and then grub-install '(hd0)' but get a message that grub-install doesn't recognise hd0 (or indeed any other hd on the PC). I tried all those combinations above, with the same result.

I wondered if the MBR has disappeared altogether with the "Fedora install wipe", so I Googled hard (obviously using the wrong words) to find a way to create a MBR on a new hard drive using Linux. I couldn't find one. I could probably do it with a Windows CD, or even an old Windows 3.1 boot floppy if I had one.

Is there a way to create an MBR on a new (or newly reformatted) hard drive, using Linux?
Reply With Quote
  #12  
Old 17th June 2008, 10:49 PM
Keithj Offline
Registered User
 
Join Date: Jun 2008
Location: Thundersley, Essex and Kirby Cane, Norfolk
Posts: 20
I have the solution to the problem I had! Thanks to a very helpful person on another forum...

Start grub (the boot floppy in my case)

Assuming the drive to use is hd0,
at the grub> prompt, type
root (hd0,0)
then
setup (hd0)

Various messages and prompts will tell you it's working, and ...job done!
Reply With Quote
Reply

Tags
grub, linux, partition, reinstall, rescue

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot grub-install from rescue mode mlreta Using Fedora 0 6th April 2007 12:15 AM
System Recovery/Restoration & Rescue CD workaround for grub-install Firewing1 Guides & Solutions (No Questions) 0 14th March 2006 04:07 AM
How to install grub to mbr from a rescue disk? skipper3k Installation, Upgrades and Live Media 1 23rd April 2005 01:21 AM
grub-install through "linux rescue" dazed Using Fedora 3 13th December 2004 10:10 PM


Current GMT-time: 19:54 (Friday, 19-09-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat