LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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
 
LinkBack Search this Thread
Old 12-28-2005, 05:07 AM   #1
suger
LQ Newbie
 
Registered: Dec 2005
Location: Coconino County
Distribution: OpenBSD, Ubuntu
Posts: 16

Rep: Reputation: 0
Recovering a deleted partition table while partitions still mounted


While playing with ipodlinux, I accidentally deleted the partition table of my /home disk (/dev/sda, while / is on /dev/sdb and the ipod was /dev/sdc, I did a dd if=something of=/dev/sda instead of of=/dev/sdc, kind of stupid, no ?).

/dev/sda was still mounted (/dev/sda5 as home, /dev/sda6 as /media/sda6), while the partition table of /dev/sda was replaced with that of the ipod . I made an emergency backup of all the files on /dev/sda5 and /dev/sda6 (on the hard disk of the ipod ) and rewrote a new partition table on /dev/sda, but here is my question, out of curiosity and in prevision of my next mistake :

given that all the partitions on the disk were still mounted, was there anyway to get the correct partition table out of some place (the kernel ?) ?

I'm not asking here for gpart or testdisk (both of which failed to restore the partition table, by the way), but of a way to squeeze the partition table out of the kernel.

Thanks in advance for your help
 
Old 12-28-2005, 11:14 AM   #2
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,614

Rep: Reputation: 164Reputation: 164
/proc/partitions has useful info. With a calculator, you can recover your table.
 
Old 12-29-2005, 03:38 AM   #3
suger
LQ Newbie
 
Registered: Dec 2005
Location: Coconino County
Distribution: OpenBSD, Ubuntu
Posts: 16

Original Poster
Rep: Reputation: 0
Thanks man.
 
Old 12-30-2005, 11:59 PM   #4
terrytree
LQ Newbie
 
Registered: Dec 2005
Posts: 1

Rep: Reputation: 0
Hi,

Lost or deleted partition can be saved using Partition Table Doctor Recovery tool.
It can easily restore lost partition, as it did for me before.
Really great tool, with awesome restore algorithms. Give it a try. Recommended!
 
Old 12-31-2005, 12:11 AM   #5
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 3,988

Rep: Reputation: 261Reputation: 261Reputation: 261
If you overwrote the first sector of /dev/sda, you'll also have overwritten your MBR. Restoring it should be as simple as rerunning lilo or grub-install. If you were using the Windows bootloader on the MBR, you can boot off of a rescue disk and fdisk /mbr or fixmbr should take care of it.
 
Old 01-02-2006, 01:31 AM   #6
suger
LQ Newbie
 
Registered: Dec 2005
Location: Coconino County
Distribution: OpenBSD, Ubuntu
Posts: 16

Original Poster
Rep: Reputation: 0
@terrytree : thanks; but partition recovering softwares all need unmounting. I wanted recovery without unmounting, for which the /proc/partitions way was the best.

@btmiller : you sure are right, except that in my case, grub is on /dev/sdb (I know, I'm a perv).
 
  


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 On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Recovering Deleted files brew1brew Mandriva 6 12-24-2005 01:21 PM
recovering deleted files saipraveen Linux - Newbie 1 06-16-2005 11:00 AM
recovering deleted files hamish Linux - Newbie 2 10-04-2004 05:51 PM
[B]PARTITION TABLE TOASTED - NEED help recovering data!!![/B] Daddio Linux - General 0 06-30-2004 08:05 PM
need help recovering partition table hank43 Linux - General 12 11-29-2003 11:04 PM


All times are GMT -5. The time now is 07:41 PM.

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