Lost Partition while installing 2nd HDD

How to use TestDisk to recover lost partition
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
kaalia
Posts: 5
Joined: 15 Jul 2015, 14:27

Lost Partition while installing 2nd HDD

#1 Post by kaalia »

Dear All,...:)

I used a DLINK DNS-323 NAS with single 1TB HDD. I treid to install 2nd 1TB HDD. The system asked me to put them to RAID configuartion.
My answer was yes....and I lost everyting:) without any formatting i think my partition table was deleted.
I run TestDisk and got the following information after analyzing:
SCREEN1 screenshot attached.
screen1.jpg
screen1.jpg (100.07 KiB) Viewed 2315 times
how can I restore my partiotion?
thx,
Akos

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

Re: Lost Partition while installing 2nd HDD

#2 Post by Fiona »

Your current partition partition structure displays some partitions.
It means that you have a partition table, but probably modified?
The end of your first Linux partition and the start of your second partition using the same cylinder.
It's cylinder 130.
Did you run Quick and Deeper Search to have a try to find your previus partitions?
Did you have a try to list your files on your found partitions?
Do you have any idea what kind of RAID do you currently use?
TestDisk allows you to copy files, if they're listed.
Can you run a diagnose and copy and paste the content of your testdisk.log into your next post?
Would be helpful to find the best solution.

Fiona

kaalia
Posts: 5
Joined: 15 Jul 2015, 14:27

Re: Lost Partition while installing 2nd HDD

#3 Post by kaalia »

Dear Fiona,

1st of all, thx for your help!

pls find the outcome the deep search as a secreenshot:
screen3.jpg
screen3.jpg (111.41 KiB) Viewed 2297 times
here is the logs as well:

Thu Jul 16 09:30:57 2015
Command line: TestDisk

TestDisk 7.0, Data Recovery Utility, April 2015
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org
OS: Windows 7 (7601) SP1
Compiler: GCC 4.8, Cygwin 1007.34
Compilation date: 2015-04-18T13:01:55
ext2fs lib: 1.42.8, ntfs lib: 10:0:0, reiserfs lib: 0.3.1-rc8, ewf lib: 20120504, curses lib: ncurses 5.9
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(/dev/sda)=256060514304
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(/dev/sdb)=1000204886016
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\PhysicalDrive0)=256060514304
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\PhysicalDrive1)=1000204886016
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\C:)=230756974592
disk_get_size_win32 IOCTL_DISK_GET_LENGTH_INFO(\\.\Q:)=16212033536
Hard disk list
Disk /dev/sda - 256 GB / 238 GiB - CHS 31130 255 63, sector size=512
Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63, sector size=512
Drive C: - 230 GB / 214 GiB - CHS 28054 255 63, sector size=512
Drive Q: - 16 GB / 15 GiB - CHS 1971 255 63, sector size=512

Partition table type (auto): Intel
Disk /dev/sdb - 1000 GB / 931 GiB
Partition table type: Intel

Analyse Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63
Geometry from i386 MBR: head=255 sector=63
get_geometry_from_list_part_aux head=255 nbr=6
get_geometry_from_list_part_aux head=8 nbr=1
get_geometry_from_list_part_aux head=16 nbr=1
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=6
Current partition structure:
1 P Linux Swap 0 1 1 65 254 63 1060227
2 P Linux 66 0 1 130 254 63 1044225

Bad sector count.
3 * Linux 130 0 1 121403 254 63 1948266810
Space conflict between the following two partitions
2 P Linux 66 0 1 130 254 63 1044225
3 * Linux 130 0 1 121403 254 63 1948266810

search_part()
Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63
Linux Swap 0 1 1 65 254 44 1060208
SWAP2 version 1, pagesize=4096, 542 MB / 517 MiB

recover_EXT2: s_block_group_nr=0/62, s_mnt_count=5/36, s_blocks_per_group=8192, s_inodes_per_group=2040
recover_EXT2: s_blocksize=1024
recover_EXT2: s_blocks_count 514080
recover_EXT2: part_size 1028160
Linux 66 0 1 129 254 63 1028160
ext2 blocksize=1024 Sparse_SB, 526 MB / 502 MiB

recover_EXT2: s_block_group_nr=0/7432, s_mnt_count=4/30, s_blocks_per_group=32768, s_inodes_per_group=16384
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 243533328
recover_EXT2: part_size 1948266624
Linux 130 0 1 121403 252 3 1948266624
ext2 blocksize=4096 Sparse_SB, 997 GB / 929 GiB

Raid magic value at 121403/252/4
Raid apparent size: 1948266624 sectors
Raid chunk size: 0 bytes
md0 md 0.90.0 L.Endian Raid 1: devices 1(8,19)*
Linux RAID 130 0 1 121403 254 5 1948266752 [md0]
md 0.90.0 L.Endian Raid 1: devices 1(8,19)*, 997 GB / 929 GiB
file_pread(5,2,buffer,1953525760(121601/90/26)) lseek err Invalid argument
file_pread(5,1,buffer,1953525760(121601/90/26)) lseek err Invalid argument
file_pread(5,1,buffer,1953525759(121601/90/25)) lseek err Invalid argument
file_pread(5,14,buffer,1953525761(121601/90/27)) lseek err Invalid argument
file_pread(5,3,buffer,1953525775(121601/90/41)) lseek err Invalid argument
file_pread(5,3,buffer,1953525822(121601/91/25)) lseek err Invalid argument
file_pread(5,8,buffer,1953525838(121601/91/41)) lseek err Invalid argument
file_pread(5,11,buffer,1953525885(121601/92/25)) lseek err Invalid argument
file_pread(5,2,buffer,1953527807(121601/122/57)) lseek err Invalid argument
get_geometry_from_list_part_aux head=255 nbr=7
get_geometry_from_list_part_aux head=8 nbr=1
get_geometry_from_list_part_aux head=16 nbr=1
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=7

Results
* Linux Swap 0 1 1 65 254 63 1060227
SWAP2 version 1, pagesize=4096, 542 MB / 517 MiB
P Linux 66 0 1 129 254 63 1028160
ext2 blocksize=1024 Sparse_SB, 526 MB / 502 MiB
Linux 130 0 1 121403 254 63 1948266810
ext2 blocksize=4096 Sparse_SB, 997 GB / 929 GiB
Linux RAID 130 0 1 121403 254 63 1948266810 [md0]
md 0.90.0 L.Endian Raid 1: devices 1(8,19)*, 997 GB / 929 GiB

interface_write()
1 * Linux Swap 0 1 1 65 254 63 1060227
2 P Linux 66 0 1 129 254 63 1028160

search_part()
Disk /dev/sdb - 1000 GB / 931 GiB - CHS 121601 255 63
Linux Swap 0 1 1 65 254 44 1060208
SWAP2 version 1, pagesize=4096, 542 MB / 517 MiB

recover_EXT2: s_block_group_nr=0/62, s_mnt_count=5/36, s_blocks_per_group=8192, s_inodes_per_group=2040
recover_EXT2: s_blocksize=1024
recover_EXT2: s_blocks_count 514080
recover_EXT2: part_size 1028160
Linux 66 0 1 129 254 63 1028160
ext2 blocksize=1024 Sparse_SB, 526 MB / 502 MiB

block_group_nr 3

recover_EXT2: "e2fsck -b 24577 -B 1024 device" may be needed
recover_EXT2: s_block_group_nr=3/62, s_mnt_count=0/36, s_blocks_per_group=8192, s_inodes_per_group=2040
recover_EXT2: s_blocksize=1024
recover_EXT2: s_blocks_count 514080
recover_EXT2: part_size 1028160
Linux 66 0 1 129 254 63 1028160
ext2 blocksize=1024 Sparse_SB Backup_SB, 526 MB / 502 MiB

recover_EXT2: s_block_group_nr=0/7432, s_mnt_count=4/30, s_blocks_per_group=32768, s_inodes_per_group=16384
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 243533328
recover_EXT2: part_size 1948266624
Linux 130 0 1 121403 252 3 1948266624
ext2 blocksize=4096 Sparse_SB, 997 GB / 929 GiB

block_group_nr 3

recover_EXT2: "e2fsck -b 98304 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=3/7432, s_mnt_count=0/30, s_blocks_per_group=32768, s_inodes_per_group=16384
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 243533328
recover_EXT2: part_size 1948266624
Linux 130 0 1 121403 252 3 1948266624
ext2 blocksize=4096 Sparse_SB Backup_SB, 997 GB / 929 GiB

Raid magic value at 121403/252/4
Raid apparent size: 1948266624 sectors
Raid chunk size: 0 bytes
md0 md 0.90.0 L.Endian Raid 1: devices 1(8,19)*
Linux RAID 130 0 1 121403 254 5 1948266752 [md0]
md 0.90.0 L.Endian Raid 1: devices 1(8,19)*, 997 GB / 929 GiB
file_pread(5,2,buffer,1953525760(121601/90/26)) lseek err Invalid argument
file_pread(5,1,buffer,1953525760(121601/90/26)) lseek err Invalid argument
file_pread(5,1,buffer,1953525759(121601/90/25)) lseek err Invalid argument
file_pread(5,14,buffer,1953525761(121601/90/27)) lseek err Invalid argument
file_pread(5,3,buffer,1953525775(121601/90/41)) lseek err Invalid argument
file_pread(5,3,buffer,1953525822(121601/91/25)) lseek err Invalid argument
file_pread(5,8,buffer,1953525838(121601/91/41)) lseek err Invalid argument
file_pread(5,11,buffer,1953525885(121601/92/25)) lseek err Invalid argument
file_pread(5,2,buffer,1953527807(121601/122/57)) lseek err Invalid argument
get_geometry_from_list_part_aux head=255 nbr=7
get_geometry_from_list_part_aux head=8 nbr=1
get_geometry_from_list_part_aux head=16 nbr=1
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=7

Results
* Linux Swap 0 1 1 65 254 63 1060227
SWAP2 version 1, pagesize=4096, 542 MB / 517 MiB
P Linux 66 0 1 129 254 63 1028160
ext2 blocksize=1024 Sparse_SB, 526 MB / 502 MiB
Linux 130 0 1 121403 254 63 1948266810
ext2 blocksize=4096 Sparse_SB, 997 GB / 929 GiB
Linux RAID 130 0 1 121403 254 63 1948266810 [md0]
md 0.90.0 L.Endian Raid 1: devices 1(8,19)*, 997 GB / 929 GiB

interface_write()
1 * Linux Swap 0 1 1 65 254 63 1060227
2 P Linux 66 0 1 129 254 63 1028160



What is your suggestion? What should I do?
thx for your help,

BR,
Akos KAali

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

Re: Lost Partition while installing 2nd HDD

#4 Post by Fiona »

The second to the last partition has no RAID status.
Did you select your last two partitions and were you pressing p to have a try to list your files?
Would be important to know, which partitions to recover.
Also to consider to set your controller back to NO RAID.
Can you go in testdisk to Options and set align partitions to No and can you have another try to set all of your partitions for recoverry?
Do you still get the message structure bad?
Would only be intended for recovery.
After recoverry you should backup your data immediately.
Then you could run something like gparted to decrease the first overlapping partition slightly.
Afterwards you could increase it again so that your partition ends exactly before the next partition starts.
Should solve the problem with overlapping.

But at the first let me know, have you been able to list your files?
If yes, on which partition and set your partitions for recovery using Option / align partitions to NO.
Did it work?
Further info will follow.

Fiona

kaalia
Posts: 5
Joined: 15 Jul 2015, 14:27

Re: Lost Partition while installing 2nd HDD

#5 Post by kaalia »

Dear Fiona ,

I used the "P" keay on my last two partition with the following outcome:
p1.jpg
p1.jpg (96.46 KiB) Viewed 2219 times
and
p2.jpg
p2.jpg (65.49 KiB) Viewed 2219 times
After that I changed in the option align partiotion to NO and I made a quick search:
quick.jpg
quick.jpg (125.88 KiB) Viewed 2219 times
Can you help me how to continue the recovery preocess?:)

Thx,
BR,
Akos

kaalia
Posts: 5
Joined: 15 Jul 2015, 14:27

Re: Lost Partition while installing 2nd HDD

#6 Post by kaalia »

Dear Fiona,

I used in the option align partiotion to NO and I made a deeper search:
screen1.jpg
screen1.jpg (124.08 KiB) Viewed 2194 times
and:
screen2.jpg
screen2.jpg (69.86 KiB) Viewed 2194 times
Thx for your help.

Br,
Akos

kaalia
Posts: 5
Joined: 15 Jul 2015, 14:27

Re: Lost Partition while installing 2nd HDD

#7 Post by kaalia »

Dear Fiona,

Can you help me howto contiune the recovery process?

thx,
Akos

Locked