LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 03-01-2006, 09:31 PM   #1
whencat
Member
 
Registered: Aug 2003
Location: Pondicherry,India
Distribution: Fedora Core 3, RedHat 9.0, SUSE 8.1 Personal,
Posts: 49

Rep: Reputation: 15
Red face Need to (re)install GRUB: fedora c4 rescue cd (and GRUB) unable to see the harddisk


Scenario:
Pre-problem:
1) Happy system with Windows xp SP2 and Fedora Core 4.
2) Both on a single harddisk - xp on the sole primary partition and FC4 on extended (/boot,/,/home,swap) and other NTFS partitions.
3) Harddisk had an empty 10 GB partition in the extended just after the swap.
4) Partitioned the empty partition into 2 using the Disk management in Adin ools->Compter management in XP.
5) partition table changed = GRUB lost = problem begins.

Problem:

1)booted into the Fedora rescue cd -> chrooted into /mnt/sysimage -> grub-install --recheck /dev/hda
2)/dev/hda:no such device or not a block device.
3)fdisk -l -> cannot open /proc/partition
4)parted -> no device found (smthing like that) -> Retry/Cancel?
5)df -> shows only / and /dev/proc
6)the /dev partition has only one file called "null"
7)I am ABLE to access all my partitions ie. /boot,/,/home but why does the programs (fdisk,parted,grub) unable to see the harddisk.

i even tried taking the image of the /boot partition:
dd if=/dev/hda6 of=linbootsec.img bs=512 count =1
complains -> input file /dev/hda6 cannot be found.

Please suggest ways to restore GRUB.

Any help is greatly appreciated.

Misc info:
p4 system with asus p4p800vm i865 chipset(ICH 5).
 
Old 03-02-2006, 01:05 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Boot from a live distro and look at the partitions.
 
Old 03-02-2006, 07:27 PM   #3
Dommy
Member
 
Registered: Jul 2004
Location: Canberra
Distribution: Mint 7
Posts: 204

Rep: Reputation: 30
I had this happen with a different distro found I had to use lilo to setup the MBR that allowed me to boot into linux and then I could reinstall grub quite strange
 
Old 03-03-2006, 03:00 AM   #4
whencat
Member
 
Registered: Aug 2003
Location: Pondicherry,India
Distribution: Fedora Core 3, RedHat 9.0, SUSE 8.1 Personal,
Posts: 49

Original Poster
Rep: Reputation: 15
Hello all,
Finally got the problem solved. Although its not quite clear as to what solved it, i did the following after frustrating search and thought:
1)the partition table was obviously altered and hence /etc/fstab had invalid entries reflecting the old structure. =>Removed unwanted entries and tried to make the file a minimal one.

2)By trial and error guessed what could be the root partition number .....found it to be /dev/hda6 and not /dev/hda5 as it was earlier.By keeping this as a reference changed other partition device name entries and rebooted.

3)Bingo! fdisk -l at last gave an output. But i don't understand this. does fdisk read the fstab file for any querying?.....so brushing aside such doubts I issued
Code:
grub-install --recheck /dev/hda
this gave a different error this time stating the file
Code:
/boot/grub/stage1 not read correctly
4)Then I had to painstakingly study the
Code:
info grub
pages and learnt how to install it natively. I think it was easy at the end and I did learn a lot.Thank God I had this problem or else I would'nt have learnt so much.

5)But no, the problems were not yet over. The native install method just gave me a grub prompt from where I could enter commands everytime I wanted to boot. This was ok with me but thinking of my father I badly wanted the menu interface....and then further research(?!!) gave me the perfect answer
Code:
root (hd0,5)
Code:
install /grub/stage1 (hd0) /grub/stage p /grub/menu.lst
Code:
quit
Hope this thing helps someone with a near-similiar problem.
 
Old 03-05-2006, 02:01 PM   #5
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Thanks for: a) posting your answer, b) posting this answer.

Very useful to my understanding of the finer/deeper points of GRUB.


BTW,
sfdisk can back up & restore partition tables.

gpart is supposed to fix trashed partition tables. I say "supposed to" because it is complicated & I haven't used it yet.
 
  


Reply



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
Restoring GRUB using a rescue cd aus9 Linux - Software 7 05-13-2013 01:31 AM
grub won't load fedora 4, rescue disk says partition is unformatted! bean.art Linux - Software 29 12-01-2005 06:33 AM
reinstalling grub in rescue mode ELconkestador Linux - Newbie 5 02-13-2005 03:43 AM
reinstalling grub on rescue mode mabus92920 Linux - Newbie 3 01-15-2005 05:04 AM
grub reinstall from rescue CD shashikanth Linux - Software 12 08-22-2004 04:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

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