LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 01-21-2004, 11:16 AM   #1
yoonsangkyun
LQ Newbie
 
Registered: Jan 2004
Posts: 7

Rep: Reputation: 0
I lost my NTFS partition by reinstalling GRUB


Hello...

I have 1 hard disk with 3 partitions on it..
C: windows server 2003
D: personal data (windows)
E: RedHat Linux 9

I reinstalled windows so I had to reinstall grub too... but acidently I typed in grub-install /dev/hda5... I think hda5 was my D drive which has a lot of important personal data.. then I just reinstall grub using /dev/hda...

I did not notice any problem until this morning.. when I was trying to open D drive in windows 2003 this morning.. it said.. "not formatted.. "

I am panic... man.. I must have those data back..

I have tried gpart to get some information about D drive but.. it shows it as RAW drive...

and Partition Magic does not support windows server.. tried volume manager and Partition Expert... but they did not work..

I tried explore2fs also... But when I tried to see the drive in windows, it doesn't even recognize the drive... I have used Partition Expert, and I found that D drive's format status is RAW....

what I am thinking is that the beginning boot record that stores all the informations about the drive, is damaged or deleted... and since I do not have an access from windows or linux, I believe there is nothing overwritten on the drive, so there is a great possibility to restore it...

but the problem is... I have no idea what I should do...

PLEASE HELP ME~~~~~ thanks~~~
 
Old 01-21-2004, 12:00 PM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
Hi,
First, see if you can get the normal boot stuff repaired. If that works, we can proceed to look at that other drive situation.

Here are my notes....

1. Boot your machine from your boot media (cdrom1) and select linux rescue to install to the command prompt.

2. Redhat 8.0 displays a message “If you would like to make your system the root environment, run the command: chroot /mnt/sysimage”. Go ahead and do that.

3. At the prompt, type rdev and make a note of the output. For example, if it looks like this... " /dev/hda2 / " . This indicates that the Redhat root partition is on the first drive and second partition. You need that info for the next step.

4. Get into the grub configuration utility with the command: grub.

· At the prompt grub> type the command: root (hd0,1) ; this will tell grub that the linux files it needs are on the first hard disk (hd0) and the second partition (1) of that drive. Change this to meet your configuration needs. For instance, if the linux files are on the second hard disk (hd1), first partition (0) of that drive then type root (hd1,0).

· If you selected the correct location (where linux is installed), you should see a message as follows.... Filesystem type is Ext2fs, partition type is 0x83.

· Then issue the following command: setup (hd0) ; this will install grub in the MBR of your first hard disk. You could change that to use the /boot partition if desired.

· Exit the grub utility with the command: quit

You can also try to use grub-install /dev/hda to install grub on your first hard drive's MBR, but the method described above is the preferred one.
 
Old 01-21-2004, 12:34 PM   #3
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Also, if windows can't read the drive try enabling NTFS read support (not write) in linux and see if you can get the data off it that way. Linux is probably going to be far less picky about the condition the partition is in then Windows Server might be.
 
Old 01-22-2004, 11:20 AM   #4
jpierre
LQ Newbie
 
Registered: Jan 2004
Location: Caracas, Venezuela
Distribution: Debian
Posts: 1

Rep: Reputation: 0
Lightbulb Restoring partition boot record (PBR)

You're very aware of what happened: GRUB installed the code that should have gone to the MBR in the PBR so now you can't access the partiton's information.

What I think you can do is restoring the PBR from another NTFS partition.

Steps:

1. Make sure you have access to another NTFS partition of the same kind (Primary/Logical) and the same OS version (XP/2000/NT).

2. Find a system boot CD, like Knoppix, so you can have a completely working system booting from CD.

3. Start the computer with the good partition we will borrow the PBR from with the Knoppix boot CD.

4. Put the PBR into a file with this command:
Code:
# dd if=/dev/hdaX of=/root/backup.pbr bs=512 count=1
Where /dev/hdaX is the partition.

5. Put the file /root/backup.pbr in a floppy.

6. Start your computer with Knoppix or your already installed Linux system if it's still bootable.

7. Copy the file backup.pbr from the floppy to /root/backup.pbr.

8. Put the recovered PBR into your partition:
Code:
# dd if=/root/backup.pbr of=/dev/hdaX bs=512 count=1
Where /dev/hdaX is your damaged partition.

9. Reboot.

10. Enjoy having all your data again.

11. Answer to this list if you were successful or not.
 
Old 01-22-2004, 02:25 PM   #5
yoonsangkyun
LQ Newbie
 
Registered: Jan 2004
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks guys~~

I have been working on this problem for a couple of days... I have used several restoring applications in windows and linux... finally I found something that works great...

It is called Restore2000 Professional for windows... I just ran it and it showed me everything that was in the drive.. I restored what I need to C: and formatted D: and moved them back..

And actually thanks a lot for the information that you gave above.. Even though I solved it differently, it is a very useful and great information to know... I will keep it in my computer for the future reference..

Thanks again~~~
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Lost NTFS partition? Jongi SUSE / openSUSE 12 07-04-2005 09:21 AM
HELP PLEASE!!! Lost NTFS Partition frijj2k Linux - General 9 05-27-2005 10:44 AM
Reinstalling GRUB on a copied partition Exasperated Linux - General 3 02-05-2005 05:02 PM
I lost my NTFS partition by mistake using GRUB yoonsangkyun Linux - Newbie 6 06-03-2004 07:53 PM
Lost XP HPFS/NTFS partition ajkhan Linux - General 3 09-19-2003 07:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:27 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