can see files, but testdisk dont writ the ext? header

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
pingo
Posts: 1
Joined: 20 Apr 2022, 03:00

can see files, but testdisk dont writ the ext? header

#1 Post by pingo »

hello

i have a 1.5 tb disk which i could see its partitions innards and copy some files finely.
im tryng to fix the ext filesystem header to mount it as usual, but testdisk is not writing it it seems, nor showing me which type of ext it is in the menus, although in logs i can see that is ext4
how do i fix this?
thanks really much



Tue Apr 19 23:07:40 2022
Command line: TestDisk

TestDisk 7.1, Data Recovery Utility, July 2019
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org
OS: Linux, kernel 5.15.0-25-generic (#25-Ubuntu SMP Wed Mar 30 15:54:22 UTC 2022) x86_64
Compiler: GCC 11.2
ext2fs lib: 1.46.5, ntfs lib: libntfs-3g, reiserfs lib: none, ewf lib: none, curses lib: ncurses 6.3
/dev/sda: LBA, HPA, LBA48, DCO support
/dev/sda: size 2000409264 sectors
/dev/sda: user_max 2000409264 sectors
/dev/sda: native_max 2000409264 sectors
/dev/sdb: LBA, HPA, LBA48, DCO support
/dev/sdb: size 976773168 sectors
/dev/sdb: user_max 976773168 sectors
/dev/sdb: native_max 976773168 sectors
Warning: can't get size for Disk /dev/mapper/control - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop8 - 0 B - 0 sectors, sector size=512
Hard disk list
Disk /dev/sda - 1024 GB / 953 GiB - CHS 124519 255 63, sector size=512 - Samsung SSD 850 PRO 1TB, S/N:S252NXAG713765N, FW:EXM02B6Q
Disk /dev/sdb - 500 GB / 465 GiB - CHS 60801 255 63, sector size=512 - Samsung SSD 850 EVO 500GB, S/N:S21HNXAG417586A, FW:EMT01B6Q
Disk /dev/sdc - 1500 GB / 1397 GiB - CHS 182401 255 63, sector size=512 - ST315003 41AS, FW:CC1H
Disk /dev/loop0 - 4096 B - 8 sectors (RO), sector size=512
Disk /dev/loop1 - 64 MB / 61 MiB - 126760 sectors (RO), sector size=512
Disk /dev/loop2 - 163 MB / 155 MiB - 318728 sectors (RO), sector size=512
Disk /dev/loop3 - 260 MB / 248 MiB - 509456 sectors (RO), sector size=512
Disk /dev/loop4 - 85 MB / 81 MiB - 166424 sectors (RO), sector size=512
Disk /dev/loop5 - 48 MB / 45 MiB - 93920 sectors (RO), sector size=512
Disk /dev/loop6 - 45 MB / 43 MiB - 89352 sectors (RO), sector size=512
Disk /dev/loop7 - 290 KB / 284 KiB - 568 sectors (RO), sector size=512

Partition table type (auto): Intel
Disk /dev/sdc - 1500 GB / 1397 GiB - ST315003 41AS
Partition table type: Intel

Analyse Disk /dev/sdc - 1500 GB / 1397 GiB - CHS 182401 255 63
Geometry from i386 MBR: head=255 sector=63
check_part_i386 failed for partition type 83
check_part_i386 failed for partition type 83
Current partition structure:
No ext2, JFS, Reiser, cramfs or XFS marker
1 * Linux 0 32 33 7011 164 1 112640000
1 * Linux 0 32 33 7011 164 1 112640000
No ext2, JFS, Reiser, cramfs or XFS marker
2 P Linux 7011 164 2 182401 68 3 2817634304
2 P Linux 7011 164 2 182401 68 3 2817634304

search_part()
Disk /dev/sdc - 1500 GB / 1397 GiB - CHS 182401 255 63

block_group_nr 1

recover_EXT2: "e2fsck -b 32768 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=1/429, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 14080000
recover_EXT2: part_size 112640000
Filesystem created: Fri Oct 14 08:51:49 2016
Linux 0 32 33 7011 164 1 112640000
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 57 GB / 53 GiB

block_group_nr 1

recover_EXT2: "e2fsck -b 32768 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=1/10748, s_mnt_count=0/30, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 352204288
recover_EXT2: part_size 2817634304
Filesystem created: Sat Nov 13 10:18:08 2010
Linux 7011 164 2 182401 68 3 2817634304 [dados]
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 1442 GB / 1343 GiB

Results
* Linux 0 32 33 7011 164 1 112640000
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 57 GB / 53 GiB
P Linux 7011 164 2 182401 68 3 2817634304 [dados]
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 1442 GB / 1343 GiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 112640000 linear /dev/sdc 2048" | dmsetup create test0
echo "0 2817634304 linear /dev/sdc 112642048" | dmsetup create test1

interface_write()
1 * Linux 0 32 33 7011 164 1 112640000
2 P Linux 7011 164 2 182401 68 3 2817634304 [dados]


dir_partition inode=2
P Linux 7011 164 2 182401 68 3 2817634304 [dados]
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 1442 GB / 1343 GiB
Directory /
2 drwxr-xr-x 0 0 4096 6-Sep-2015 18:37 .
2 drwxr-xr-x 0 0 4096 6-Sep-2015 18:37 ..
11 drwx------ 0 0 16384 13-Nov-2010 10:21 lost+found
12 drwxr-xr-x 0 0 4096 7-Jan-2015 21:37 MSI8b746.tmp
5505025 drwxrwxr-x 1000 1000 12288 26-Mar-2018 13:26 dados
16 drwxr-xr-x 0 0 4096 6-Sep-2015 18:37 $RECYCLE.BIN
13 -rw-r--r-- 0 0 129 7-Jan-2015 21:37 MSIb6f91.tmp
59375617 drwx------ 0 0 4096 16-Aug-2015 13:19 .Trash-0
14 drwxr-xr-x 0 0 4096 6-Sep-2015 16:26 System Volume Information

interface_write()
1 * Linux 0 32 33 7011 164 1 112640000
2 P Linux 7011 164 2 182401 68 3 2817634304 [dados]
write!

write_mbr_i386: starting...
write_all_log_i386: starting...
No extended partition
Need to fix
1 * Linux 0 32 33 7011 164 1 112640000
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 57 GB / 53 GiB
Need to fix
2 P Linux 7011 164 2 182401 68 3 2817634304 [dados]
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 1442 GB / 1343 GiB

recuperation
Posts: 2735
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: can see files, but testdisk dont writ the ext? header

#2 Post by recuperation »

https://www.cgsecurity.org/wiki/TestDisk

[...
Locate ext2/ext3/ext4 Backup SuperBlock
...]

There is no "fix".

Locked