ubuntu dual boot illustrated site ubuntu dual boot windows 7 maverick meerkat

TestDisk Page

Edited Sunday, August 16 2009 Document made with KompoZer

This web-page is part of a larger website giving examples of how to install Windows+Ubuntu Linux operating systems 'dual boot' in a computer.  Illustrated Dual Boot HomePage.

This website is not an officially approved TestDisk website, it's just a representation of a home user's experiences with this great program, please refer to the official TestDisk site for the official documentation, it is very well documented there now.

Recommended External Links:
Ubuntu Rescue Remix 
Ubuntu Rescue Remix is a GNU/Linux live system which runs from CD or USB flash device. It provides the data recovery specialist with a command-line interface environment equipped with the best free-libre, open source data recovery and forensics tools available.
There is also a special Ubuntu Rescue Remix Web Forum where you may ask for expert help with your problems.
DataRecovery - Ubuntu Community Docs
Please read the Ubuntu Documentation page on data recovery before you do anything.
TestDisk - CG Security the official homepage for TestDisk,  TestDisk has its own excellent illustrated documentation.

PhotoRec - CG Security the official homepage for PhotoRec, TestDisk's companion application, so you can read the official documentation.

An Introduction to Data Recovery, by Daniel B. Sedory (better know as The Starman).  recommended reading, it contains a lot of very good information.

How to recover lost files after you accidentally wipe your hard drive by Shawn Hermans  -  Recommended if you're going to use PhotoRec

Recovering Windows files with a Ubuntu CD III: deleted files - Ubuntucat 
by aysiu -  also recommended if you need to use PhotoRec

Disk Recovery, a Ubuntu Web Forums thread, particularly see brennydoogles' prorganize.sh script  -  for use with PhotoRec


Once again, please refer to the above linked external websites before taking any actions based on information from the examples shown on this site.

  • Above all, take your time and proceed calmly,  do a lot of reading first
  • 'Lost' data  can remain on a hard disk for years, there is no need to hurry
  • If you start feeling too nervous or excited, go away and do something else for a while and come back later
The main intention of this web page is to try to illustrate how TestDisk works in an example operation to try to help those without experience to see what they can expect to be asked by TestDisk and what will happen next. Below here are examples of what it's like to run TestDisk to recover lost partitions. TestDisk can do much more than just what is illustrated here.

Page Index
Recovering an accidentally deleted NTFS partition on a second hard disk with TestDisk in Ubuntu installed in the first hard disk (simple)

Recovering a Lost Partition With TestDisk - searching deeper (advanced)

There are some important things to understand if you need to use TestDisk for restoring a lost partition or for reconstructing a damaged partition table.
TestDisk can be used to scan your hard disk for sectors that resemble the beginning sectors of file systems.
Those sectors may remain on the hard disk for virtually forever or until they get 'zeroed out' or overwritten with new data.
When the information about the starting locations and the lengths of the file systems is found, TestDisk  will show you that information and you can choose which partitions you want written to a new partition table
(in the MBR of the hard disk).  That information is often enough to restore the complete file system and all the data it contains.
If you have a hard disk that has not been repartitioned a great number of times, using TestDisk should be fairly simple, as shown in the first example in this page.


If you are running TestDisk on a hard disk that has had of repartitioning work done on it, then TestDisk might find file systems that might not be compatable to restore together.
They may overlap other partitions or they might not all fit in the partition table. The partition table contains four slots of sixteen bytes each, so there can only be four primary partitions per hard disk. One of those slots can contain an 'extended' partition instead, which refers to a string of 'logical' partitions, but these 'logical' partitions need to be strung together in a series. (A primary partition can't be placed in between logical partitions or it will 'break the chain').
The second example in this page shows how ot use TestDisk to 'search deeper', and is more advanced. You'll see right at the bottom of this page (in the last illustration) where there is a range of possible partitions presented for possible restoration to the partition table and the user needs to be able to decide which ones are required or compatible (possible).
The partitions to be included in the new partition table must be marked with an ' * ' or an 'L' or a 'P', or they won't be included in the new partition table.

Partition numbering may be possibly changed, that can be a good thing in some circumstances, and if you become skilled with TestDisk you may be able to use that to your advantage.
Having changed partition numbers for a data partition probably won't matter.
Having  changed partition numbers for an operating system partition might mean a little extra work for some people because that may affect booting.  
If you're using Ubuntu Linux you may need to edit /boot/grub/menu.lst to update it with new partition numbers, and possibly /etc/fstab if your file systems have been changed too. Editing /etc/fstab.
You may find Super Grub Disk useful for helping you boot for the first time so you can edit those files easily.
If you change the partition number for a Windows XP operating system, you will probably need to edit boot.ini to make Windows XP bootable again.
If you can't boot Windows XP you might go to
How to fix: NTLDR is missing, press any key to restart and look there for a boot CD file you can burn to disk and use for booting your Windows XP, there are floppy of USB files you can download there too.












Recovering an accidentally deleted NTFS partition
on a second hard disk with TestDisk in Ubuntu installed in the first hard disk.


It is a good idea to run 'sudo fdisk -l' in a terminal before starting TestDisk, to see the size of your partitions in blocks.
Print it out if you can , or copy it somehow.  TestDisk will give you lists of your partitions using block numbers for start points for start and end points for partitions to be rescued.
If you know what your disks and partitions look like in blocks and cylinders you will be better prepared to make decisions when TestDisk is running.
sudo fdisk -l
herman@amdxz:~$ sudo fdisk -l
Password:

Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        9145    73457181    b  W95 FAT32
/dev/hda2            9146       19106    80011732+  83  Linux
/dev/hda3           19107       19457     2819407+   5  Extended
/dev/hda5           19107       19457     2819376   82  Linux swap / Solaris

Disk /dev/hdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/hdc: 20.8 GB, 20847697920 bytes
255 heads, 63 sectors/track, 2534 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdc1   *           1        2427    19494846   83  Linux
/dev/hdc2            2428        2534      859477+   5  Extended
/dev/hdc5            2428        2534      859446   82  Linux swap / Solaris

In this example there are no partitions in /dev/hdb, which is the second hard drive in this machine because it had one big NTFS partition filling the entire disk that has been 'accidentally' deleted.
That's what we are going to try to recover shortly.


herman@amdxz:~$ sudo testdisk
Password:
If TestDisk is installed in your Ubuntu operating system you can give the command 'sudo testdisk' to start TestDisk.
It is important to use 'sudo' to run TestDisk because you need to be root to run TestDisk, you won't get far otherwise.

TestDisk and many other useful recovery programs come standard in Ubuntu Rescue Remix.
When Ubuntu Rescue Remix is installed in a hard drive or an external USB hard disk drive, it's easier to use PhotoRec. That way PhotoRec can just dump all the recovered files in the /home/ubuntu folder and you can sort them out with Linux commands or a script later. It's best if the hard disk or USB external hard disk you install Ubuntu Rescue Remix in is larger than the hard disk you need to recover files from. (At least I think so, but maybe with more practice my skills with Photorec will improve and I'll learn better ways of doing things).

If you are using a standard Ubuntu Live CD or hard disk installed OS, or USB, and TestDisk has not yet been installed, you can install it in Ubuntu through apt-get or synaptic package manager.
You can also run TestDisk from a Live CD that already has TestDisk in it. GParted -- LiveCD is one such CD, and so is System Rescue CD and also Knoppix, packages-dvd.txt

TestDisk 6.5, Data Recovery Utility, October 2006
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

  TestDisk is a data recovery designed to help recover lost partitions
and/or make non-booting disks bootable again when these symptoms
are caused by faulty software, certian types of viruses or human error.
It can also be used to repair some filesystem errors

Information gathered during TestDisk use can be recorded for later
review. If you choose to create a text file, testdisk.log  , it
will contain TestDisk options, technical information and various
outputs, including any folders/file names TestDisk was used to find and
list on screen.

Use Arrow keys to select, then press Enter key:
 
[ Create ]   Create a new log file
 [ Append ]   Append information to the log file
 [ No Log ]   Don't record anything













A testdisk log will be created in your /home/username directory. This can be handy to refer to later on, it is wise to make one, and I don't see how it could do any harm.



TestDisk 6.5, Data Recovery Utility, October 2006
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

  TestDisk as free software, and
comes with ABSOLUTELY NO WARRANTY.

Select a media (use Arrow keys, then press Enter):
Disk /dev/hda - 160 GB / 149 GiB  
Disk /dev/hdb - 160 GB / 149 GiB
Disk /dev/hdc -  20 MB /  19 GiB  









[Proceed]       [  Quit   ]

Note: Disk capacity must be correctly detected for a successful recovery.
If a disk listed above has incorrect size, check HD jumper settings, BIOS
detection, and install the latest OS patches and disk drivers.











TestDisk 6.5, Data Recovery Utility, October 2006
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org



Disk /dev/hdb - 160 GB / 149 GiB

Please select the partition table type, press Enter when done.
[ Intel ]  Intel/PC partition
[Mac    ]   Apple partition map
[None   ]   Non partitioned media
[Sun    ]   Sun Solaris partition
[XBox   ]   XBox partition
[Return ]  Return to disk selection






Note: Do NOT select  'None' for media with only a single partition. It's very
rare for a drive to be 'Non-partitioned'.













TestDisk 6.5, Data Recovery Utility, October 2006
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/hdb - 160 GB / 149 GiB - CHS 19457 255 63

[ Analyse ]  Analyse current  partition structure and search for lost partitions
[Advanced ]   Filesystem Utils
[Geometry ]   Change disk geometry
[Options  ]   Modify options
[MBR Code ]   Write TestDisk MBR code to the first sector
[Delete   ]   Delete all data in the partition table
[Quit     ]   Return to disk selection





Note: Correct disk geometry is required for a successful recovery. 'Analyse'
process may give some warnings if it thinks the logical geometry is mismatched.















TestDisk 6.5, Data Recovery Utility, October 2006
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org




Disk /dev/hdb - 160 GB / 149 GiB - CHS 19457 255 63
Current partition structure:
    Partition                    Start        End             Size in sectors
No partition is bootable




 






*=Primary bootable  P=Primary  L=Logical  E=Extended  D=Deleted
[Proceed  ]   
                           Try to locate partition                         









TestDisk 6.5, Data Recovery Utility, October 2006
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org


Disk /dev/hdb - 160 GB / 149 GiB - CHS 19457 255 63
Current partition structure:
    Partition                    Start              End         Size in sectors
* HPFS - NTFS                  0   1   1     19456  254  63        312576642 













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
NTFS, 160 GB /149 GiB








TestDisk 6.5, Data Recovery Utility, October 2006
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/hdb - 160 GB / 149 GiB - CHS 19457 255 63
Current partition structure:
    Partition                    Start           End        Size in sectors
1 * HPFS - NTFS               0   1   1   19456  254   63    312576642
















[  Quit   ]     [ Search!  ]   [  Write  ]  
                             Write partition structure to disk











TestDisk 6.5, Data Recovery Utility, October 2006
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Write partition table, confirm ? (Y/N)


























I typed a 'y' in this square to confirm.


TestDisk 6.5, Data Recovery Utility, October 2006
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

You will have to reboot for the change to take effect.


















[Ok]








Okay, that's it, my NTFS partition should be written to the partition table again now.



TestDisk 6.5, Data Recovery Utility, October 2006
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/hdb - 160 GB / 149 GiB - CHS 19457 255 63

[ Analyse ]  Analyse current  partition structure and search for lost partitions
[Advanced ]   Filesystem Utils
[Geometry ]   Change disk geometry
[Options  ]   Modify options
[MBR Code ]   Write TestDisk MBR code to the first sector
[Delete   ]   Delete all data in the partition table
[Quit     ]  Return to disk selection





Note: Correct disk geometry is required for a successful recovery. 'Analyse'
process may give some warnings if it thinks the logical geometry is mismatched.













TestDisk 6.5, Data Recovery Utility, October 2006
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

  TestDisk as free software, and
comes with ABSOLUTELY NO WARRANTY.

Select a media (use Arrow keys, then press Enter):
Disk /dev/hda - 160 GB / 149 GiB  
Disk /dev/hdb - 160 GB / 149 GiB
Disk /dev/hdc -  20 MB /  19 GiB  









[Proceed]       [  Quit   ]

Note: Disk capacity must be correctly detected for a successful recovery.
If a disk listed above has incorrect size, check HD jumper settings, BIOS
detection, and install the latest OS patches and disk drivers.












herman@amdxz:~$ sudo testdisk
Password:
TestDisk 6.5, Data Recovery Utility, October 2006
Christopher GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org
TestDisk exited normally.
You have to reboot for the change to take effect.


...and after rebooting the missing NTFS data partition was automatically mounted and the partition and all the files it contianed within had been fully restored and in perfect condition.























Recovering a Lost Partition With TestDisk -searching deeper


I use GParted LiveCD for just about everything.
There is no icon on your rescue disk desktop for TestDisk, you just have to know TestDisk is one of the programs.
The hard disk you want to work on should be unmounted, so unless you have more than one disk in your computer, it is probably easier to run TestDisk from a Live CD. 


gparted ~ # testdisk



To start TestDisk, the testdisk command is entered into a terminal.
If you are using Ubuntu you need to type 'sudo testdisk' instead, and then you will be prompted for your password.


TestDisk 6.6, Data Recovery Utility, February 2007
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

  TestDisk is a data recovery designed to help recover lost partitions
and/or make non-booting disks bootable again when these symptoms
are caused by faulty software, certian types of viruses or human errors.

Information gathered during TestDisk use can be recorded for later
review. If you choose to create a text file, testdisk.log  , it
will contain TestDisk options, technical information and various
outputs, including any folders/file names TestDisk was used to find and
list on screen.

Use Arrow keys to select, then press Enter key:
 
[ Create ]   Create a new log file
 [ Append ]   Append information to the log file
 [ No Log ]   Don't record anything













This is the first TestDisk menu I saw. I chose to let it create a log file. TestDisk will work anyway even if you don't want a log file. I don't think it really matters, but a log file might be nice.






TestDisk 6.6, Data Recovery Utility, February 2007
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

  TestDisk as free software, and
comes with ABSOLUTELY NO WARRANTY.

Select a media (use Arrow keys, then press Enter):
Disk /dev/hda - 60 GB / 55 GiB
Disk /dev/hdc - 139 MB / 132 MiB  (RO)









[Proceed]       [  Quit   ]

Note: Disk capacity must be correctly detected for a successful recovery.
If a disk listed above has incorrect size, check HD jumper settings, BIOS
detection, and install the latest OS patches and disk drivers.








This is the disk selection menu. When you have more than one hard disk you can chose which disk you want to work on. It is a good idea to try TestDisk out on a hard drive with nothing important on it for practice before running TestDisk on a real disk with possibly valuable information.
The disk capacity looks correct to me, that looks like the hard disk I want to work on.
I decided to proceed.






TestDisk 6.6, Data Recovery Utility, February 2007
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org



Disk /dev/hda - 60 GB / 55 GiB

Please select the partition table type, press Enter when done.
[ Intel ]  Intel/PC partition
[Mac    ]   Apple partition map
[None   ]   Non partitioned media
[Sun    ]   Sun Solaris partition
[XBox   ]   XBox partition
[Return ]  Return to disk selection






Note: Do NOT select  'None' for media with only a single partition. It's very
rare for a drive to be 'Non-partitioned'.










I have an Intel/PC type of Master Boot Record.





Main Menu
TestDisk 6.6, Data Recovery Utility, February 2007
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/hda - 60 GB / 55 GiB - CHS 7295 255 63

[ Analyse ]  Analyse current  partition structure and search for lost partitions
[Advanced ]   Filesystem Utils
[Geometry ]   Change disk geometry
[Options  ]   Modify options
[MBR Code ]   Write TestDisk MBR code to the first sector
[Delete   ]   Delete all data in the partition table
[Quit     ]   Return to disk selection





Note: Correct disk geometry is required for a successful recovery. 'Analyse'
process may give some warnings if it thinks the logical geometry is mismatched.












I  selected the first option 'Analyse', because I want to analyse my current partition structure and search for lost partitions.

Here is a list of these options and the subsequent options each one offers, we won't be covering all these in this how-to, only the 'Analyse' option.
But here's a quick look all the stuff TestDisk can do if we wanted,

                             Analyse = Analyse current partition structure and search for lost partitions
                                              --> Proceed
                                              --> Backup = Save current partition list to backup.log file and proceed
                                                                   --> Proceed --> Quit = Return to Main Menu
                                                                                       --> Search = Search Deeper, try to find more partitions
                                                                                       --> Write = Write partition table to disk
  Advanced Filesystem Utils = FAT: Boot and FAT repair
                                                     NTFS: Boot and MFT repair
                                                     EXT2/EXT3: Find Backup SuperBlock
 Geometry = Change disk geometry
                                                    --> Cylinders = Change cylinder geometry
                                                    --> Heads = Change head geometry
                                                    --> Sectors = Change sector geometry
                                                    --> Sector Size = Change sector size (WARNING: VERY DANGEROUS!)
                                                    --> Ok = Done with changing geometry
   
 Options = Modify options
--> Expert mode: Yes/No      -Expert mode adds some functionalities
--> cylinder boundary: Yes/No/Head boundary only   Partitions are aligned on cylinder head boundaries
--> Allow partial last cylinder Yes/No
--> Dump = Yes/No    Dump essential sectors
--> Ok =
Done with changing options

MBR Code = Write TestDisk MBR code to the first sector (similar to fdisk, includes aa55 sig too)
--> Write a new copy of MBR code to first sector? (Y/N)
     
Delete = Delete all data in the partition table

Quit = Return to disk selection







TestDisk 6.6, Data Recovery Utility, February 2007
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org




Disk /dev/hda - 60 GB / 55 GiB - CHS 7295 255 63
Current partition structure:
    Partition                    Start        End             Size in sectors

check_FAT: Unusual number or reserved sectors 9 (FAT), should be 1.
 1 P FAT16                      0   1   1    22  254  63          369432 [NO NAME]
 2 * Linux                     23   0   1  1552  254  63        24579450 [ACER]
 






*=Primary bootable  P=Primary  L=Logical  E=Extended  D=Deleted
[Proceed  ]   [  Save  ]
                           Try to locate partition                         





This panel is showing me my current partition information.

My first partition begins in cylinder 0, head 1, sector 1  
                         and ends at cylinder 22 ,  head 254 , sector 63

My second partition begins in cylinder 23, head 0, sector 1  
                             and ends at cylinder 1552 ,  head 254 , sector 63

...and now we are going to have TestDisk examine my hard disk for lost partitions. With 'Proceed' selected by default, I press 'Enter'.



TestDisk 6.6, Data Recovery Utility, February 2007
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org


Disk /dev/hda - 60 GB / 55 GiB - CHS 7295 255 63
Current partition structure:
    Partition                    Start        End         Size in sectors
* FAT16                     0   1   1     22  254  63          369432  [PQSERVICE] 
P FAT32 LBA                23   0   1   1552  254  63        24579450  [ACER]
L Linux Swap             1561   1   1   1691  254  63         2104452
P Linux                  1692   0   1   7294  254  63        90012195 









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
FAT16, 189 MB /180 MiB




There are two possibly lost partitions here TestDisk has found already, just from a very quick scan. These two can be easily restored. Are any of these the ones I am looking for?

When I use my up or down arrow keys I can highlight a different line. That makes the output line at the very bottom show more information about whichever partition is selected.

If these partitions look like the ones I want to recover, I can skip to the last image in this how-to.....GO

But NOOO, ...in this example I have decided that neither of these partitions that TestDisk has automatically found for me that are easy to restore are the one I'm looking for.
I want to search deeper, for even less distinct lost partitions that may have been deleted ages ago, so I press 'Enter'.

TestDisk 6.6, Data Recovery Utility, February 2007
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/hda - 60 GB / 55 GiB - CHS 7295 255 63
Current partition structure:
    Partition                    Start        End             Size in sectors
1 * FAT16                      0   1   1    22  254  63          369432  [NO NAME]
2 P FAT32 LBA                 23   0   1  1552  254  63        24579450  [ACER]
3 E extended LBA            1553   0   1  1691  254  63         2233035
4 P Linux                   1692   0   1  7294  254  63        90012195
5 L Linux Swap              1561   1   1  1691  254  63         2104452


[Quit   ]   [  Search! ]  [  Write  ]
                     Search deeper, try to find more partitions









Quit = Return to main menu

Search = Search deeper, try to find more partitions

Write = Write partition table to disk


TestDisk 6.6, Data Recovery Utility, February 2007
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/hda - 60 GB / 55 GiB - CHS 7295 255 63
Analyse cylinder     852/7295: 12%


check_FAT: Unusual number or reserved sectors 9 (FAT), should be 1.
  FAT16 >32M                   0   1   1
   22  254  63          369432  [NO NAME]
 
FAT32 LBA                 23   0   1  1552  254  63        24579450  [ACER]
 
FAT32 LBA                 23   0   1  1552  254  63        24579450  [ACER]
  Linux Swap              1561   1   1  1691  254  63         2104452
 
Linux                   1692   0   1  7294  254  63        90012195
  FAT32 LBA               2279   0   1  3808  254  63        24579450  [ACER]
  FAT32 LBA               2279   0   1  3808  254  63        24579450  [ACER]
  FAT32 LBA               3809   0   1  5338  254  63        24579450  [ACER]
  FAT32 LBA               3809   0   1  5338  254  63        24579450  [ACER]

    


[  Stop ]  







This is what it looks like during the search, be patient and wait while  it searches.....
The numbers on the line titled 'Analyse Cylinder' are changing to show the progress and the number of % increases as well in this display.
More lines are added to the list of partitions found, but when it's finished it doesn't stay on this display, it automatically
changes to the completed list shown in the next window below,
TestDisk 6.6, Data Recovery Utility, February 2007
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org


Disk /dev/hda - 60 GB / 55 GiB - CHS 7295 255 63
    Partition                    Start        End         Size in sectors
* FAT16 >32M                0   1   1     22  254  63          369432  [NO NAME] 
P FAT32 LBA                23   0   1   1552  254  63        24579450  [ACER]
L Linux Swap             1561   1   1   1691  254  63         2104452
P Linux                  1692   0   1   7294  254  63        90012195 
D Linux                  1692   0   1   7294  254  63        90012195
D FAT32 LBA              2279   0   1   3808  254  63        24579450  [ACER]
D FAT32 LBA              3809   0   1   5338  254  63        24579450  [ACER]
FAT16 LBA              7273   0   1   7294  254  63          369596  [ACER_SERVIC]







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
FAT16, 189 MB /180 MiB




The present healthy, easily restorable partitions are shown in green.

The ones shown in white are the ones I might look at for possible restoring. Now if I want to rescue one of these partitions I can have TestDisk write one or two of them to the partition table for me BUT  first I must make sure I read the cylinder, heads and sector information. If I make a mistake and try to select a partition that is in an area of the hard disk that's now occupied, TestDisk will let me know about it with some comments in bright red print.
If you look at the number of cylinders for the whole disk, it is 7295, and that third green partition begins at 1692 and covers the whole remainder of the disk right up to cylinder 7294. Those white partitions are covered up by the fourth green partition. It will be only possible to recover any of the white partitions if I delete that green one first.

In some situations we also might need to remember the partitioning rules for Intel/PC hard disks. We can have up to four primary partitions or up to three primary partitions with one designated as 'extended'. The extended partition can contian many logical partitions, but they must be 'contiguous'. (no primary partition can be placed between two logical partitions).

Use your up and down arrow keys to scroll down the list.
Use the left and right arrow keys to change the 'D' to either an '*' or a 'P' or an 'E' or 'L' (for logical).
Use the letter keys A, L, T and P as the sign says.

P is a good idea, that gives you a new Window that shows you what files are in a partition. You can tell if it's an operating system if you're used to looking at operating systems that way. You can tell if it's your data partition too, because you'd recognize the names of your old directories. Type q to quit and return to this menu.

Back in this menu again, if this is a partition I want TestDisk to restore, I use my left-arrow or right-arrow key to change the first letter of the line from 'D' to either a * if I want it to be a primary partition with a boot flag or a P for an ordinary Primary, E for extended, and L for a logical partition.

You need to select all the partitions you'd like to have included in your new partition table if you are going to choose [write] in the next screen.
If you only pick out the lost one you will rescue that one okay, but you'll lose the other partitions. Don't worry, you can repeat this process and recover them again. But it's better to save time and get it right the first time.

When the partitions you want to keep as well as the ones to restore all have a *, P or an L in the beginning of their lines, you can press 'Enter' to continue. There will be a confirmation screen, just type Y, and your partition table will be re-written with the partitions you selected here.