Linux recovery ext4 3tB part. from terminal

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
ralexander
Posts: 3
Joined: 16 Aug 2018, 22:49

Linux recovery ext4 3tB part. from terminal

#1 Post by ralexander »

I used testdisk a long time ago on my windows. All worked fine =)
Today I have a power cut in my town and after I power back my desk-server one HDD lost him, i think, superblock or something. And some fsck and other terminal based fixing didn't work.

I run $ sudo testdisk with no problem. I can search for data and Copy it to other HDD. But there is 2.7tB of data that I don't have backup =(

that drive is for sure ext4 like all other drives. no RAID or anything just simple drive with just one 3tB partition.

Can some provide steps to fix sectors or block or whatever if there is a chance to not lose data.
I was going to try but never have this issue on Linux so kinda scared to not make greater mess =(
if need I can provide data from a terminal

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

Re: Linux recovery ext4 3tB part. from terminal

#2 Post by cgrenier »

What is the result of fsck.ext4 on this filesystem ?

ralexander
Posts: 3
Joined: 16 Aug 2018, 22:49

Re: Linux recovery ext4 3tB part. from terminal

#3 Post by ralexander »

I'm not home now but can provide some data asked on one Linux forum.
fsck.ext4 don't have now.
This is a first error that I got after I try a manual mount

Code: Select all

mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sdc, missing codepage or helper program, or other error.
just to say there is only /dev/sdc drive there is no that /dev/sdc1 that all normal HDD have as all others do sdx1

Code: Select all

fdisk -l

Disk /dev/sdc: 2,7 TiB, 3000591900160 bytes, 5860531055 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
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start        End    Sectors Size Id Type
/dev/sdc1           1 4294967295 4294967295   2T ee GPT

Partition 1 does not start on physical sector boundary.



$ parted -l

Error: Invalid argument during seek for read on /dev/sdc
Retry/Ignore/Cancel? i                                                    
Error: The backup GPT table is corrupt, but the primary appears OK, so that will be used.
OK/Cancel?                                                                
OK/Cancel? OK                                                             
Model: ATA TOSHIBA HDWD130 (scsi)
Disk /dev/sdc: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: unknown
Disk Flags:


gdisk -l /dev/sdc

GPT fdisk (gdisk) version 1.0.3

Warning! Disk size is smaller than the main header indicates! Loading
secondary header from the last sector of the disk! You should use 'v' to
verify disk integrity, and perhaps options on the experts' menu to repair
the disk.
Caution: invalid backup GPT header, but valid main header; regenerating
backup header from main header.

Warning! One or more CRCs don't match. You should repair the disk!

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: damaged

****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************
Disk /dev/sdc: 5860531055 sectors, 2.7 TiB
Model: TOSHIBA HDWD130 
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): 190FB3A2-F875-425D-85F4-4979BA8E5AAE
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 5860533134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2925 sectors (1.4 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048      5860532223   2.7 TiB     8300  3tB_01_name

ralexander
Posts: 3
Joined: 16 Aug 2018, 22:49

Re: Linux recovery ext4 3tB part. from terminal

#4 Post by ralexander »

cgrenier wrote: 17 Aug 2018, 10:22 What is the result of fsck.ext4 on this filesystem ?
when I run fsck.ext4 /dev/sdc

Code: Select all

fsck.ext4 /dev/sdb 
e2fsck 1.44.1 (24-Mar-2018)
/dev/sdb contains a file system with errors, check forced.
Resize inode not valid.  Recreate<y>? yes
Pass 1: Checking inodes, blocks, and sizes
Root inode is not a directory.  Clear<y>? yes
Inode 4578 is in extent format, but superblock is missing EXTENTS feature
Fix<y>? yes
Inode 16519 block 407928974 conflicts with critical metadata, skipping block checks.
Inode 20850 block 324600064 conflicts with critical metadata, skipping block checks.
and he runs hundreds of lines of those last two with more/less the same content
down more after those lines starts this:

Code: Select all

Special (device/socket/fifo/symlink) file (inode 1938157) has immutable
or append-only flag set.  Clear<y>? y
Special (device/socket/fifo/symlink) file (inode 1938202) has immutable
or append-only flag set.  Clear<y>? y
Special (device/socket/fifo/symlink) file (inode 1938231) has immutable
or append-only flag set.  Clear<y>? y
Special (device/socket/fifo/symlink) file (inode 1938239) has immutable
or append-only flag set.  Clear<y>? y
Special (device/socket/fifo/symlink) file (inode 1938543) has immutable
or append-only flag set.  Clear<y>? y
then spit some of theoes

Code: Select all

Inode 1942372 has illegal block(s).  Clear<y>? yes
Illegal block #0 (1357711575) in inode 1942372.  CLEARED.
Illegal block #1 (3053237666) in inode 1942372.  CLEARED.
Illegal block #2 (3922558359) in inode 1942372.  CLEARED.
Illegal block #3 (3152610796) in inode 1942372.  CLEARED.
Illegal block #4 (1374729159) in inode 1942372.  CLEARED.
Illegal block #5 (1891755457) in inode 1942372.  CLEARED.
Illegal block #6 (2257174369) in inode 1942372.  CLEARED.
Illegal block #7 (1366331961) in inode 1942372.  CLEARED.
Illegal block #8 (1658714215) in inode 1942372.  CLEARED.
Illegal block #10 (2054759113) in inode 1942372.  CLEARED.
Illegal block #11 (2916366314) in inode 1942372.  CLEARED.
Too many illegal blocks in inode 1942372.
Need more info or something ?

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

Re: Linux recovery ext4 3tB part. from terminal

#5 Post by cgrenier »

In your first post, it was /dev/sdc and in your last /dev/sdb. Have you modified something ?
Can you run "fsck.ext4 -y /dev/sdc" (or sdb) until no error is reported ?

Locked