Unable to recover partition Topic is solved

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
Message
Author
anapodos
Posts: 17
Joined: 09 Jun 2014, 23:08

Re: Unable to recover partition

#11 Post by anapodos »

Thanks for the info. So i have to buy an new disk in order to copy my data.
Unfortunately the folder that i need most of all others is not accessible.It says about damaged file system. Do you think it's possible to recover this folder?
damaged.png
damaged.png (57.61 KiB) Viewed 3745 times
Also changed option Align Partitions from Yes to No but still i am not able to add a partition.

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

Re: Unable to recover partition

#12 Post by Fiona »

If you have currently no disk, you can add your partition trying Options and set "Align partitions" to No.
So you'd be able to run fsck also.
If you have enough space available you could copy and paste your files later.
But in any case, backup is always important.

Fiona

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

Re: Unable to recover partition

#13 Post by anapodos »

I did set Align to No but still can't add a partition.
I will buy a disk these days, copy over whatever i can and then will continue with partition recovery.
Thanks for the help till now, i will come back as soon as i back up the files.

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

Re: Unable to recover partition

#14 Post by Fiona »

There might be another trick to add your partition.
You could use the menu geometry to increase the amount of cylinder from 121601 to 121602.
Don't change anything else.
In earlier TestDisk-versions, there was an option, it was called "Allow partial last cylinder, what did exactly this trick.
If you'd like to try it?

Fiona

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

Re: Unable to recover partition

#15 Post by anapodos »

Fiona wrote:There might be another trick to add your partition.
You could use the menu geometry to increase the amount of cylinder from 121601 to 121602.
Don't change anything else.
In earlier TestDisk-versions, there was an option, it was called "Allow partial last cylinder, what did exactly this trick.
If you'd like to try it?

Fiona
Sorry for late comeback. I have a new hard disk and i have copied any file i could. Unfortunately i can't copy foto folder as i mentioned before because of damaged filesystem.

I tried the trick you suggested increasing the cylinder but still no luck. I still can't add a partition.

I found the superblock and my first command was:

Code: Select all

/sbin/fsck.ext4 -b 32768 -B 4096 /dev/sdb
This command gave me the next output:

Code: Select all

kostas@kostas:~$ /sbin/fsck.ext4 -b 32768 -B 4096 /dev/sdb
e2fsck 1.42.9 (4-Feb-2014)
Downloads contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Deleted inode 12481 has zero dtime.  Fix<y>? no
Inodes that were part of a corrupted orphan linked list found.  Fix<y>? no
Inode 12482 was part of the orphaned inode list.  IGNORED.
Inode 12482 is in use, but has dtime set.  Fix<y>? no
Inode 12484 was part of the orphaned inode list.  IGNORED.
Inode 12485 was part of the orphaned inode list.  IGNORED.
Inode 12486 was part of the orphaned inode list.  IGNORED.
Inode 12486 is in use, but has dtime set.  Fix<y>? no
Inode 12486 has a bad extended attribute block 655373.  Clear<y>? no
Extended attribute block 655373 has h_blocks > 1.  Clear<y>? no
Extended attribute block 655373 is corrupt (invalid value).  Clear<y>? no
Extended attribute block 655373 is corrupt (invalid value).  Clear<y>? no
Extended attribute block 655373 is corrupt (allocation collision).  Clear<y>? no
Inode 12486, i_blocks is 283474460788, should be 1.  Fix<y>? no
Inode 12487 was part of the orphaned inode list.  IGNORED.
Inode 12487 is in use, but has dtime set.  Fix<y>? no
Inode 12488 was part of the orphaned inode list.  IGNORED.
Inode 12488 is in use, but has dtime set.  Fix<y>? no
Inode 12489 was part of the orphaned inode list.  IGNORED.
Inode 12489 is in use, but has dtime set.  Fix<y>? no
Inode 12490 was part of the orphaned inode list.  IGNORED.
Inode 12490 is in use, but has dtime set.  Fix<y>? no
Inode 12490 has a bad extended attribute block 7077992.  Clear<y>? no
Extended attribute block 7077992 has h_blocks > 1.  Clear<y>? no
Extended attribute block 7077992 is corrupt (invalid value).  Clear<y>? no
Extended attribute block 7077992 is corrupt (invalid value).  Clear<y>? no
Extended attribute block 7077992 is corrupt (allocation collision).  Clear<y>? no
Inode 12490, i_size is 32370099069976686, should be 0.  Fix<y>? no
Inode 12490, i_blocks is 472449417320, should be 8.  Fix<y>? no
Inode 12491 was part of the orphaned inode list.  IGNORED.
Inode 12491 is in use, but has dtime set.  Fix<y>? no
Inode 12491 has a bad extended attribute block 7077996.  Clear<y>? no
Extended attribute block 7077996 has h_blocks > 1.  Clear<y>? no
Extended attribute block 7077996 is corrupt (invalid value).  Clear<y>? no
Extended attribute block 7077996 is corrupt (invalid value).  Clear<y>? no
Extended attribute block 7077996 is corrupt (allocation collision).  Clear<y>? no
Inode 12491, i_size is 30962749956554784, should be 0.  Fix<y>? no
Inode 12491, i_blocks is 429503414389, should be 1.  Fix<y>? no
Inode 12492 was part of the orphaned inode list.  IGNORED.
Inode 12492 is in use, but has dtime set.  Fix<y>? no
Inode 12492 has a bad extended attribute block 7209033.  Clear<y>? no
Extended attribute block 7209033 has h_blocks > 1.  Clear<y>? no
Extended attribute block 7209033 is corrupt (invalid value).  Clear<y>? no
Extended attribute block 7209033 is corrupt (invalid value).  Clear<y>? no
Extended attribute block 7209033 is corrupt (allocation collision).  Clear<y>? no
Inode 12492, i_size is 31244160507904116, should be 0.  Fix<y>? no
Inode 12492, i_blocks is 416619429985, should be 1.  Fix<y>? no
Inode 12493 was part of the orphaned inode list.  IGNORED.
Inode 12493 is in use, but has dtime set.  Fix<y>? 
Downloads: e2fsck canceled.

Downloads: ***** FILE SYSTEM WAS MODIFIED *****

Downloads: ********** WARNING: Filesystem still has errors **********

Should i select yes to the answers? Is there an option for automatically answer yes to fix the errors?
Any ideas?

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

Re: Unable to recover partition

#16 Post by Fiona »

I have no idea why you can't write your partition into your partition table.
There is another possibility that your partition starts at cylinder 0 (it's normal), but head 0 should be 1.
Might be possible that this is the culprit?
Otherwise any background process like antivirus can prevent testdisk from writing a partition into your partition table.
If you've already recovered your files except photos, you can use PhotRec to recover them first.
You can use FileOpt and pressing s to deselect all file types.
Then select only these file types where you'd like to recover.
For example jpg?
So PhotoRec will only recover jpg and not any unnecessary files like txt-files etc..
If you were able to recover your photos, you could have another try to run fsck and confirm all questions.
I'm not as much a linux tech savvy, that's why I don't know how you can automatically answer it?

Fiona

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

Re: Unable to recover partition

#17 Post by anapodos »

I would like to have the photos recovered with the folder name and date creation attributes.
Any way one last question. Will fsck delete any files?

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

Re: Unable to recover partition

#18 Post by anapodos »

Fiona wrote:I have no idea why you can't write your partition into your partition table.
There is another possibility that your partition starts at cylinder 0 (it's normal), but head 0 should be 1.
Might be possible that this is the culprit?

Fiona
Wow!!! This surely is the possibility. Now i have the option to write. I successfully added the partition, pressed enter and the write option was there. I confirmed, rebooted the computer but i can't still mount the partition. Now gparted shows unknown filesystem instead of unallocated space. In ubuntu disks software i get the following picture.
http://i.imgur.com/ju2Jtga.png

This is exactly how the partition looked before the unallocated.
Although when i go to mount the partition i get the error

Code: Select all

Error mounting /dev/sdb1 at /media/kostas/Downloads: Command-line `mount -t "ext4" -o "uhelper=udisks2,nodev,nosuid" "/dev/sdb1" "/media/kostas/Downloads"' exited with non-zero exit status 32: mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

 (udisks-error-quark, 0)

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

Re: Unable to recover partition

#19 Post by Fiona »

Did you add your partition using the value 1?
You shouldn't do that.
It was only intended as a possible reason, why you can't write your partition into your partition table.
Because if you add another partition using different values, you'd only add an empty partition.
As long as testdisk finds your partition you only should use these values.
So it has a relation to your file system and superblock and its backup!

Fiona

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

Re: Unable to recover partition

#20 Post by anapodos »

Yes i added with value 1. I got excited that i would be able to add the partition and i did so. I hope it's not a big problem. Files are still there i can list them but only if i choose a none partition type in testdisk options.

So how should i proceed now? Should i run the fsck command to fix the filesystem or this will overwrite the files?

Locked