1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Is There a way to recover a partition that has had been deleted

Discussion in 'Linux and Unix' started by neos1, Jul 7, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. neos1

    neos1 Thread Starter

    Joined:
    Feb 13, 2006
    Messages:
    238
    not erased, just the flagged for deletion with a linux tool?
     
  2. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,888
    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.
     
  3. lotuseclat79

    lotuseclat79

    Joined:
    Sep 12, 2003
    Messages:
    20,583
    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.
     
  4. neos1

    neos1 Thread Starter

    Joined:
    Feb 13, 2006
    Messages:
    238
    Ok here is what I have done:

    Downloaded TestDisk and analysed the hdd.


    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
     
  5. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,888
    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
     
  6. neos1

    neos1 Thread Starter

    Joined:
    Feb 13, 2006
    Messages:
    238
    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.
     
  7. neos1

    neos1 Thread Starter

    Joined:
    Feb 13, 2006
    Messages:
    238
    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
    [email protected]:~$ and then a rectangle standing up-long ways up
     
  8. neos1

    neos1 Thread Starter

    Joined:
    Feb 13, 2006
    Messages:
    238
    Here is the Knoppix screen shot.

    Let's try this again.
     
  9. neos1

    neos1 Thread Starter

    Joined:
    Feb 13, 2006
    Messages:
    238
    Knoppix snapshot3file:///home/knoppix/Desktop/snapshot3.png



    A side note: When I open Open Office Word Doc, I get Calc.
     

    Attached Files:

  10. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,888
    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.
     
  11. neos1

    neos1 Thread Starter

    Joined:
    Feb 13, 2006
    Messages:
    238
    sdc 80GB SeaDisk USB External, 3 partitions:
     

    Attached Files:

  12. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,888
    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.
     
  13. neos1

    neos1 Thread Starter

    Joined:
    Feb 13, 2006
    Messages:
    238
    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.
     
  14. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,888
    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?
     
  15. neos1

    neos1 Thread Starter

    Joined:
    Feb 13, 2006
    Messages:
    238
    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 Files:

  16. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Solved recover partition
  1. AzharAxe
    Replies:
    3
    Views:
    472
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/592714

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice