LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 08-31-2004, 07:24 PM   #1
andymadigan
Member
 
Registered: Aug 2004
Location: Rochester, NY
Distribution: Debian Sid
Posts: 59

Rep: Reputation: 15
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.
 
Old 08-31-2004, 07:27 PM   #2
sh1ft
Member
 
Registered: Feb 2004
Location: Ottawa, Ontario, Can
Distribution: Slackware, ubuntu
Posts: 391

Rep: Reputation: 32
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.

Last edited by sh1ft; 08-31-2004 at 07:28 PM.
 
Old 08-31-2004, 07:33 PM   #3
andymadigan
Member
 
Registered: Aug 2004
Location: Rochester, NY
Distribution: Debian Sid
Posts: 59

Original Poster
Rep: Reputation: 15
Unhappy 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?
 
Old 08-31-2004, 08:27 PM   #4
andymadigan
Member
 
Registered: Aug 2004
Location: Rochester, NY
Distribution: Debian Sid
Posts: 59

Original Poster
Rep: Reputation: 15
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.
 
Old 08-31-2004, 08:42 PM   #5
andymadigan
Member
 
Registered: Aug 2004
Location: Rochester, NY
Distribution: Debian Sid
Posts: 59

Original Poster
Rep: Reputation: 15
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?
 
Old 08-31-2004, 09:34 PM   #6
sh1ft
Member
 
Registered: Feb 2004
Location: Ottawa, Ontario, Can
Distribution: Slackware, ubuntu
Posts: 391

Rep: Reputation: 32
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.
 
Old 08-31-2004, 09:39 PM   #7
andymadigan
Member
 
Registered: Aug 2004
Location: Rochester, NY
Distribution: Debian Sid
Posts: 59

Original Poster
Rep: Reputation: 15
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).
 
Old 09-01-2004, 10:09 PM   #8
andymadigan
Member
 
Registered: Aug 2004
Location: Rochester, NY
Distribution: Debian Sid
Posts: 59

Original Poster
Rep: Reputation: 15
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:///)?
 
  


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
Accidentally Deleted my Linux Partition...Need Help ASAP robbs Linux - Newbie 3 07-10-2005 07:26 PM
Accidentally deleted files rwalkerphl Linux - Newbie 3 06-24-2004 06:11 PM
accidentally deleted /boot partition, yet it boots timsch75 Linux - General 6 04-08-2004 02:51 PM
Accidentally deleted /etc/init.d .. what do i do? :| waste Linux - General 5 03-04-2004 03:39 AM
accidentally deleted /etc/profile tanbetien Fedora 2 11-21-2003 09:42 PM

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

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