LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Accidentally deleted debian partition PLZ HELP (https://www.linuxquestions.org/questions/debian-26/accidentally-deleted-debian-partition-plz-help-225014/)

andymadigan 08-31-2004 07:24 PM

Accidentally deleted debian partition PLZ HELP
 
Sorry for the caps, but I was installing windows (need cygwin + vpn) and managed to disconnect the wrong hd before setup, I accidentally deleted the debian partition, but nothing was writtten to it. Is it possible to recover the partition? I'm going to google it, but I must restart first, to complete XP setup. Note that I do have a CD burner and will be able to burn ISOs shortly if there's a bootable linux that can do this. (e.g. Knoppix, though I'm not sure that it has the right software). Here's the system info: Debian Sid, ext3 file system, only one other partition on the drive, swap (at the end of the disk), Linux kernel 2.4.25, grub bootloader.

sh1ft 08-31-2004 07:27 PM

How exactly did you delete it? I think your pretty much out of luck for an entire partition, especially on a linux file system, barring use of some sort of professional forensics tool.
:(

andymadigan 08-31-2004 07:33 PM

deleted from partition table
 
I deleted it from the partition table (to be precise winxp setup deleted it) no formatting was done, no file writing was done, it's just been removed from the file system. Shouldn't the ext3 journal still be intact?

andymadigan 08-31-2004 08:27 PM

it's there!
 
I used TestDisk to look for the partition and it found it! I don't think it can restore the disk, though, there must be a way to do this!
Does anyone know how? Is there a utility that can "undelete" an entry from the partition table? I still have space on my backup drive, if I need to install another debian to restore my main one I will.

andymadigan 08-31-2004 08:42 PM

Need GRUB
 
Turns out TestDisk -can- restore ext3 partitions. I am now using an ext3 driver for winxp to view the contents of the partition from windows. The bootloader was overwritten, it was GRUB before, how do I restore it? I think I need to do something like this from a bootable linux cd.

chroot /dev/hda1

after that, what's the command to restore the MBR for GRUB?

sh1ft 08-31-2004 09:34 PM

Good to here you've solved it. I don't use grub, but I think the command is grub-install /dev/hda (?)

All you have to do is boot to a bootable linux cd you don't need to chroot because the mbr is independant of partitions, as long as you select you proper HD.

andymadigan 08-31-2004 09:39 PM

thanks
 
I'll try that tomorrow (taking a while to get Gnoppix, which will have the grub executable on it). Is there a way to make grub recognize WinXP? In debian setup it recognized my old Windoze (which managed to destroy itself shortly thereafter), can I rerun that to detect the new windoze? (BTW the old one was win98, so I don't think the current config will work).

andymadigan 09-01-2004 10:09 PM

fixed
 
I am posting this from Debian, the system is working, the command I used to fix it was
Code:

grub-install --root-directory=/mnt/hda1 /dev/hda
this was after (of course) I mounted /dev/hda1.
Thanks for the tip. Now I need a bit more help, is there a way I can get grub to recognize XP (on /dev/hdb5 with MBR @ /dev/hdb). Also, how can I rebuild the list of drives in the "Computer" icon in gnome (uri = computer:///)?


All times are GMT -5. The time now is 12:50 PM.