Unable to recover partition Topic is solved

How to use TestDisk to recover lost partition
Message
Author
User avatar
Fiona
Posts: 2836
Joined: 18 Feb 2012, 17:19
Location: Ludwigsburg/Stuttgart - Germany

Re: Unable to recover partition

#21 Post by Fiona » 20 Jun 2014, 10:52

Might be an idea to use photorec first, to recover your photos.
Afterwards you can run fsck.
But if you have all files copied and recovered, you can create a new partition and format it.
It would fix your issue about the geometry.

Fiona

Sponsored links

anapodos
Posts: 17
Joined: 09 Jun 2014, 23:08

Re: Unable to recover partition

#22 Post by anapodos » 21 Jun 2014, 16:22

I finally managed to get all my data back.
I run fsck and it corrected too many errors. Couldn't mount the partition though. Also tried to restore the superblock but no luck there. So i ended up formatting the drive and repartitioned the disk. I now have a single ext4 filesystem partition.

But when i open testdisk it still recognises the drive with none partition. Why is happening this?
Also i mentioned that the new drive i bought to back up the data, the partition isn't recognised by testdisk. I have no problem with the other hard drives as they are recognized as intel partitions.

Will it affect if in future i will have to restore the partition? (Hope i will not!!)

User avatar
Fiona
Posts: 2836
Joined: 18 Feb 2012, 17:19
Location: Ludwigsburg/Stuttgart - Germany

Re: Unable to recover partition

#23 Post by Fiona » 21 Jun 2014, 16:43

Drive is only a partition.
Only a disk has a MBR and as a part of it a partition table.
In TestDisk, you should always select "Disk".
Otherwise if you still experience some problems, please let me know.
You should use testdisk 32bit.
Would it be possible that your new disk has 4k sectors and it's advanced formatted?
Is your new disk bigger than 2 TB?

Fiona

anapodos
Posts: 17
Joined: 09 Jun 2014, 23:08

Re: Unable to recover partition

#24 Post by anapodos » 21 Jun 2014, 16:55

I always choose disk in TestDisk and i run the 32bit version.
You have absolutely right as the disk supports advanced formatting. Also it's 4K sectors and i can confirm this from the output of fdisk -l

Code: Select all

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x23342335

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048  1953523711   976760832   83  Linux
kostas@kostas:~$ 
This is for the disk we were trying to recover. Maybe this is the reason it couldn't recognize it?

anapodos
Posts: 17
Joined: 09 Jun 2014, 23:08

Re: Unable to recover partition

#25 Post by anapodos » 21 Jun 2014, 23:26

Sorry i didn't noticed that so far i was using 64bit version.
I downloaded 32bit and the results are these:
32bit.png
32bit.png (63.59 KiB) Viewed 2634 times
32bit2.png
32bit2.png (62.91 KiB) Viewed 2634 times
32bit3.png
32bit3.png (74.57 KiB) Viewed 2634 times
Also here is the output of testdisk 32bit

Code: Select all


Sun Jun 22 01:12:54 2014
Command line: TestDisk

TestDisk 7.0-WIP, Data Recovery Utility, June 2014
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org
OS: Linux, kernel 3.13.0-30-generic (#54-Ubuntu SMP Mon Jun 9 22:45:01 UTC 2014) x86_64
Compiler: GCC 4.4
Compilation date: 2014-06-21T09:16:18
ext2fs lib: 1.42.8, ntfs lib: libntfs-3g, reiserfs lib: 0.3.1-rc8, ewf lib: 20120504
User is not root!
Hard disk list
Disk /dev/sda - 400 GB / 372 GiB - CHS 48641 255 63, sector size=512 - WDC WD4000AAKS-00TMA0, S/N:WD-WCAPW1513407, FW:12.01C01
Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63, sector size=512 - WDC WD10EZEX-00ZF5A0, S/N:WD-WMC1S2520330, FW:80.00A80

Partition table type (auto): None
Disk /dev/sdb - 1000 GB / 931 GiB - WDC WD10EZEX-00ZF5A0
Partition table type: Intel

Analyse Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63
Geometry from i386 MBR: head=255 sector=63
Current partition structure:
 1 P Linux                    0  32 33 121601  57 56 1953521664 [Downloads]
No partition is bootable

search_part()
Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63

recover_EXT2: s_block_group_nr=0/7452, s_mnt_count=1/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 244190638
recover_EXT2: part_size 1953525104
     Linux                    0   1  1 121601  80 62 1953525104
     ext4 blocksize=4096 Large file Sparse superblock, 1000 GB / 931 GiB
get_geometry_from_list_part_aux head=255 nbr=1
get_geometry_from_list_part_aux head=8 nbr=2
get_geometry_from_list_part_aux head=16 nbr=2
get_geometry_from_list_part_aux head=32 nbr=1
get_geometry_from_list_part_aux head=64 nbr=1
get_geometry_from_list_part_aux head=128 nbr=1
get_geometry_from_list_part_aux head=240 nbr=1
get_geometry_from_list_part_aux head=255 nbr=1
Warning: the current number of heads per cylinder is 255 but the correct value may be 16.

Results
   * Linux                    0   1  1 121601 254 63 1953536067
     ext4 blocksize=4096 Large file Sparse superblock, 1000 GB / 931 GiB


dir_partition inode=2
   * Linux                    0   1  1 121601 254 63 1953536067
     ext4 blocksize=4096 Large file Sparse superblock, 1000 GB / 931 GiB
ext2fs_dir_iterate failed with error 2133571402.
Directory /

interface_write()
 1 * Linux                    0   1  1 121601 254 63 1953536067
simulate write!

write_mbr_i386: starting...
write_all_log_i386: starting...
No extended partition

TestDisk exited normally.
Is there anything wrong or i can continue to use the disk?

User avatar
Fiona
Posts: 2836
Joined: 18 Feb 2012, 17:19
Location: Ludwigsburg/Stuttgart - Germany

Re: Unable to recover partition

#26 Post by Fiona » 22 Jun 2014, 06:57

Especially to advanced format, in my tests, even windows explorer was generating sometimes messages, like repair, sometimes testdisk found a partition and sometimes not.
Windows explorer also.
Advanced format is a different alignment and was especially used under winxp because of degraded performance.
Even 4k sectors are handled different.
They emulate 512bytes sectors, otherwise the disk might be not bootable.
Info about OS support:
http://support.microsoft.com/kb/2510009/en-us
Actually testdisk supports 4k sectors.
For me it looks like that advanced format still stucks somehow in the infancys?

Especially abou disk geometry.
Since vista, microsoft aligns partitions not on cylinder- but megabyte boundary.
TestDisk supports megabyte boundary but testdisk is generally based on PC/Intel-MBR.
If a partition is not PC/Intel-MBR standard, testdisk displays a message that geometry might be not correct.
Can be ignored.
Microsoft alignment on megabyte boundary is recognized if a partition starts after 1 MB at cylinder 0 and head 32 etc..
You can watch it on your photo and current partition strucure.
Some info about PC/Intel standard:
http://www.cgsecurity.org/wiki/Partitio ... nd_logical
In this case, everything is normal and there is no further action required

Fiona

anapodos
Posts: 17
Joined: 09 Jun 2014, 23:08

Re: Unable to recover partition

#27 Post by anapodos » 22 Jun 2014, 08:42

Ubuntu 14.04 also supports and proposes alignment to mib instead of cylinder.
Two of my disks are aligned now to mib. The one we were trying to recover and the new one i bought. Both western digital and on their site they prefer the advanced format and 4k sectors.

Thanks for the info. Very useful. Also i would like to thank you for all the help till now!! Maybe i didn't recovered the partition but i recovered all the data and this was the most important for me!

User avatar
Fiona
Posts: 2836
Joined: 18 Feb 2012, 17:19
Location: Ludwigsburg/Stuttgart - Germany

Re: Unable to recover partition

#28 Post by Fiona » 22 Jun 2014, 10:01

Your partition was not standard and used a reserved area on your disk, before a partition normally starts by a boot sector.
It was:
Cylinder 0 and the value head should be 1 but was 0.
That's why you weren't able to write your partition.
To avoid any further trouble, it was recommended to copy your data off to another healty disk/partition and create a new partition to fix your problem.

Fiona

anapodos
Posts: 17
Joined: 09 Jun 2014, 23:08

Re: Unable to recover partition

#29 Post by anapodos » 22 Jun 2014, 18:17

Yes i deleted the partition and created a new one.
This is what TestDisk shows. Is it right now?
32bit3.png
32bit3.png (74.57 KiB) Viewed 2607 times

User avatar
Fiona
Posts: 2836
Joined: 18 Feb 2012, 17:19
Location: Ludwigsburg/Stuttgart - Germany

Re: Unable to recover partition

#30 Post by Fiona » 22 Jun 2014, 20:05

Yes, your partition starts with the right values.

Fiona

Locked

Who is online

Users browsing this forum: No registered users and 2 guests