LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-14-2006, 12:27 AM   #1
linuxgaga
LQ Newbie
 
Registered: Apr 2006
Distribution: slackware 10.2
Posts: 7

Rep: Reputation: 0
Question Hard disk not bootable after GRUB's wrong operations


I'm not sure about if it's a software question or hardware question. But finally it looks like "My Hard Disk Drive Doesn't Work" so I put the thread here.

A few days ago I had a Windows XP partition on the hard disk. Since I need to boot up other operating systems on other USB devices so I decided to install GRUB on the hard disk. I'm a newbie with GRUB and after tried several GRUB commands (I don't remember what did I do....sort of root(hd0) setup(hd0) etc.) the hard disk became unbootable. When I tried to reboot the machine it said "Disk error. Press any key to restart".

Well, I thought it might be the problem with MBR. So I insert my Windows XP installation CD, entered in to the console and did both "fixmbr" and "fixboot". Then reboot, I got the same error message.

I also tried to reinstall Windows XP on other partitions and the first step of installation was okay, files were copied to the hard disk. But it hung and gave the same error message again dring the first boot after copied all the setup files.

After a few hours I rememberd the 'FDISK /MBR' command. So I borrowed a Windows 98 CD from my friend. But this Windows 98 CD doesn't recorgnize my hard disk device! FDISK just quited immediatly. I knew that NTFS partition is not accessable in Win98/DOS but the FDISK should be able to detect my hard disk.

I dumped the first sector of /dev/hda and /dev/hda1, both of them are terminated with 0x55aa, should this be okay?

The partition table and filesystem are fine. Since the whole disk now is still perfectly operatable in Linux system. Just cannot boot, cannot be FDISKed with Win98 CD, cannot be reinstalled with WinXP CD and fixmbr/fixboot doesn't work.

Appreciate for helps.

Last edited by linuxgaga; 04-14-2006 at 12:33 AM.
 
Old 04-14-2006, 07:22 AM   #2
Sören Schneider
Member
 
Registered: Apr 2005
Location: Brazil
Distribution: SUSE 9.0 Pro, SUSE OSS 10.0, KDE 3.4.2
Posts: 156

Rep: Reputation: 30
May be a stupid answer (since there are no stupid Questions).
Did you check your BIOS BOOT OPTIONS?
Try deselect boot from CD and select boot from HDD
 
Old 04-14-2006, 07:36 AM   #3
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Have a look at the last link of my siganture, especially Task B section as it has all the commands to restore XP and Linux.

The Grub root + Setup command are used to install Grub. Grub counts from 0 and so (hd0,0) and (hd0,3) mean 1st and 4th partition of 1st disk. If the root "/" of your Linux is in 2nd partition of the first disk then
Code:
root (hd0,1)
setup (hd0)
instructs Grub to obtain its system files from (hd0,1), which is equivalent to hda2 or sda2 in Linux, and install itself in the MBR of the first disk as (hd0) without the partition reference means the whole disk.

Your are right in thinking fdisk /mbr works on both IDE and Sata disk and not dependednt on the operating system.

The first section of a hard disk is the MBR and it is also the first part of the boot sector of the first partition. Discarding it is OK as long as you know how to restore the boot loader of your choice.
 
Old 04-16-2006, 05:30 AM   #4
linuxgaga
LQ Newbie
 
Registered: Apr 2006
Distribution: slackware 10.2
Posts: 7

Original Poster
Rep: Reputation: 0
Thank you for the suggestions. Now I can use my computer again after buying a new hard disk...

1) Sören, I have checked the BIOS, it always boots from HDD unless the F12 is pressed, which lets you to select the boot device manually.

2) saikee, my HDD was mounted on the first IDE socket and was the master device. So I tried root (hd0,0) and setup (hd0). It didn't work. It seems some important sectors were destroied by the previous mis-operations of GRUB. But probably not the MBR. Since I think I 'can' or 'have' fixed it by running WinXP's fixmbr and fixboot. The issue was the device are not recognizable by the BIOS booting procedure. Maybe that's why the Win98 installation CD can't find physic disk on the system, and WinXP installation hangs again(showing 'disk error, press anykey...') after first boot.

Today I bought another SATA HDD and installed a new copy of WinXP on it. The new HDD is the 2nd device so the drive C: is still my old HDD. But this time WinXP installation CD repaired the mysterious booting stuff on C:, on my old HDD. Now the ntldr and boot.ini work again.

Don't know what really happened, but finally I've got a new 160G SATA HDD. Not too bad
 
Old 04-16-2006, 11:00 AM   #5
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
If you have XP in the first partition (hd0,0) then Grub will not work because its system files are not inside XP paartition. Grub is a Linux bootloader so the partition in root command must be a Linux partition.
 
  


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
GRUB's hard disk option unable to boot kernel 2.6.15 cvelasquez Linux - Software 2 03-10-2006 03:18 PM
60GB laptop hard disk & 200GB external USB hard disk linux compatibility powah Linux - Hardware 0 03-07-2006 10:55 AM
Linux Bootable Hard disk aattarwa SUSE / openSUSE 5 02-17-2006 10:00 PM
disk to disk backup for debian/Mempis on bootable cd-- advice loninappleton Linux - Software 3 05-27-2005 01:00 AM
What's wrong with my hard disk?: prad Linux - General 3 03-05-2003 10:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:34 AM.

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