There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
UNIX/Linux
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Operating Systems > UNIX/Linux >
Solved: Is There a way to recover a partition that has had been deleted


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
neos1's Avatar
Computer Specs
Senior Member with 371 posts.
 
Join Date: Feb 2006
Location: upper middle
Experience: Between Beginner and Intermediate
07-Jul-2007, 12:30 AM #1
Solved: Is There a way to recover a partition that has had been deleted
not erased, just the flagged for deletion with a linux tool?
saikee's Avatar
Distinguished Member with 2,515 posts.
 
Join Date: Jun 2004
Location: Newcastle
Experience: A Linux user gone nuts on multi-boot
07-Jul-2007, 08:50 AM #2
Yes.

The reason behind is quite simple.

When you delete a partition you remove only its partition table which has 16 bytes inside. The physical partition is not touched but the indexing system to find it is gone.

As long as you have a copy of the partition table or can create the partition back again and the whole of the original partition is yours again in seconds.

I have rebuilt partitions many times and lost only one or two, mostly because I stopped an installer too late when it was merrily formatting the hard disk. Mind you I keep a record of the partition tables. Those one I do not keep are identically 5Gb or 10Gb each and so even a fool can claim and rebuild 63 partitions in a hard disk.

If you create another partition, using the same or part of the area and start to write information on it then you can kiss some if not all the data good bye.
__________________
A newbie entered Linux wonderland in Jun 2004, now a converted Linux user - No. 361921
Using a Linux live CD to clone XP
To install Linux and keep Windows MBR untouched
Adding extra Linux & Doing it in a lazy way
A Grub menu booting 100+ systems & & A "Howto" to install and boot 145 systems
Just booting tips A collection of booting tips
Judge told Linux "You are charged of murdering Windoze by stabbing its heart with a weapon, what was it? Linux replied "A Live CD"

Last edited by saikee : 07-Jul-2007 08:55 AM.
lotuseclat79's Avatar
Distinguished Member with 10,010 posts.
 
Join Date: Sep 2003
Location: -71.45091, 42.27841
07-Jul-2007, 09:13 AM #3
Hi neos,

Here are some examples of how to save a copy of your partition table and MBR:

To copy entire MBR to a file:
# dd if=/dev/sdb of=/root/sdbmbr bs=512 count=1

To restore entire MBR from a file:
# dd if=/root/sdbmbr of=/dev/sdb bs=512 count=1

To restore partition table,skipping boot loader code:
# dd if=/root/sdbmbr of=/dev/sdb bs=1 skip=446 count=66

Note: If you have a Linux Live CD, you should be able to pop it into your CD drive, bring up Linux, and execute those commands to restore the partition table provided you used the first command to save your MBR (or a variant to save only the partition table).

-- Tom

P.S. Note: /dev/sdb is a device specific name in the above examples and is most likely different on your system unless you have 2 SATA drives like I do.
__________________
The independence created by philosophical insight is - in my opinion - the mark of distinction between a mere artisan or specialist and a real seeker after truth. - Einstein wrote in 1944.

Some say knowledge is power, I say knowledge without action is powerless. - lotuseclat79

Don't confuse action with movement. - Hemingway to Gardner

Imagination is more important than knowledge. - Einstein

Last edited by lotuseclat79 : 07-Jul-2007 12:36 PM.
neos1's Avatar
Computer Specs
Senior Member with 371 posts.
 
Join Date: Feb 2006
Location: upper middle
Experience: Between Beginner and Intermediate
07-Jul-2007, 11:24 AM #4
Ok here is what I have done:

Downloaded TestDisk and analysed the hdd.


Quote:
Disk /dev/sdc - 80 GB / 74 Gib - CHS 9729 255 63
Partition Start End Size in sectors
* FAT32 LBA 0 1 1 3139 254 63 50444037 [SEA_DISC]FAT found
L HPFS - NTFS 3140 1 1 5251 254 63 33929217
L FAT32 LBA 5252 1 1 9728 254 63 71922943 [V]


Structure: Ok. Use Up/Down Arrow keys to select partition.
Use Left/Right Arrow keys to CHANGE partition characteristics:
*=Primary bootable P=Primary L=Logical E=Extended D=Deleted
Keys A: add partition, L: load backup, T: change type, P: list files,
Enter: to continue
Saikee: I do not know what your definition is of a fool; but applying my definition I cannot not deny sometimes.

Here is a quote from TextDisk creator Christophe Grenier " TestDisk has features for both novices and experts. For those who know little or nothing about data recovery techniques, TestDisk can be used to collect detailed information about a non-booting drive which can then be sent to a tech for further analysis. Those more familiar with such procedures should find TestDisk a handy tool in performing onsite recovery."

I realized after I downloaded TestDisk that this tool is in many if not all Live CD's.
Anyway, because this disk that I deleted the partition table IS
my backup I cannot, I will not make another move until you or Tom walks me through it.

Edit: what I have copied from my Terminal window is accept for spacing it out for easier viewing is exact.
Edit:: I'm in XP
__________________
"I know that most men, including those at ease with problems of the greatest complexity, can seldom accept even the simplest and most obvious truth, if it be such as would oblige them to admit the falsity of conclusions which they have delighted in explaining to colleagues, which they have proudly taught to others, and which they have woven thread by thread, into the fabric of their lives". Leo Tolstoy

Last edited by neos1 : 07-Jul-2007 11:37 AM.
saikee's Avatar
Distinguished Member with 2,515 posts.
 
Join Date: Jun 2004
Location: Newcastle
Experience: A Linux user gone nuts on multi-boot
07-Jul-2007, 12:12 PM #5
First thing first I would advise making a clone right now so that you can put away the original and work on the cloned copy.

Just get hold of a spare hard disk bigger than the current one and even temporarily fixed it internally or just hook up a USB hard disk. The content of the spare disk will be overwritten in the cloning process.

The procedure is here

Please, by booting up any Live CD, post here the output of the terminal command
Code:
fdisk -l
__________________
A newbie entered Linux wonderland in Jun 2004, now a converted Linux user - No. 361921
Using a Linux live CD to clone XP
To install Linux and keep Windows MBR untouched
Adding extra Linux & Doing it in a lazy way
A Grub menu booting 100+ systems & & A "Howto" to install and boot 145 systems
Just booting tips A collection of booting tips
Judge told Linux "You are charged of murdering Windoze by stabbing its heart with a weapon, what was it? Linux replied "A Live CD"
neos1's Avatar
Computer Specs
Senior Member with 371 posts.
 
Join Date: Feb 2006
Location: upper middle
Experience: Between Beginner and Intermediate
07-Jul-2007, 08:08 PM #6
I'm in the process of getting a hold of another hard drive. Small town USA, and I will have to make a trip. (Refuse to pay Radio Shack prices).

I have a honeydo project that I've got to get finished. I'll try and get the info to you tonight.
__________________
"I know that most men, including those at ease with problems of the greatest complexity, can seldom accept even the simplest and most obvious truth, if it be such as would oblige them to admit the falsity of conclusions which they have delighted in explaining to colleagues, which they have proudly taught to others, and which they have woven thread by thread, into the fabric of their lives". Leo Tolstoy
neos1's Avatar
Computer Specs
Senior Member with 371 posts.
 
Join Date: Feb 2006
Location: upper middle
Experience: Between Beginner and Intermediate
07-Jul-2007, 09:18 PM #7
Quote:
Originally Posted by saikee
First thing first I would advise making a clone right now so that you can put away the original and work on the cloned copy.

Just get hold of a spare hard disk bigger than the current one and even temporarily fixed it internally or just hook up a USB hard disk. The content of the spare disk will be overwritten in the cloning process.

The procedure is here

Please, by booting up any Live CD, post here the output of the terminal command
Code:
fdisk -l
The image is 1. something mb, well over the limit and I do not know how to cut it down.

---------------------------------------------------------------------------------------------------------------------------------
Disk /dev/sdc: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
ubuntu@ubuntu:~$ and then a rectangle standing up-long ways up
__________________
"I know that most men, including those at ease with problems of the greatest complexity, can seldom accept even the simplest and most obvious truth, if it be such as would oblige them to admit the falsity of conclusions which they have delighted in explaining to colleagues, which they have proudly taught to others, and which they have woven thread by thread, into the fabric of their lives". Leo Tolstoy
neos1's Avatar
Computer Specs
Senior Member with 371 posts.
 
Join Date: Feb 2006
Location: upper middle
Experience: Between Beginner and Intermediate
08-Jul-2007, 12:58 AM #8
Here is the Knoppix screen shot.

Let's try this again.
neos1's Avatar
Computer Specs
Senior Member with 371 posts.
 
Join Date: Feb 2006
Location: upper middle
Experience: Between Beginner and Intermediate
08-Jul-2007, 01:05 AM #9
Knoppix snapshot3file:///home/knoppix/Desktop/snapshot3.png



A side note: When I open Open Office Word Doc, I get Calc.
Attached Thumbnails
solved-there-way-recover-partition-snapshot3.png  

Last edited by neos1 : 08-Jul-2007 01:13 AM.
saikee's Avatar
Distinguished Member with 2,515 posts.
 
Join Date: Jun 2004
Location: Newcastle
Experience: A Linux user gone nuts on multi-boot
08-Jul-2007, 08:48 AM #10
neos1,

You need to tell us what partition you have deleted and what type?

You current partition table show one disk sda only. I don't see any problem there or as far as Linux is concerned the partition table isn't corrupted. Accessing the partition data is another matter but we could come to that later.

The only anomaly, if it can be classified as one, is at the end of partition sda7 there is an empty space of 8923-4449 = 4474 cylinders. The 8923 is the total No. of cylinder you have in the 80Gb disk and the 4449 is the end boundary of sda7. Thus there is about 40Gb empty space after sda7. You have no sda3 and sda4 because the extended partition sda2 tells us you have used up the remaining hard disk, apart from sda1, to make logical partitions. The sda2 end boundary matches the size of the total No of cylinders in the disk.

You have to tell us which is the partition you have deleted. Is it any of sda1, sda5, sda6 or sda7? or sda8 (or more) from the space currently blank?

You will note from your partition table each partition has an ID number; 7 for NTFS and b for fat32. Your memory of the type of partition you have deleted is important to recover it.

If you have deleted only one partition and know its partition ID that partition is yours after you supply the requested information in the next post.
__________________
A newbie entered Linux wonderland in Jun 2004, now a converted Linux user - No. 361921
Using a Linux live CD to clone XP
To install Linux and keep Windows MBR untouched
Adding extra Linux & Doing it in a lazy way
A Grub menu booting 100+ systems & & A "Howto" to install and boot 145 systems
Just booting tips A collection of booting tips
Judge told Linux "You are charged of murdering Windoze by stabbing its heart with a weapon, what was it? Linux replied "A Live CD"

Last edited by saikee : 08-Jul-2007 08:54 AM.
neos1's Avatar
Computer Specs
Senior Member with 371 posts.
 
Join Date: Feb 2006
Location: upper middle
Experience: Between Beginner and Intermediate
08-Jul-2007, 01:21 PM #11
sdc 80GB SeaDisk USB External, 3 partitions:
Attached Thumbnails
solved-there-way-recover-partition-textdisk_seadiskrecoveryanalysis.png  
saikee's Avatar
Distinguished Member with 2,515 posts.
 
Join Date: Jun 2004
Location: Newcastle
Experience: A Linux user gone nuts on multi-boot
08-Jul-2007, 01:39 PM #12
I am afraid I could not assist.

You claim to have deleted a partition and want it back. In Post #6 you showed me a partition table of sdb.

When I asked what partition and type have you deleted you show partition information of another disk sdc.

I don't know which partition on which disk you have deleted.

-------------------------------------------------------
If the information in Post #11 are the deleted partitions Testdisk discovered for you you can accept the findings. Only you know what were in them and the types.
__________________
A newbie entered Linux wonderland in Jun 2004, now a converted Linux user - No. 361921
Using a Linux live CD to clone XP
To install Linux and keep Windows MBR untouched
Adding extra Linux & Doing it in a lazy way
A Grub menu booting 100+ systems & & A "Howto" to install and boot 145 systems
Just booting tips A collection of booting tips
Judge told Linux "You are charged of murdering Windoze by stabbing its heart with a weapon, what was it? Linux replied "A Live CD"
neos1's Avatar
Computer Specs
Senior Member with 371 posts.
 
Join Date: Feb 2006
Location: upper middle
Experience: Between Beginner and Intermediate
08-Jul-2007, 05:05 PM #13
saikee
I thought in image one that I had gotten the right disk on there-I didn't. It is the SeaDisk sdc
there are three partitions the first one has files and folders the third one has files and folders
the middle one or the second partition on the 80GB seadisk has no files or folders.
I thought you stated that in the first image that I posted, you could not see any problems-no deleted partitions. Obviously I screwed up in posting that image. The attatchment in post # 11
is the correct hard drive. I should not be trying to juggle so many projects at one time.
I cannot justify one block of time to those who count on me.
I apologize for wasting your time.
__________________
"I know that most men, including those at ease with problems of the greatest complexity, can seldom accept even the simplest and most obvious truth, if it be such as would oblige them to admit the falsity of conclusions which they have delighted in explaining to colleagues, which they have proudly taught to others, and which they have woven thread by thread, into the fabric of their lives". Leo Tolstoy
saikee's Avatar
Distinguished Member with 2,515 posts.
 
Join Date: Jun 2004
Location: Newcastle
Experience: A Linux user gone nuts on multi-boot
08-Jul-2007, 05:22 PM #14
The testdisk has showed 3 partitions. Is your deleted partition among there? Can you not get an output of "fdisk -l /dev/sdc" on sdc?
neos1's Avatar
Computer Specs
Senior Member with 371 posts.
 
Join Date: Feb 2006
Location: upper middle
Experience: Between Beginner and Intermediate
08-Jul-2007, 05:44 PM #15
Loaded Knoppix again here is fdisk -l dev/sdc

EDIT: I see now why I uploaded the first image: I have two Sea disk 15k 73GB internal harddrives in a Dell Precision 450; the external drive is an 80GB Sea Disk. In the first image Knoppix has the 80GB hard drive listed as sda and the 73.4GB listed as sdc.

Why would Knoppix list my external harddrive as first in line? Windows list it at third in line.

Clarification: It is the 80GB external that the partition table has been deleted

EDIT: I am sure that the partitions were formatted to FAT 32. At least the two that have anything of any importance on them. I formatted them this way so as to be able to reach into them from either Linux or Windows.
Attached Thumbnails
solved-there-way-recover-partition-snapshot1.png  
__________________
"I know that most men, including those at ease with problems of the greatest complexity, can seldom accept even the simplest and most obvious truth, if it be such as would oblige them to admit the falsity of conclusions which they have delighted in explaining to colleagues, which they have proudly taught to others, and which they have woven thread by thread, into the fabric of their lives". Leo Tolstoy

Last edited by neos1 : 08-Jul-2007 06:03 PM.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 11:52 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.