LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 09-05-2007, 03:38 AM   #1
viperflyer
LQ Newbie
 
Registered: Sep 2007
Posts: 1

Rep: Reputation: 0
Lost Windows partition after using install-grub command


Please help. I was hoping to move GRUB from a hard-drive that is dieing a slow death to a good drive which already has Windows XP installed on it. I used command "sudo grub-install /dev/hda1" hoping to install GRUB on this good drive. However, in the process I have lost the drive altogether. I tried uninstalling GRUB by booting from Windows XP CD but I don't see that partition at all to log in and use FIXMBR. Is there any other alternative to recover this drive or have I lost all the data?

Thanks in advance.

Following is the outcome of "sudo fdisk -l"

Disk /dev/hda: 60.0 GB, 60022480896 bytes
255 heads, 63 sectors/track, 7297 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 7297 58613121 7 HPFS/NTFS

Disk /dev/hdd: 61.4 GB, 61492838400 bytes
255 heads, 63 sectors/track, 7476 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdd1 1 2557 20539071 83 Linux
/dev/hdd2 * 2558 7476 39511867+ 7 HPFS/NTFS
 
Old 09-05-2007, 05:11 AM   #2
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 56
Thiese are your Windows XP partitions;

/dev/hda1 * 1 7297 58613121 7 HPFS/NTFS (most likely you Windows C: drive)

/dev/hdd2 * 2558 7476 39511867+ 7 HPFS/NTFS (most likely your Windows D: or E: drive)

One can check the Windows partitions from Linux after installing fuse and ntfs-3g

You may be able to correct your mistake by booting into Linux and doing:

grub-install --recheck /dev/hda1

Also google on Bart PE
 
Old 09-05-2007, 05:18 AM   #3
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
By giving hda1 to grub-install you specified it should install itself to the beginning of the hda1 partition. If you want to install it to MBR, you don't give the partition number, just the disk (hda for example, which is the same as (hd0)) on which you want GRUB be put on (to the MBR).

Installing GRUB should't destroy any personal data even if you did install it onto a partition and not MBR. It takes up 512 bytes from the beginning of the disk or partition, where a bootloader and partition table is usually stored in. Regular partitions start only after that, so your "problem" is just that the Windows bootloader is confused (probably because GRUB is where it wants to see something else); fixing it shouldn't be that bad, and anyway recovering your data for backing up for example is a matter of mounting the Windows partitions. Many modern distributions have ntfs read support out of the box (you need ntfs-3g only if you wish to write to the partitions also), so you can just mount the Windows partition(s) as you would mount any other partitions, specifying the filesystem type as ntfs (or auto).
 
Old 09-05-2007, 05:30 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,425

Rep: Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055Reputation: 1055
Quote:
Originally Posted by viperflyer View Post
I used command "sudo grub-install /dev/hda1"
Bad, *very* bad.
This over-writes the NTFS partition, not the MBR.
Quote:
I tried uninstalling GRUB by booting from Windows XP CD but I don't see that partition at all to log in and use FIXMBR. Is there any other alternative to recover this drive or have I lost all the data?
Try fixboot first, followed by fixmbr.
If you're lucky you'll be back in business.

Your data is still there, you just need to be able to get at it. See how you go with the above.

Edit: D'oh, slow typer ...

Last edited by syg00; 09-05-2007 at 05:32 AM.
 
  


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
I accidentally install the grub on the Windows partition, Can I reconstruct??? nadavvin Linux - General 10 10-25-2006 08:30 PM
Fresh install of SUSE, windows partition is mounted but no GRUB entry irunfast1000 Linux - General 1 10-12-2006 04:49 PM
Lost access to windows partition, due to typo in command anubis26 Linux - General 24 08-10-2006 08:51 PM
lost grub AND swap partition Frelov Linux - Newbie 3 03-10-2005 12:06 AM
GRUB booting into it's command prompt .. after choosing Windows on last install~ Mustard010 Linux - General 7 12-01-2004 09:28 PM


All times are GMT -5. The time now is 04:16 AM.

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