Can't Mount Recovered Partition

How to use TestDisk to recover lost partition
Post Reply
Message
Author
netmind
Posts: 4
Joined: 03 May 2016, 23:50

Can't Mount Recovered Partition

#1 Post by netmind » 04 May 2016, 01:50

I believe my drive was formatted in error by my dns-323 nas.

I ran testdisk, analyzed, and wrote back what I believe to be the right partitions: 1 swap, 1 primary, 2nd primary (ext2 I think). When I plug the drive into usb 3 HD dock, Ubuntu is able to automatically mount and read the files from the 1st primary partition. However it is unable to properly mount the 2nd partition and gives the following error:

Error mounting /dev/sdb3 at /media/ubuntu/478cc222-c00c-4f7f-ac18-171b3127f983: Command-line `mount -t "ext2" -o "uhelper=udisks2,nodev,nosuid" "/dev/sdb3" "/media/ubuntu/478cc222-c00c-4f7f-ac18-171b3127f983"' exited with non-zero exit status 32: mount: mount /dev/sdb3 on /media/ubuntu/478cc222-c00c-4f7f-ac18-171b3127f983 failed: Structure needs cleaning

If I ignore the error and run testdisk again and go into the advanced->filesystem utils-> undelete option, testdisk shows all the files I expect in the partition. They are all listed down as undeleted also (ie not in RED).

I'm a beginner at linux and not sure what to do next. I was hoping that testdisk would help recover everything in place.

Any help is much appreciated.

Sponsored links

User avatar
cgrenier
Site Admin
Posts: 3573
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: Can't Mount Recovered Partition

#2 Post by cgrenier » 04 May 2016, 06:20

Run

Code: Select all

sudo fsck -a /dev/sdb3
Does it fix the problem ? If not, what is the output ?

netmind
Posts: 4
Joined: 03 May 2016, 23:50

Re: Can't Mount Recovered Partition

#3 Post by netmind » 05 May 2016, 15:44

Thanks for the response and sorry for delay. I took some time create a image of the partition first - just in case.

Here's the response from running the command. I'm running live CD so, the device changed to sdd3.

fsck from util-linux 2.27.1
/dev/sdd3: Note: if several inode or block bitmap blocks or part
of the inode table require relocation, you may wish to try
running e2fsck with the '-b 32768' option first. The problem
may lie only with the primary block group descriptors, and
the backup block group descriptors may be OK.

/dev/sdd3: Block bitmap for group 1024 is not in group. (block 0)


/dev/sdd3: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
(i.e., without -a or -p options)

netmind
Posts: 4
Joined: 03 May 2016, 23:50

Re: Can't Mount Recovered Partition

#4 Post by netmind » 06 May 2016, 02:36

I also ran the Superblock function in Testdisk and got the following:

Disk /dev/sdd - 2000 GB / 1863 GiB - CHS 243201 255 63

Partition Start End Size in sectors

> Linux 130 0 1 243200 254 56 3904935608
superblock 0, blocksize=4096 []
superblock 32768, blocksize=4096 []
superblock 98304, blocksize=4096 []
superblock 163840, blocksize=4096 []
superblock 229376, blocksize=4096 []
superblock 294912, blocksize=4096 []
superblock 819200, blocksize=4096 []
superblock 884736, blocksize=4096 []
superblock 1605632, blocksize=4096 []
superblock 2654208, blocksize=4096 []

After than I tried: sudo fsck -b 32768 -B 4096 -n /dev/sdd3.

It gave a whole bunch of messages (see attached file for full log). However at the end there was the following error and seemed like it aborted:

Illegal double indirect block (2856403265) in inode 34720. IGNORED.
Illegal triple indirect block (1094795539) in inode 34720. IGNORED.
Error while iterating over blocks in inode 34720: Illegal triply indirect block found

/dev/sdd3: ********** WARNING: Filesystem still has errors **********

e2fsck: aborted

/dev/sdd3: ********** WARNING: Filesystem still has errors **********

I tried re-running with all of the other superblocks, but they all resulted in simillar error at the end of the log.

Where should I go next?
Attachments
fscklog.tar.gz
(1.14 KiB) Downloaded 24 times

dns323Sucks
Posts: 1
Joined: 18 May 2016, 20:41

Re: Can't Mount Recovered Partition

#5 Post by dns323Sucks » 18 May 2016, 21:05

Hi,

I ran into the same problem. DNS323 told me it wants to format the new drive that I added but ended up formatting the old disk. I am looking into the testdisk, and it says it can recover files from ext2 partition, for Fat32 it says it can revover files and directories, so I am assuming that we can't just recover a bunch directories in ext2. With 2TB disk, it would be unreasonable to copy out file by file.

Which guide did you use to recover the partition? I am assuming here that recovering the parition means you update the parition table of the borked disk, so that the disk becomes readable by the file system.

User avatar
cgrenier
Site Admin
Posts: 3573
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: Can't Mount Recovered Partition

#6 Post by cgrenier » 19 May 2016, 06:40

As the partition has been reformated, use PhotoRec to recover your data.

netmind
Posts: 4
Joined: 03 May 2016, 23:50

Re: Can't Mount Recovered Partition

#7 Post by netmind » 26 May 2016, 17:12

I created a dd image and then decided to just run the fsck –y despite the errors – seemed to work.

I’m able to mount now. I think I got all or at least most of my files back.

Thanks for all the help.

@dns323sucks - reading through these 2 links helped me:

http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step
http://www.olschimke.eu/2013/05/31/d-li ... ith-alt-f/

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests