1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Recover deleted partition

Discussion in 'Other PC Software' started by Christer, 2005/12/05.

  1. 2005/12/05
    Christer

    Christer Geek Member Staff Thread Starter

    Joined:
    2002/12/17
    Messages:
    6,585
    Likes Received:
    74
    Hello all!

    I was at a friends last weekend and rebuilt his computer. Two new hard disks were to be used and everything to be reinstalled. When finished, the last step was to transfer his data from the old hard disk. I removed the backup hard disk from the mobile rack and in went the old one. When everything had been copied over, I asked "are you sure that nothing is hidden somewhere? ". "I'm sure" was the answer and I deleted the single partition on the old hard disk. Luckily, before I had a chance to create a new partition, he said "well, not really, I forgot, is it too late? ".

    I thought it was too late, unless some recovery software was purchased but I spent the best part of an hour on the Internet searching for freeware. Finally, I found TestDisk which comes in two flavours, DOS and Windows. I used the Windows based version and managed to recover the deleted partition.

    Just thought I'd let you know ......:cool: ...... but I have no idea what would have happened if I had created a new partition and formated!

    Christer
     
  2. 2005/12/06
    ghemant

    ghemant Inactive

    Joined:
    2005/10/01
    Messages:
    76
    Likes Received:
    0
    Hi,
    thanx for sharing information with us .

    :)
    Regards
     

  3. to hide this advert.

  4. 2005/12/06
    McTavish

    McTavish Inactive

    Joined:
    2005/06/24
    Messages:
    576
    Likes Received:
    1
    Handy to know about a freeware partition recovery tool Christer. When I get some time I’ll give it a go. Thanks for the info.
     
  5. 2005/12/06
    Christer

    Christer Geek Member Staff Thread Starter

    Joined:
    2002/12/17
    Messages:
    6,585
    Likes Received:
    74
    Guy's,
    you're welcome ...... :) ...... !

    I have downloaded many tools that I never used (never even installed) until this happened but none could save us. The web search and finding TestDisk was worthwhile because I'm sure that deleting a partition too soon will happen again.

    I will once again delete that partition, create a new one and delete it to see if TestDisk will find the previous partition. If it does, I will also format the new partition before deleting it ...... :p ...... there must be some limits to TestDisk's capabilities.

    Christer
     
  6. 2005/12/06
    Christer

    Christer Geek Member Staff Thread Starter

    Joined:
    2002/12/17
    Messages:
    6,585
    Likes Received:
    74
    First, I deleted the Primary partition, created an Extended partition with a Logical volume but did not format. I deleted the Logical volume and the Extended partition. I ran TestDisk and it successfully recreated the original Primary partition.

    Next, I deleted the Primary partition, created a new Primary partition but did not format. I deleted the Primary partition. I ran TestDisk, it searched the hard disk but did not find anything to recover.

    I don't understand why there is a difference in the two cases ...... :confused: ...... !

    When time permits, I'll do some further tests, like:

    What happens if the Extended/Logical is formated prior to being deleted? (I think I know the answer but I like to be empirical.)

    What happens if there are several partitions (one Primary and one Extended with Logicals) to recover?

    Christer
     
  7. 2005/12/07
    McTavish

    McTavish Inactive

    Joined:
    2005/06/24
    Messages:
    576
    Likes Received:
    1
    I don’t know all the details Christer, but I would assume that creating an extended partition would not write as much data to the drive as creating a primary would. An extended partition is simply a box to contain logicals and so it does not have a boot sector or require sectors set aside for the file table. All it requires is space for a partition table on the first sector of the partition. A primary partition on the other hand uses the first 16 sectors to define all the details of the partition.

    I don’t know if creating an extended uses only the first sector and just writes its partition table to it, leaving the other data in that sector in tact, which can then be used to recover the partition. Or if it puts its PT in the first sector but also has to reserve the other 15 sectors, so leaving other data that may be what is needed to recover the partition.

    Don’t know the answer to formatting the logical, but I would guess the primary would still be recoverable.

    Don’t think it matters how many primaries or logicals are on the drive. As long as a similar partition is not created at the same place as the original, then its boot sectors should not be overwritten. I always have 3 primaries and 16 logicals on all my hard drives (technical limitation of my boot manager) and many times I’ve recovered lost logicals.
     
  8. 2005/12/07
    Christer

    Christer Geek Member Staff Thread Starter

    Joined:
    2002/12/17
    Messages:
    6,585
    Likes Received:
    74
    Neither do I know all details but over at RADIFIED, in a different discussion about primary partitions and extended partitions (Partition Magic calling an extended partition a "Primary Extended" triggered the discussion), a guy explained that an extended actually is a primary. The difference being that an extended can be divided in logical volumes to split a hard disk in more than four partitions.

    If I remember correctly, the Master Boot Record and all Boot Records contain information on the actual partition to which it is connected, plus information on where the Boot Record (and MFT) for the next partition is located. Sort of sequential.

    I haven't fully understood it but I agree that there must be some kind of difference between a Primary and an Extended with a Logical ...... :confused: ...... that's the only conclusion I can draw from the results of my rudimentary tests.

    Christer
     
  9. 2005/12/07
    TopFarmer

    TopFarmer Well-Known Member

    Joined:
    2005/01/24
    Messages:
    252
    Likes Received:
    6
    difference between a Primary and a Logical partition , there is none. If you have a hdd editor program and look at the partition type in the extended volume's BR it will be the same as that of the Primary in the MBR. I have manualy changed extended partitions into pri.partitions editing only the partition entrie in the BRs.

    Each Boot Record takes up 1 track, normally 63 secotrs {uses only 1st sector}, each partition takes 1 track for the boot code and othe partition info. .

    testdisk will do a good job till one has multiple primary partitions . On my comp I have 5 pri.-1 logical-4 pri. partitions totol 10, do use an advanced boot manager to put up to 4 partitions into the MBR.
     
  10. 2005/12/08
    Christer

    Christer Geek Member Staff Thread Starter

    Joined:
    2002/12/17
    Messages:
    6,585
    Likes Received:
    74
    Hi TopFarmer,
    thanks for your input!

    I will play around with TestDisk a bit more but you have confirmed my suspicion that TestDisk has its limitations.

    Christer
     
  11. 2005/12/08
    McTavish

    McTavish Inactive

    Joined:
    2005/06/24
    Messages:
    576
    Likes Received:
    1
    The Master Partition Table in the MBR can have a max of 4 partitions and these are all called primary partitions. An extended partition is just a slightly different primary partition. My understanding Christer is that the difference is an extended is not designed to be bootable, so it does not need a bootsector or file table. What it does have however that bootable primaries don’t have is its own partition table, to define a logical partition that is inside it. That logical also has a partition table to define the next logical – and so on – sequential as you said.

    As TopFarmer said the first track of 63 sectors is always reserved in any primary and logical partition. The first sector contains the partition boot record and in extended and logicals also a partition table. Typically only the first 16 sectors are used for the other partition details and the file table. The last sector is often used for a backup of the bootsector on the first sector.

    What I don’t know is exactly what an extended partition writes to the first track. It has to write a partition table to the first sector where the partition boot code is contained, but usually the bootcode and partition table inhabit different locations in the first sector, so perhaps the boot code for the original primary remains in tact and this is what partition recovery tools use to rebuild the master partition table in the MBR. Or perhaps it uses the backup bootsector on the 63rd sector, which I’m sure would always remain in tact as an extended does not need a bootsector, so would not write a backup. Just as an aside the sectors are numbered from zero, so the 63rd sector is actually sector 62.
     
  12. 2005/12/08
    TopFarmer

    TopFarmer Well-Known Member

    Joined:
    2005/01/24
    Messages:
    252
    Likes Received:
    6
    {MBR can have a max of 4 partitions and these are all called primary partitions. } the 4 partitions is correct but not all are primary, it can have one [only one] extended partition definded. DOS fdisk will only make 1 of each.

    Some of the terminalogy nameing is not consistant on all web site one reads makeing the understanding difficault.

    Extended partition must contain logical partitions to be useable.

    All partition tables start at data offset {0B0E hex} in the first sector of hdd or first sector of extended partition(s) and each entrie is 16 dec. long. In the extended partition that is all there is , zero fills rest of sector.

    What is known as the Pri. and logical volumes partitions all look the same with the exception of their first sector. The first sector contains Disk Parameter Block[DPB] or Bios Parameter Block[BPB] (depending on site in use) giveing such info. as partition size, # of fat's, size of fat, sectors per cluster, type of format (?) ie:{ Fat , FAT32,NTFS} ect (NTFS has different info), and only if listed in the MBR contains a boot code.
    The next 2 sectors also has some info, with a back up of the first 3 sectors starting at sector 6 .

    So: 'useing standard MBR' simplified, LOL.
    MBR =1 sector contains boot code and partition table.
    extended BR table =1 sector contains partition table only,1 or 2 entries.
    pri. /logical partitions = 1st sector contains DPB/BPB , if pri. contain boot code .
    Each logical volume will have in the 1st track befor, the exteneded BR table "EBR ". --EBR/PRI/EBR/PRI/EBR/PRI if there is 3 volumes in extended partition.
    the first 2 EBR's will have 2 entries in partition tabel and the 3rd will only have one.

    I know that the subject is now clear as mud!
    some sites:
    http://www.ata-atapi.com/hiwmbr.htm
    http://www.pcguide.com/ref/hdd/file/structMBR-c.html
    http://thestarman.pcministry.com/asm/mbr/MBR_in_detail.htm
     
  13. 2005/12/08
    McTavish

    McTavish Inactive

    Joined:
    2005/06/24
    Messages:
    576
    Likes Received:
    1
    A lot of that is as I understand things and a lot is outside my knowledge. Wish I had the time to understand it all. You can have more than one extended partition if you use a partitioning tool without restrictions. You must have at least one primary, but the other three can be extended if you want. All the four possible partitions in the MPT are technically primary partitions. An extended partition is a primary, just with slightly different parameters.

    Not seen the site of your first your link before, I’ll digest it when I have time.
     
  14. 2005/12/08
    TopFarmer

    TopFarmer Well-Known Member

    Joined:
    2005/01/24
    Messages:
    252
    Likes Received:
    6
    "You must have at least one primary," only if you want it bootable, if the hdd is a slave no primarys are needed.

    "but the other three can be extended if you want." Yes but none of them will be seen by Windows. Just tried it, 98 will not see any and XP if on an extended had a error and rebooted. [my hdd as seen by MBR- unalloted space/extended with 1 volume 'storage'/unalloted/Primary 'Duel boot 98'/extended with 1 volume 'XP']

    You can have 20+ volumes within a extended partition.

    "All the four possible partitions in the MPT are technically primary partitions" not so, the extended partition as said some where before is like a box with Primary patitions within. The extened partition is more like that of the MBR with only a partition table.

    A picture of hdd partition structure would be much easyer to understand.
     
  15. 2005/12/09
    McTavish

    McTavish Inactive

    Joined:
    2005/06/24
    Messages:
    576
    Likes Received:
    1
    Hi TopFarmer
    I’ve tried to make a hard drive one entire Extended partition and been unable to do it because there would always be a small partition created before it that I could not get ride of. It was only tiny and listed as a primary partition in my partitioning tool. I’m wondering now if it is a quirk of my partitioning tool or if perhaps it was not actually a primary partition. I’ll have a play again at the weekend and try some other partitioning tools.

    I often read that it is not advisable to have more than one Extended partition on a hard drive and I should have said that having three is not a good idea. I only meant it is possible to do. Out of curiosity I have tried this myself, but I don’t remember if I put logicals on them and tried to use them to see if they were stable. Again I’ll have a play at the weekend but I’m sure you are correct that there are problems. I’ve seen other peoples machines where they have successfully used two extended in a configuration of Primary-Extended-Primary-Extended, but I rearrange things to only one extended. Personally I’d never have more than one. Most modern partitioning tools won’t let you create more than one.

    I agree with you that an extended is nothing like a primary and so calling it a primary seems incorrect. It’s not myself that is arguing this point, it’s the professionals I’ve taken my learning from. I’ve read many times over the years that all 4 possible partitions that can be created in the MPT are primary partitions, regardless of the parameters that the partition is given.
     
  16. 2005/12/14
    terrytree

    terrytree Banned

    Joined:
    2005/12/14
    Messages:
    2
    Likes Received:
    0

Share This Page

  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.