ubuntu /home dir deleted / testdisk.log

Using TestDisk to undelete files
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
Post Reply
Message
Author
bobo2019
Posts: 1
Joined: 04 Sep 2024, 18:10

ubuntu /home dir deleted / testdisk.log

#1 Post by bobo2019 »

Hello,

I am running a dual boot W11Home / Ubuntu 22.04 Dell Inspiron 2n1 laptop system.

I inadvertently ran the command " rm -f /home "and in doing so it seems have lost my home directory.

I found testdisk online and installed it on my linux partition. I ran testdisk and have attached the log.

It is very long however I am sure you are expert a scanning it's contents. I appreciate in advance your reply.

The home directory lived on an ext4 about 30gb partition.

Using testdisk I have attempted and had some success copying lost files and directories however during the copy process of the home directory
I run out of memory and have to abort the copy process. I was thinking of enlarging the partition if that would not impact recovery of home directory.


cat testdisk.log


Tue Sep 3 21:20:34 2024
Command line: TestDisk

TestDisk 7.1, Data Recovery Utility, July 2019
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org
OS: Linux, kernel 6.8.0-40-generic (#40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:30:19 UTC 2) 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
User is not root!
Hard disk list


TestDisk exited normally.
Using locale 'en_US.UTF-8'.


Tue Sep 3 21:20:41 2024
Command line: TestDisk /debug

TestDisk 7.1, Data Recovery Utility, July 2019
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org
OS: Linux, kernel 6.8.0-40-generic (#40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:30:19 UTC 2) 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
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/loop17 - 0 B - 0 sectors, sector size=512
Hard disk list
Disk /dev/loop0 - 69 KB / 68 KiB - 136 sectors (RO), sector size=512
Disk /dev/loop1 - 4096 B - 8 sectors (RO), sector size=512
Disk /dev/loop10 - 529 MB / 505 MiB - 1034424 sectors (RO), sector size=512
Disk /dev/loop11 - 96 MB / 91 MiB - 187776 sectors (RO), sector size=512
Disk /dev/loop12 - 13 MB / 12 MiB - 26472 sectors (RO), sector size=512
Disk /dev/loop13 - 40 MB / 38 MiB - 79520 sectors (RO), sector size=512
Disk /dev/loop14 - 512 KB / 500 KiB - 1000 sectors (RO), sector size=512
Disk /dev/loop15 - 338 MB / 322 MiB - 661400 sectors (RO), sector size=512
Disk /dev/loop16 - 364 MB / 347 MiB - 710976 sectors (RO), sector size=512
Disk /dev/loop2 - 10 MB / 10 MiB - 20648 sectors (RO), sector size=512
Disk /dev/loop3 - 109 MB / 104 MiB - 213384 sectors (RO), sector size=512
Disk /dev/loop4 - 58 MB / 55 MiB - 113992 sectors (RO), sector size=512
Disk /dev/loop5 - 67 MB / 63 MiB - 130960 sectors (RO), sector size=512
Disk /dev/loop6 - 77 MB / 74 MiB - 152112 sectors (RO), sector size=512
Disk /dev/loop7 - 282 MB / 269 MiB - 552488 sectors (RO), sector size=512
Disk /dev/loop8 - 172 MB / 164 MiB - 337560 sectors (RO), sector size=512
Disk /dev/loop9 - 366 MB / 349 MiB - 716176 sectors (RO), sector size=512
Disk /dev/nvme0n1 - 1024 GB / 953 GiB - CHS 976762 64 32, sector size=512
Disk /dev/nvme1n1 - 29 GB / 27 GiB - CHS 27905 64 32, sector size=512

Partition table type (auto): Intel
Disk /dev/nvme1n1 - 29 GB / 27 GiB
Partition table type: Intel

Analyse Disk /dev/nvme1n1 - 29 GB / 27 GiB - CHS 27905 64 32
Geometry from i386 MBR: head=255 sector=36
BAD_RS LBA=2048 1056
FAT32 at 1/0/1
Info: size boot_sector 1048576, partition 1048576
FAT1 : 6158-7174
FAT2 : 7175-8191
start_rootdir : 8192 root cluster : 2
Data : 8192-1048575
sectors : 1048576
cluster_size : 8
no_of_cluster : 130048 (2 - 130049)
fat_length 1017 calculated 1017
heads/cylinder 255 (FAT) != 64 (HD)
sect/track 63 (FAT) != 32 (HD)
set_FAT_info: name from BS used
BAD_RS LBA=1052670 2103233
BAD_RS LBA=1052672 2103233
get_geometry_from_list_part_aux head=64 nbr=4
get_geometry_from_list_part_aux head=8 nbr=4
get_geometry_from_list_part_aux head=16 nbr=4
get_geometry_from_list_part_aux head=32 nbr=4
get_geometry_from_list_part_aux head=64 nbr=4
get_geometry_from_list_part_aux head=128 nbr=2
get_geometry_from_list_part_aux head=255 nbr=1
Current partition structure:
Warning: number of heads/cylinder mismatches 255 (FAT) != 64 (HD)
Warning: number of sectors per track mismatches 63 (FAT) != 32 (HD)
1 P FAT32 LBA 1 0 1 512 63 32 1048576 [NO NAME]

Warning: Bad starting sector (CHS and LBA don't match)
2 E extended 513 63 31 27903 63 32 56094722

Warning: Bad starting head (CHS and LBA don't match)
No partition is bootable
Logical partition must not be bootable
5 L Linux 514 0 1 27903 63 32 56094720

Warning: Bad starting head (CHS and LBA don't match)

search_part()
Disk /dev/nvme1n1 - 29 GB / 27 GiB - CHS 27905 64 32
FAT32 at 1/0/1
FAT1 : 6158-7174
FAT2 : 7175-8191
start_rootdir : 8192 root cluster : 2
Data : 8192-1048575
sectors : 1048576
cluster_size : 8
no_of_cluster : 130048 (2 - 130049)
fat_length 1017 calculated 1017
heads/cylinder 255 (FAT) != 64 (HD)
sect/track 63 (FAT) != 32 (HD)
set_FAT_info: name from BS used

FAT32 at 1/0/1
FAT: cluster=2(0x2), pos=10240
FAT32 1 0 1 512 63 32 1048576 [EFI System Partition] [NO NAME]
FAT32, blocksize=4096, 536 MB / 512 MiB

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=963/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Mon Sep 2 11:05:45 2024
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB, 28 GB / 26 GiB
get_geometry_from_list_part_aux head=64 nbr=4
get_geometry_from_list_part_aux head=8 nbr=4
get_geometry_from_list_part_aux head=16 nbr=4
get_geometry_from_list_part_aux head=32 nbr=4
get_geometry_from_list_part_aux head=64 nbr=4
get_geometry_from_list_part_aux head=128 nbr=2
get_geometry_from_list_part_aux head=255 nbr=1

Results
* FAT32 1 0 1 512 63 32 1048576 [EFI System Partition] [NO NAME]
FAT32, blocksize=4096, 536 MB / 512 MiB
P Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB, 28 GB / 26 GiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 1048576 linear /dev/nvme1n1 2048" | dmsetup create test0
echo "0 56094720 linear /dev/nvme1n1 1052672" | dmsetup create test1

interface_write()
1 * FAT32 1 0 1 512 63 32 1048576 [EFI System Partition] [NO NAME]
2 P Linux 514 0 1 27903 63 32 56094720

search_part()
Disk /dev/nvme1n1 - 29 GB / 27 GiB - CHS 27905 64 32
FAT32 at 1/0/1
FAT1 : 6158-7174
FAT2 : 7175-8191
start_rootdir : 8192 root cluster : 2
Data : 8192-1048575
sectors : 1048576
cluster_size : 8
no_of_cluster : 130048 (2 - 130049)
fat_length 1017 calculated 1017
heads/cylinder 255 (FAT) != 64 (HD)
sect/track 63 (FAT) != 32 (HD)
set_FAT_info: name from BS used

FAT32 at 1/0/1
FAT: cluster=2(0x2), pos=10240
FAT32 1 0 1 512 63 32 1048576 [EFI System Partition] [NO NAME]
FAT32, blocksize=4096, 536 MB / 512 MiB
FAT32 at 1/0/7
FAT1 : 6158-7174
FAT2 : 7175-8191
start_rootdir : 8192 root cluster : 2
Data : 8192-1048575
sectors : 1048576
cluster_size : 8
no_of_cluster : 130048 (2 - 130049)
fat_length 1017 calculated 1017
heads/cylinder 255 (FAT) != 64 (HD)
sect/track 63 (FAT) != 32 (HD)
set_FAT_info: name from BS used

FAT32 at 1/0/7
FAT: cluster=2(0x2), pos=10240
FAT32 1 0 1 512 63 32 1048576 [EFI System Partition] [NO NAME]
FAT32, blocksize=4096, 536 MB / 512 MiB

block_group_nr 1

recover_EXT2: "e2fsck -b 32768 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=1/218, 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 7143424
recover_EXT2: part_size 57147392
Filesystem created: Sun Dec 20 19:07:38 2020
Linux 1 0 1 27904 63 32 57147392 [root]
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 29 GB / 27 GiB

block_group_nr 3

recover_EXT2: "e2fsck -b 98304 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=3/218, 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 7143424
recover_EXT2: part_size 57147392
Filesystem created: Sun Dec 20 19:07:38 2020
Linux 1 0 1 27904 63 32 57147392 [root]
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 29 GB / 27 GiB

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=963/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Mon Sep 2 11:05:45 2024
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB, 28 GB / 26 GiB

block_group_nr 1

recover_EXT2: "e2fsck -b 32768 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=1/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB
Linux Swap 650 0 1 1920 7 16 2601200
SWAP2 version 1, pagesize=4096, 1331 MB / 1270 MiB

block_group_nr 3

recover_EXT2: "e2fsck -b 98304 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=3/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

block_group_nr 5

recover_EXT2: "e2fsck -b 163840 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=5/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

block_group_nr 7

recover_EXT2: "e2fsck -b 229376 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=7/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

block_group_nr 9

recover_EXT2: "e2fsck -b 294912 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=9/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

block_group_nr 25

recover_EXT2: "e2fsck -b 819200 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=25/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

block_group_nr 27

recover_EXT2: "e2fsck -b 884736 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=27/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

block_group_nr 49

recover_EXT2: "e2fsck -b 1605632 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=49/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

block_group_nr 81

recover_EXT2: "e2fsck -b 2654208 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=81/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=958/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Sun Sep 1 20:45:24 2024
Linux 13004 1 1 40394 0 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
This partition ends after the disk limits. (start=26632224, size=56094720, end=82726943, disk end=57149440)

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=958/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Sun Sep 1 20:45:24 2024
Linux 13012 1 1 40402 0 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
This partition ends after the disk limits. (start=26648608, size=56094720, end=82743327, disk end=57149440)

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=958/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Sun Sep 1 20:45:24 2024
Linux 13021 2 1 40411 1 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
This partition ends after the disk limits. (start=26667072, size=56094720, end=82761791, disk end=57149440)

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=958/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Sun Sep 1 20:45:24 2024
Linux 13023 2 1 40413 1 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
This partition ends after the disk limits. (start=26671168, size=56094720, end=82765887, disk end=57149440)

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=958/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Sun Sep 1 20:45:24 2024
Linux 13038 1 1 40428 0 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
This partition ends after the disk limits. (start=26701856, size=56094720, end=82796575, disk end=57149440)

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=958/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Sun Sep 1 20:45:24 2024
Linux 13046 2 1 40436 1 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
This partition ends after the disk limits. (start=26718272, size=56094720, end=82812991, disk end=57149440)

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=958/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Sun Sep 1 20:45:24 2024
Linux 13053 0 1 40442 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
This partition ends after the disk limits. (start=26732544, size=56094720, end=82827263, disk end=57149440)

block_group_nr 125

recover_EXT2: "e2fsck -b 4096000 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=125/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB
Disk /dev/nvme1n1 - 29 GB / 27 GiB - CHS 27905 64 32
Check the harddisk size: HD jumper settings, BIOS detection...
The harddisk (29 GB / 27 GiB) seems too small! (< 42 GB / 39 GiB)
The following partitions can't be recovered:
Linux 13004 1 1 40394 0 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
Linux 13012 1 1 40402 0 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
Linux 13021 2 1 40411 1 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
Linux 13023 2 1 40413 1 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
Linux 13038 1 1 40428 0 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
Linux 13046 2 1 40436 1 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
Linux 13053 0 1 40442 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
get_geometry_from_list_part_aux head=64 nbr=7
get_geometry_from_list_part_aux head=8 nbr=8
get_geometry_from_list_part_aux head=16 nbr=7
get_geometry_from_list_part_aux head=32 nbr=7
get_geometry_from_list_part_aux head=64 nbr=7
get_geometry_from_list_part_aux head=128 nbr=3
get_geometry_from_list_part_aux head=255 nbr=1
Warning: the current number of heads per cylinder is 64 but the correct value may be 8.

Results
FAT32 1 0 1 512 63 32 1048576 [EFI System Partition] [NO NAME]
FAT32, blocksize=4096, 536 MB / 512 MiB
Linux 1 0 1 27904 63 32 57147392 [root]
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 29 GB / 27 GiB
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB, 28 GB / 26 GiB
Linux Swap 650 0 1 1920 63 32 2603008
SWAP2 version 1, pagesize=4096, 1332 MB / 1271 MiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 1048576 linear /dev/nvme1n1 2048" | dmsetup create test0
echo "0 57147392 linear /dev/nvme1n1 2048" | dmsetup create test1
echo "0 56094720 linear /dev/nvme1n1 1052672" | dmsetup create test2
echo "0 2603008 linear /dev/nvme1n1 1331200" | dmsetup create test3
jerry@jerry-Inspiron-7506-2n1:~$
jerry@jerry-Inspiron-7506-2n1:~$
jerry@jerry-Inspiron-7506-2n1:~$ cat testdisk.log


Tue Sep 3 21:20:34 2024
Command line: TestDisk

TestDisk 7.1, Data Recovery Utility, July 2019
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org
OS: Linux, kernel 6.8.0-40-generic (#40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:30:19 UTC 2) 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
User is not root!
Hard disk list


TestDisk exited normally.
Using locale 'en_US.UTF-8'.


Tue Sep 3 21:20:41 2024
Command line: TestDisk /debug

TestDisk 7.1, Data Recovery Utility, July 2019
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org
OS: Linux, kernel 6.8.0-40-generic (#40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:30:19 UTC 2) 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
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/loop17 - 0 B - 0 sectors, sector size=512
Hard disk list
Disk /dev/loop0 - 69 KB / 68 KiB - 136 sectors (RO), sector size=512
Disk /dev/loop1 - 4096 B - 8 sectors (RO), sector size=512
Disk /dev/loop10 - 529 MB / 505 MiB - 1034424 sectors (RO), sector size=512
Disk /dev/loop11 - 96 MB / 91 MiB - 187776 sectors (RO), sector size=512
Disk /dev/loop12 - 13 MB / 12 MiB - 26472 sectors (RO), sector size=512
Disk /dev/loop13 - 40 MB / 38 MiB - 79520 sectors (RO), sector size=512
Disk /dev/loop14 - 512 KB / 500 KiB - 1000 sectors (RO), sector size=512
Disk /dev/loop15 - 338 MB / 322 MiB - 661400 sectors (RO), sector size=512
Disk /dev/loop16 - 364 MB / 347 MiB - 710976 sectors (RO), sector size=512
Disk /dev/loop2 - 10 MB / 10 MiB - 20648 sectors (RO), sector size=512
Disk /dev/loop3 - 109 MB / 104 MiB - 213384 sectors (RO), sector size=512
Disk /dev/loop4 - 58 MB / 55 MiB - 113992 sectors (RO), sector size=512
Disk /dev/loop5 - 67 MB / 63 MiB - 130960 sectors (RO), sector size=512
Disk /dev/loop6 - 77 MB / 74 MiB - 152112 sectors (RO), sector size=512
Disk /dev/loop7 - 282 MB / 269 MiB - 552488 sectors (RO), sector size=512
Disk /dev/loop8 - 172 MB / 164 MiB - 337560 sectors (RO), sector size=512
Disk /dev/loop9 - 366 MB / 349 MiB - 716176 sectors (RO), sector size=512
Disk /dev/nvme0n1 - 1024 GB / 953 GiB - CHS 976762 64 32, sector size=512
Disk /dev/nvme1n1 - 29 GB / 27 GiB - CHS 27905 64 32, sector size=512

Partition table type (auto): Intel
Disk /dev/nvme1n1 - 29 GB / 27 GiB
Partition table type: Intel

Analyse Disk /dev/nvme1n1 - 29 GB / 27 GiB - CHS 27905 64 32
Geometry from i386 MBR: head=255 sector=36
BAD_RS LBA=2048 1056
FAT32 at 1/0/1
Info: size boot_sector 1048576, partition 1048576
FAT1 : 6158-7174
FAT2 : 7175-8191
start_rootdir : 8192 root cluster : 2
Data : 8192-1048575
sectors : 1048576
cluster_size : 8
no_of_cluster : 130048 (2 - 130049)
fat_length 1017 calculated 1017
heads/cylinder 255 (FAT) != 64 (HD)
sect/track 63 (FAT) != 32 (HD)
set_FAT_info: name from BS used
BAD_RS LBA=1052670 2103233
BAD_RS LBA=1052672 2103233
get_geometry_from_list_part_aux head=64 nbr=4
get_geometry_from_list_part_aux head=8 nbr=4
get_geometry_from_list_part_aux head=16 nbr=4
get_geometry_from_list_part_aux head=32 nbr=4
get_geometry_from_list_part_aux head=64 nbr=4
get_geometry_from_list_part_aux head=128 nbr=2
get_geometry_from_list_part_aux head=255 nbr=1
Current partition structure:
Warning: number of heads/cylinder mismatches 255 (FAT) != 64 (HD)
Warning: number of sectors per track mismatches 63 (FAT) != 32 (HD)
1 P FAT32 LBA 1 0 1 512 63 32 1048576 [NO NAME]

Warning: Bad starting sector (CHS and LBA don't match)
2 E extended 513 63 31 27903 63 32 56094722

Warning: Bad starting head (CHS and LBA don't match)
No partition is bootable
Logical partition must not be bootable
5 L Linux 514 0 1 27903 63 32 56094720

Warning: Bad starting head (CHS and LBA don't match)

search_part()
Disk /dev/nvme1n1 - 29 GB / 27 GiB - CHS 27905 64 32
FAT32 at 1/0/1
FAT1 : 6158-7174
FAT2 : 7175-8191
start_rootdir : 8192 root cluster : 2
Data : 8192-1048575
sectors : 1048576
cluster_size : 8
no_of_cluster : 130048 (2 - 130049)
fat_length 1017 calculated 1017
heads/cylinder 255 (FAT) != 64 (HD)
sect/track 63 (FAT) != 32 (HD)
set_FAT_info: name from BS used

FAT32 at 1/0/1
FAT: cluster=2(0x2), pos=10240
FAT32 1 0 1 512 63 32 1048576 [EFI System Partition] [NO NAME]
FAT32, blocksize=4096, 536 MB / 512 MiB

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=963/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Mon Sep 2 11:05:45 2024
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB, 28 GB / 26 GiB
get_geometry_from_list_part_aux head=64 nbr=4
get_geometry_from_list_part_aux head=8 nbr=4
get_geometry_from_list_part_aux head=16 nbr=4
get_geometry_from_list_part_aux head=32 nbr=4
get_geometry_from_list_part_aux head=64 nbr=4
get_geometry_from_list_part_aux head=128 nbr=2
get_geometry_from_list_part_aux head=255 nbr=1

Results
* FAT32 1 0 1 512 63 32 1048576 [EFI System Partition] [NO NAME]
FAT32, blocksize=4096, 536 MB / 512 MiB
P Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB, 28 GB / 26 GiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 1048576 linear /dev/nvme1n1 2048" | dmsetup create test0
echo "0 56094720 linear /dev/nvme1n1 1052672" | dmsetup create test1

interface_write()
1 * FAT32 1 0 1 512 63 32 1048576 [EFI System Partition] [NO NAME]
2 P Linux 514 0 1 27903 63 32 56094720

search_part()
Disk /dev/nvme1n1 - 29 GB / 27 GiB - CHS 27905 64 32
FAT32 at 1/0/1
FAT1 : 6158-7174
FAT2 : 7175-8191
start_rootdir : 8192 root cluster : 2
Data : 8192-1048575
sectors : 1048576
cluster_size : 8
no_of_cluster : 130048 (2 - 130049)
fat_length 1017 calculated 1017
heads/cylinder 255 (FAT) != 64 (HD)
sect/track 63 (FAT) != 32 (HD)
set_FAT_info: name from BS used

FAT32 at 1/0/1
FAT: cluster=2(0x2), pos=10240
FAT32 1 0 1 512 63 32 1048576 [EFI System Partition] [NO NAME]
FAT32, blocksize=4096, 536 MB / 512 MiB
FAT32 at 1/0/7
FAT1 : 6158-7174
FAT2 : 7175-8191
start_rootdir : 8192 root cluster : 2
Data : 8192-1048575
sectors : 1048576
cluster_size : 8
no_of_cluster : 130048 (2 - 130049)
fat_length 1017 calculated 1017
heads/cylinder 255 (FAT) != 64 (HD)
sect/track 63 (FAT) != 32 (HD)
set_FAT_info: name from BS used

FAT32 at 1/0/7
FAT: cluster=2(0x2), pos=10240
FAT32 1 0 1 512 63 32 1048576 [EFI System Partition] [NO NAME]
FAT32, blocksize=4096, 536 MB / 512 MiB

block_group_nr 1

recover_EXT2: "e2fsck -b 32768 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=1/218, 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 7143424
recover_EXT2: part_size 57147392
Filesystem created: Sun Dec 20 19:07:38 2020
Linux 1 0 1 27904 63 32 57147392 [root]
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 29 GB / 27 GiB

block_group_nr 3

recover_EXT2: "e2fsck -b 98304 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=3/218, 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 7143424
recover_EXT2: part_size 57147392
Filesystem created: Sun Dec 20 19:07:38 2020
Linux 1 0 1 27904 63 32 57147392 [root]
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 29 GB / 27 GiB

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=963/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Mon Sep 2 11:05:45 2024
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB, 28 GB / 26 GiB

block_group_nr 1

recover_EXT2: "e2fsck -b 32768 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=1/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB
Linux Swap 650 0 1 1920 7 16 2601200
SWAP2 version 1, pagesize=4096, 1331 MB / 1270 MiB

block_group_nr 3

recover_EXT2: "e2fsck -b 98304 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=3/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

block_group_nr 5

recover_EXT2: "e2fsck -b 163840 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=5/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

block_group_nr 7

recover_EXT2: "e2fsck -b 229376 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=7/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

block_group_nr 9

recover_EXT2: "e2fsck -b 294912 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=9/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

block_group_nr 25

recover_EXT2: "e2fsck -b 819200 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=25/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

block_group_nr 27

recover_EXT2: "e2fsck -b 884736 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=27/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

block_group_nr 49

recover_EXT2: "e2fsck -b 1605632 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=49/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

block_group_nr 81

recover_EXT2: "e2fsck -b 2654208 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=81/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=958/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Sun Sep 1 20:45:24 2024
Linux 13004 1 1 40394 0 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
This partition ends after the disk limits. (start=26632224, size=56094720, end=82726943, disk end=57149440)

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=958/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Sun Sep 1 20:45:24 2024
Linux 13012 1 1 40402 0 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
This partition ends after the disk limits. (start=26648608, size=56094720, end=82743327, disk end=57149440)

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=958/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Sun Sep 1 20:45:24 2024
Linux 13021 2 1 40411 1 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
This partition ends after the disk limits. (start=26667072, size=56094720, end=82761791, disk end=57149440)

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=958/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Sun Sep 1 20:45:24 2024
Linux 13023 2 1 40413 1 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
This partition ends after the disk limits. (start=26671168, size=56094720, end=82765887, disk end=57149440)

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=958/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Sun Sep 1 20:45:24 2024
Linux 13038 1 1 40428 0 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
This partition ends after the disk limits. (start=26701856, size=56094720, end=82796575, disk end=57149440)

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=958/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Sun Sep 1 20:45:24 2024
Linux 13046 2 1 40436 1 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
This partition ends after the disk limits. (start=26718272, size=56094720, end=82812991, disk end=57149440)

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=958/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Sun Sep 1 20:45:24 2024
Linux 13053 0 1 40442 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
This partition ends after the disk limits. (start=26732544, size=56094720, end=82827263, disk end=57149440)

block_group_nr 125

recover_EXT2: "e2fsck -b 4096000 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=125/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB
Disk /dev/nvme1n1 - 29 GB / 27 GiB - CHS 27905 64 32
Check the harddisk size: HD jumper settings, BIOS detection...
The harddisk (29 GB / 27 GiB) seems too small! (< 42 GB / 39 GiB)
The following partitions can't be recovered:
Linux 13004 1 1 40394 0 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
Linux 13012 1 1 40402 0 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
Linux 13021 2 1 40411 1 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
Linux 13023 2 1 40413 1 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
Linux 13038 1 1 40428 0 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
Linux 13046 2 1 40436 1 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
Linux 13053 0 1 40442 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
get_geometry_from_list_part_aux head=64 nbr=7
get_geometry_from_list_part_aux head=8 nbr=8
get_geometry_from_list_part_aux head=16 nbr=7
get_geometry_from_list_part_aux head=32 nbr=7
get_geometry_from_list_part_aux head=64 nbr=7
get_geometry_from_list_part_aux head=128 nbr=3
get_geometry_from_list_part_aux head=255 nbr=1
Warning: the current number of heads per cylinder is 64 but the correct value may be 8.

Results
FAT32 1 0 1 512 63 32 1048576 [EFI System Partition] [NO NAME]
FAT32, blocksize=4096, 536 MB / 512 MiB
Linux 1 0 1 27904 63 32 57147392 [root]
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 29 GB / 27 GiB
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB, 28 GB / 26 GiB
Linux Swap 650 0 1 1920 63 32 2603008
SWAP2 version 1, pagesize=4096, 1332 MB / 1271 MiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 1048576 linear /dev/nvme1n1 2048" | dmsetup create test0
echo "0 57147392 linear /dev/nvme1n1 2048" | dmsetup create test1
echo "0 56094720 linear /dev/nvme1n1 1052672" | dmsetup create test2
echo "0 2603008 linear /dev/nvme1n1 1331200" | dmsetup create test3
jerry@jerry-Inspiron-7506-2n1:~$
jerry@jerry-Inspiron-7506-2n1:~$
jerry@jerry-Inspiron-7506-2n1:~$ cat testdisk.log


Tue Sep 3 21:20:34 2024
Command line: TestDisk

TestDisk 7.1, Data Recovery Utility, July 2019
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org
OS: Linux, kernel 6.8.0-40-generic (#40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:30:19 UTC 2) 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
User is not root!
Hard disk list


TestDisk exited normally.
Using locale 'en_US.UTF-8'.


Tue Sep 3 21:20:41 2024
Command line: TestDisk /debug

TestDisk 7.1, Data Recovery Utility, July 2019
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org
OS: Linux, kernel 6.8.0-40-generic (#40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:30:19 UTC 2) 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
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/loop17 - 0 B - 0 sectors, sector size=512
Hard disk list
Disk /dev/loop0 - 69 KB / 68 KiB - 136 sectors (RO), sector size=512
Disk /dev/loop1 - 4096 B - 8 sectors (RO), sector size=512
Disk /dev/loop10 - 529 MB / 505 MiB - 1034424 sectors (RO), sector size=512
Disk /dev/loop11 - 96 MB / 91 MiB - 187776 sectors (RO), sector size=512
Disk /dev/loop12 - 13 MB / 12 MiB - 26472 sectors (RO), sector size=512
Disk /dev/loop13 - 40 MB / 38 MiB - 79520 sectors (RO), sector size=512
Disk /dev/loop14 - 512 KB / 500 KiB - 1000 sectors (RO), sector size=512
Disk /dev/loop15 - 338 MB / 322 MiB - 661400 sectors (RO), sector size=512
Disk /dev/loop16 - 364 MB / 347 MiB - 710976 sectors (RO), sector size=512
Disk /dev/loop2 - 10 MB / 10 MiB - 20648 sectors (RO), sector size=512
Disk /dev/loop3 - 109 MB / 104 MiB - 213384 sectors (RO), sector size=512
Disk /dev/loop4 - 58 MB / 55 MiB - 113992 sectors (RO), sector size=512
Disk /dev/loop5 - 67 MB / 63 MiB - 130960 sectors (RO), sector size=512
Disk /dev/loop6 - 77 MB / 74 MiB - 152112 sectors (RO), sector size=512
Disk /dev/loop7 - 282 MB / 269 MiB - 552488 sectors (RO), sector size=512
Disk /dev/loop8 - 172 MB / 164 MiB - 337560 sectors (RO), sector size=512
Disk /dev/loop9 - 366 MB / 349 MiB - 716176 sectors (RO), sector size=512
Disk /dev/nvme0n1 - 1024 GB / 953 GiB - CHS 976762 64 32, sector size=512
Disk /dev/nvme1n1 - 29 GB / 27 GiB - CHS 27905 64 32, sector size=512

Partition table type (auto): Intel
Disk /dev/nvme1n1 - 29 GB / 27 GiB
Partition table type: Intel

Analyse Disk /dev/nvme1n1 - 29 GB / 27 GiB - CHS 27905 64 32
Geometry from i386 MBR: head=255 sector=36
BAD_RS LBA=2048 1056
FAT32 at 1/0/1
Info: size boot_sector 1048576, partition 1048576
FAT1 : 6158-7174
FAT2 : 7175-8191
start_rootdir : 8192 root cluster : 2
Data : 8192-1048575
sectors : 1048576
cluster_size : 8
no_of_cluster : 130048 (2 - 130049)
fat_length 1017 calculated 1017
heads/cylinder 255 (FAT) != 64 (HD)
sect/track 63 (FAT) != 32 (HD)
set_FAT_info: name from BS used
BAD_RS LBA=1052670 2103233
BAD_RS LBA=1052672 2103233
get_geometry_from_list_part_aux head=64 nbr=4
get_geometry_from_list_part_aux head=8 nbr=4
get_geometry_from_list_part_aux head=16 nbr=4
get_geometry_from_list_part_aux head=32 nbr=4
get_geometry_from_list_part_aux head=64 nbr=4
get_geometry_from_list_part_aux head=128 nbr=2
get_geometry_from_list_part_aux head=255 nbr=1
Current partition structure:
Warning: number of heads/cylinder mismatches 255 (FAT) != 64 (HD)
Warning: number of sectors per track mismatches 63 (FAT) != 32 (HD)
1 P FAT32 LBA 1 0 1 512 63 32 1048576 [NO NAME]

Warning: Bad starting sector (CHS and LBA don't match)
2 E extended 513 63 31 27903 63 32 56094722

Warning: Bad starting head (CHS and LBA don't match)
No partition is bootable
Logical partition must not be bootable
5 L Linux 514 0 1 27903 63 32 56094720

Warning: Bad starting head (CHS and LBA don't match)

search_part()
Disk /dev/nvme1n1 - 29 GB / 27 GiB - CHS 27905 64 32
FAT32 at 1/0/1
FAT1 : 6158-7174
FAT2 : 7175-8191
start_rootdir : 8192 root cluster : 2
Data : 8192-1048575
sectors : 1048576
cluster_size : 8
no_of_cluster : 130048 (2 - 130049)
fat_length 1017 calculated 1017
heads/cylinder 255 (FAT) != 64 (HD)
sect/track 63 (FAT) != 32 (HD)
set_FAT_info: name from BS used

FAT32 at 1/0/1
FAT: cluster=2(0x2), pos=10240
FAT32 1 0 1 512 63 32 1048576 [EFI System Partition] [NO NAME]
FAT32, blocksize=4096, 536 MB / 512 MiB

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=963/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Mon Sep 2 11:05:45 2024
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB, 28 GB / 26 GiB
get_geometry_from_list_part_aux head=64 nbr=4
get_geometry_from_list_part_aux head=8 nbr=4
get_geometry_from_list_part_aux head=16 nbr=4
get_geometry_from_list_part_aux head=32 nbr=4
get_geometry_from_list_part_aux head=64 nbr=4
get_geometry_from_list_part_aux head=128 nbr=2
get_geometry_from_list_part_aux head=255 nbr=1

Results
* FAT32 1 0 1 512 63 32 1048576 [EFI System Partition] [NO NAME]
FAT32, blocksize=4096, 536 MB / 512 MiB
P Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB, 28 GB / 26 GiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 1048576 linear /dev/nvme1n1 2048" | dmsetup create test0
echo "0 56094720 linear /dev/nvme1n1 1052672" | dmsetup create test1

interface_write()
1 * FAT32 1 0 1 512 63 32 1048576 [EFI System Partition] [NO NAME]
2 P Linux 514 0 1 27903 63 32 56094720

search_part()
Disk /dev/nvme1n1 - 29 GB / 27 GiB - CHS 27905 64 32
FAT32 at 1/0/1
FAT1 : 6158-7174
FAT2 : 7175-8191
start_rootdir : 8192 root cluster : 2
Data : 8192-1048575
sectors : 1048576
cluster_size : 8
no_of_cluster : 130048 (2 - 130049)
fat_length 1017 calculated 1017
heads/cylinder 255 (FAT) != 64 (HD)
sect/track 63 (FAT) != 32 (HD)
set_FAT_info: name from BS used

FAT32 at 1/0/1
FAT: cluster=2(0x2), pos=10240
FAT32 1 0 1 512 63 32 1048576 [EFI System Partition] [NO NAME]
FAT32, blocksize=4096, 536 MB / 512 MiB
FAT32 at 1/0/7
FAT1 : 6158-7174
FAT2 : 7175-8191
start_rootdir : 8192 root cluster : 2
Data : 8192-1048575
sectors : 1048576
cluster_size : 8
no_of_cluster : 130048 (2 - 130049)
fat_length 1017 calculated 1017
heads/cylinder 255 (FAT) != 64 (HD)
sect/track 63 (FAT) != 32 (HD)
set_FAT_info: name from BS used

FAT32 at 1/0/7
FAT: cluster=2(0x2), pos=10240
FAT32 1 0 1 512 63 32 1048576 [EFI System Partition] [NO NAME]
FAT32, blocksize=4096, 536 MB / 512 MiB

block_group_nr 1

recover_EXT2: "e2fsck -b 32768 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=1/218, 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 7143424
recover_EXT2: part_size 57147392
Filesystem created: Sun Dec 20 19:07:38 2020
Linux 1 0 1 27904 63 32 57147392 [root]
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 29 GB / 27 GiB

block_group_nr 3

recover_EXT2: "e2fsck -b 98304 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=3/218, 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 7143424
recover_EXT2: part_size 57147392
Filesystem created: Sun Dec 20 19:07:38 2020
Linux 1 0 1 27904 63 32 57147392 [root]
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 29 GB / 27 GiB

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=963/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Mon Sep 2 11:05:45 2024
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB, 28 GB / 26 GiB

block_group_nr 1

recover_EXT2: "e2fsck -b 32768 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=1/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB
Linux Swap 650 0 1 1920 7 16 2601200
SWAP2 version 1, pagesize=4096, 1331 MB / 1270 MiB

block_group_nr 3

recover_EXT2: "e2fsck -b 98304 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=3/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

block_group_nr 5

recover_EXT2: "e2fsck -b 163840 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=5/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

block_group_nr 7

recover_EXT2: "e2fsck -b 229376 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=7/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

block_group_nr 9

recover_EXT2: "e2fsck -b 294912 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=9/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

block_group_nr 25

recover_EXT2: "e2fsck -b 819200 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=25/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

block_group_nr 27

recover_EXT2: "e2fsck -b 884736 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=27/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

block_group_nr 49

recover_EXT2: "e2fsck -b 1605632 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=49/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

block_group_nr 81

recover_EXT2: "e2fsck -b 2654208 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=81/213, 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 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Linux 514 0 1 27903 63 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Backup_SB, 28 GB / 26 GiB

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=958/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Sun Sep 1 20:45:24 2024
Linux 13004 1 1 40394 0 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
This partition ends after the disk limits. (start=26632224, size=56094720, end=82726943, disk end=57149440)

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=958/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Sun Sep 1 20:45:24 2024
Linux 13012 1 1 40402 0 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
This partition ends after the disk limits. (start=26648608, size=56094720, end=82743327, disk end=57149440)

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=958/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Sun Sep 1 20:45:24 2024
Linux 13021 2 1 40411 1 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
This partition ends after the disk limits. (start=26667072, size=56094720, end=82761791, disk end=57149440)

recover_EXT2: s_block_group_nr=0/213, s_mnt_count=958/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 7011840
recover_EXT2: part_size 56094720
Filesystem created: Mon Mar 1 20:51:13 2021
Last mount time: Sun Sep 1 20:45:24 2024
Linux 13023 2 1 40413 1 32 56094720
ext4 blocksize=4096 Large_file Sparse_SB Recover, 28 GB / 26 GiB
recuperation
Posts: 2902
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: ubuntu /home dir deleted / testdisk.log

#2 Post by recuperation »

bobo2019 wrote: 04 Sep 2024, 20:38 Hello,

I am running a dual boot W11Home / Ubuntu 22.04 Dell Inspiron 2n1 laptop system.

I inadvertently ran the command " rm -f /home "and in doing so it seems have lost my home directory.

I found testdisk online and installed it on my linux partition. I ran testdisk and have attached the log.

It is very long however I am sure you are expert a scanning it's contents. I appreciate in advance your reply.
I cross-read your logfile and I think it is a very beautiful one!

The home directory lived on an ext4 about 30gb partition.

Using testdisk I have attempted and had some success copying lost files and directories however during the copy process of the home directory
I run out of memory and have to abort the copy process. I was thinking of enlarging the partition if that would not impact recovery of home directory.
When you are talking about memory I think about RAM. Your following sentence suggests that you are lacking disk space. Please be a little bit more precise in your wording. Although the reddish box in the forum does not mention it, your posting should contain a question.
There is no support for your TestDisk version. It is outdated.
User avatar
cgrenier
Site Admin
Posts: 5438
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: ubuntu /home dir deleted / testdisk.log

#3 Post by cgrenier »

It's not possible to recover the original filenames and file structure but it may be possible to recover most of your files anyway.
TestDisk may be able to display some filenames but the filesize of deleted file will be listed as 0.
Use PhotoRec to recover your files from the free space of your partition. Be careful to store the recovered files on another partition with enough disk space.
Post Reply