Writed wrong partition at wrong sector start, would like to go back..

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
Dragomitch
Posts: 2
Joined: 08 Jun 2022, 17:47

Writed wrong partition at wrong sector start, would like to go back..

#1 Post by Dragomitch »

Hello there !

First of all, I've seen that recuperation is the most active user on there in question of helping others. For that, bigg kuddos mate !

I've a problem about 2 disks... The second one that I caused stupidly. First one that has sectors and harware problems that I'm trying to retrieve all the files for a friend.
Doing so, I started by trying to testdisk it, see if it was not only a problem of partitions or something that testdisk could fix fast.... Which was not ( as said above ) it is really a hardware problem. So I wanted to dd it as a backup first ( and finished by doing it through ddrescue because dd had also problems).
There, I did a mistake when specifying the end destination folder ... And ended "trying" to restore it to /dev/sdd/ which I cancelled quiet instantly realizing the mistake. Nonetheless, it did make the drive on which I was doing the copy corrupt ( or at least the FS table ).

So I did the ddrescue on another disk, because I knew it will take time etc etc. Long story short, now, I would like to fix it.

So stupidly skipped the backup part for my own disk, so I dont have any about that. But I've the logs where we have the correct description about the FS and was able to see the files also. There is the log of that:

Code: Select all

Disk /dev/sdd - 1000 GB / 931 GiB - WD My Passport 0820
Partition table type: EFI GPT

Analyse Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953458175 (expected 1953458175)
hdr_lba_start=34
hdr_lba_end=1953458142
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
Current partition structure:
 1 P MS Data                     2048 1953456127 1953454080 [Elements SE]

search_part()
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
NTFS at 121597/37/40
filesystem size           1953456128
sectors_per_cluster       8
mft_lcn                   786432
mftmirr_lcn               122091007
clusters_per_mft_record   -10
clusters_per_index_record 1
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB

Results
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 1953454080 linear /dev/sdd 2048" | dmsetup create test0
echo "0 1953456128 linear /dev/sdd 2048" | dmsetup create test1
ntfs_device_testdisk_io_ioctl() unimplemented


dir_partition inode=5
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB
Directory /
       5 dr-xr-xr-x     0      0         0 31-May-2022 13:37 .
       5 dr-xr-xr-x     0      0         0 31-May-2022 13:37 ..
    2895 dr-xr-xr-x     0      0         0 12-Jan-2022 09:13 $RECYCLE.BIN
   75150 dr-xr-xr-x     0      0         0 29-Jul-2016 12:16 .minidlna
      45 dr-xr-xr-x     0      0         0 13-May-2022 04:00 Formations
      64 dr-xr-xr-x     0      0         0 31-May-2022 13:42 SaveOldDDCaroline
      27 dr-xr-xr-x     0      0         0 14-May-2016 10:15 System Volume Information
      44 dr-xr-xr-x     0      0         0 12-Jan-2022 11:34 Videos Surveillance
   84583 dr-xr-xr-x     0      0         0 11-Jul-2017 15:33 msdownld.tmp
   74757 dr-xr-xr-x     0      0         0 12-Jan-2022 11:19 zzz_NewDownloads

dir_partition inode=74757
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB
Directory /zzz_NewDownloads
   74757 dr-xr-xr-x     0      0         0 12-Jan-2022 11:19 .
       5 dr-xr-xr-x     0      0         0 31-May-2022 13:37 ..
   84584 dr-xr-xr-x     0      0         0 25-Sep-2016 09:14 Greys Anatomy
   84132 dr-xr-xr-x     0      0         0  9-May-2020 09:58 Jeux
   86573 dr-xr-xr-x     0      0         0  9-May-2020 09:58 Magazines
   84037 dr-xr-xr-x     0      0         0  9-May-2020 10:13 Musique
   74852 dr-xr-xr-x     0      0         0  9-May-2020 09:55 Naruto
   74864 dr-xr-xr-x     0      0         0  6-Jul-2021 16:34 One Piece
   75070 dr-xr-xr-x     0      0         0 11-Jul-2016 14:56 Sailor Moon Crystal
   85003 dr-xr-xr-x     0      0         0  9-May-2020 09:53 Softwares
   74936 dr-xr-xr-x     0      0         0  4-Aug-2016 10:31 The Big Bang Theory
   74871 dr-xr-xr-x     0      0         0  9-May-2020 09:51 The Flash
   72087 dr-xr-xr-x     0      0         0  9-May-2020 10:00 TorrentFiles
So I've attempted to repair and write the partition back... Which I failed because I probably make it start at 0 instead of after the 2048 bytes .... ( MBR, or alike structure, I presume?)

There's the log of that:

Code: Select all

Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
NTFS at 121597/37/40
filesystem size           1953456128
sectors_per_cluster       8
mft_lcn                   786432
mftmirr_lcn               122091007
clusters_per_mft_record   -10
clusters_per_index_record 1
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB

Results
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 1953454080 linear /dev/sdd 2048" | dmsetup create test0
echo "0 1953456128 linear /dev/sdd 2048" | dmsetup create test1
       0 0000 0000 00 00 00 00 00 00 00 00
       0 0000 0000 00 00 00 00 00 00 00 00
Can't open backup.log file: No such file or directory
interface_load

interface_write()
 1 P MS Data                     2048 1953458175 1953456128 [My Passport]
write!
No extended partition

ntfs_boot_sector
 1 P MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB
filesystem size           1 35
sectors_per_cluster       0 0
mft_lcn                   0 1953458142
mftmirr_lcn               0 5010996442594911293
clusters_per_mft_record   0 -107
clusters_per_index_record 0 123
Boot sector
Status: Bad

Backup boot sector
Status: Bad

Sectors are not identical.

A valid NTFS Boot sector must be present in order to access
any data; even if the partition is not bootable.
You will have to reboot for the change to take effect.

TestDisk exited normally.

There, I retried because I didn't understood why it was in a bad status since that operation ...
I'll just post the entire log there (including the past 2 parts) :

Code: Select all



Thu Jun  2 19:51:59 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.17.5-76051705-generic (#202204271406~1653440576~22.04~6277a18 SMP PREEMPT Wed May 25 01) 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       468877312 sectors
/dev/sda: user_max   468877312 sectors
/dev/sda: native_max 468877312 sectors
/dev/sdb: LBA, HPA, LBA48, DCO support
/dev/sdb: size       3907029168 sectors
/dev/sdb: user_max   3907029168 sectors
/dev/sdb: native_max 3907029168 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/loop1 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop2 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop3 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop4 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop5 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop6 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop7 - 0 B - 0 sectors, sector size=512
Hard disk list
Disk /dev/sda - 240 GB / 223 GiB - CHS 29186 255 63, sector size=512 - SanDisk SSD PLUS 240 GB, S/N:174302803264, FW:UF3000RL
Disk /dev/sdb - 2000 GB / 1863 GiB - CHS 243201 255 63, sector size=512 - ST2000DL001-9VT156, S/N:5YD0WF5P, FW:CC41
Disk /dev/sdc - 248 GB / 231 GiB - CHS 30159 255 63, sector size=512, FW:PMAP
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63, sector size=512 - WD My Passport 0820, FW:1007
Disk /dev/sde - 4000 GB / 3725 GiB - CHS 3815415 64 32, sector size=512 - WD Elements 25A3, FW:1021
Disk /dev/loop0 - 3167 MB / 3020 MiB - 6186728 sectors (RO), sector size=512
Disk /dev/nvme0n1 - 2000 GB / 1863 GiB - CHS 1907729 64 32, sector size=512
Disk /dev/nvme1n1 - 1000 GB / 931 GiB - CHS 953869 64 32, sector size=512

Partition table type (auto): EFI GPT
Disk /dev/sdd - 1000 GB / 931 GiB - WD My Passport 0820
Partition table type: EFI GPT

Analyse Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953458175 (expected 1953458175)
hdr_lba_start=34
hdr_lba_end=1953458142
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
Current partition structure:
 1 P MS Data                     2048 1953456127 1953454080 [Elements SE]

search_part()
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
NTFS at 121597/37/40
filesystem size           1953456128
sectors_per_cluster       8
mft_lcn                   786432
mftmirr_lcn               122091007
clusters_per_mft_record   -10
clusters_per_index_record 1
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB

Results
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 1953454080 linear /dev/sdd 2048" | dmsetup create test0
echo "0 1953456128 linear /dev/sdd 2048" | dmsetup create test1
ntfs_device_testdisk_io_ioctl() unimplemented


dir_partition inode=5
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB
Directory /
       5 dr-xr-xr-x     0      0         0 31-May-2022 13:37 .
       5 dr-xr-xr-x     0      0         0 31-May-2022 13:37 ..
    2895 dr-xr-xr-x     0      0         0 12-Jan-2022 09:13 $RECYCLE.BIN
   75150 dr-xr-xr-x     0      0         0 29-Jul-2016 12:16 .minidlna
      45 dr-xr-xr-x     0      0         0 13-May-2022 04:00 Formations
      64 dr-xr-xr-x     0      0         0 31-May-2022 13:42 SaveOldDDCaroline
      27 dr-xr-xr-x     0      0         0 14-May-2016 10:15 System Volume Information
      44 dr-xr-xr-x     0      0         0 12-Jan-2022 11:34 Videos Surveillance
   84583 dr-xr-xr-x     0      0         0 11-Jul-2017 15:33 msdownld.tmp
   74757 dr-xr-xr-x     0      0         0 12-Jan-2022 11:19 zzz_NewDownloads

dir_partition inode=74757
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB
Directory /zzz_NewDownloads
   74757 dr-xr-xr-x     0      0         0 12-Jan-2022 11:19 .
       5 dr-xr-xr-x     0      0         0 31-May-2022 13:37 ..
   84584 dr-xr-xr-x     0      0         0 25-Sep-2016 09:14 Greys Anatomy
   84132 dr-xr-xr-x     0      0         0  9-May-2020 09:58 Jeux
   86573 dr-xr-xr-x     0      0         0  9-May-2020 09:58 Magazines
   84037 dr-xr-xr-x     0      0         0  9-May-2020 10:13 Musique
   74852 dr-xr-xr-x     0      0         0  9-May-2020 09:55 Naruto
   74864 dr-xr-xr-x     0      0         0  6-Jul-2021 16:34 One Piece
   75070 dr-xr-xr-x     0      0         0 11-Jul-2016 14:56 Sailor Moon Crystal
   85003 dr-xr-xr-x     0      0         0  9-May-2020 09:53 Softwares
   74936 dr-xr-xr-x     0      0         0  4-Aug-2016 10:31 The Big Bang Theory
   74871 dr-xr-xr-x     0      0         0  9-May-2020 09:51 The Flash
   72087 dr-xr-xr-x     0      0         0  9-May-2020 10:00 TorrentFiles
   72346 dr-xr-xr-x     0      0         0  9-May-2020 10:24 XxX
Directory /
       5 dr-xr-xr-x     0      0         0 31-May-2022 13:37 .
       5 dr-xr-xr-x     0      0         0 31-May-2022 13:37 ..
    2895 dr-xr-xr-x     0      0         0 12-Jan-2022 09:13 $RECYCLE.BIN
   75150 dr-xr-xr-x     0      0         0 29-Jul-2016 12:16 .minidlna
      45 dr-xr-xr-x     0      0         0 13-May-2022 04:00 Formations
      64 dr-xr-xr-x     0      0         0 31-May-2022 13:42 SaveOldDDCaroline
      27 dr-xr-xr-x     0      0         0 14-May-2016 10:15 System Volume Information
      44 dr-xr-xr-x     0      0         0 12-Jan-2022 11:34 Videos Surveillance
   84583 dr-xr-xr-x     0      0         0 11-Jul-2017 15:33 msdownld.tmp
   74757 dr-xr-xr-x     0      0         0 12-Jan-2022 11:19 zzz_NewDownloads
ntfs_device_testdisk_io_ioctl() unimplemented


dir_partition inode=5
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB
Directory /
       5 dr-xr-xr-x     0      0         0 31-May-2022 13:37 .
       5 dr-xr-xr-x     0      0         0 31-May-2022 13:37 ..
    2895 dr-xr-xr-x     0      0         0 12-Jan-2022 09:13 $RECYCLE.BIN
   75150 dr-xr-xr-x     0      0         0 29-Jul-2016 12:16 .minidlna
      45 dr-xr-xr-x     0      0         0 13-May-2022 04:00 Formations
      64 dr-xr-xr-x     0      0         0 31-May-2022 13:42 SaveOldDDCaroline
      27 dr-xr-xr-x     0      0         0 14-May-2016 10:15 System Volume Information
      44 dr-xr-xr-x     0      0         0 12-Jan-2022 11:34 Videos Surveillance
   84583 dr-xr-xr-x     0      0         0 11-Jul-2017 15:33 msdownld.tmp
   74757 dr-xr-xr-x     0      0         0 12-Jan-2022 11:19 zzz_NewDownloads
Can't open backup.log file: No such file or directory
interface_load
       0 0000 0000 00 00 00 00 00 00 00 00
gpt_change_part_type
       0 0000 0000 00 00 00 00 00 00 00 00
Change partition type:
     EFI System                     1 1953458175 1953458175
Change partition type:
     Unknown                        1 1953458175 1953458175

interface_write()
 1 P EFI System                     1 1953458175 1953458175
simulate write!

Analyse Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953458175 (expected 1953458175)
hdr_lba_start=34
hdr_lba_end=1953458142
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
Current partition structure:
 1 P MS Data                     2048 1953456127 1953454080 [Elements SE]

search_part()
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
NTFS at 121597/37/40
filesystem size           1953456128
sectors_per_cluster       8
mft_lcn                   786432
mftmirr_lcn               122091007
clusters_per_mft_record   -10
clusters_per_index_record 1
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB

Results
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 1953454080 linear /dev/sdd 2048" | dmsetup create test0
echo "0 1953456128 linear /dev/sdd 2048" | dmsetup create test1
       0 0000 0000 00 00 00 00 00 00 00 00
       0 0000 0000 00 00 00 00 00 00 00 00
Can't open backup.log file: No such file or directory
interface_load

interface_write()
 1 P MS Data                     2048 1953458175 1953456128 [My Passport]
write!
No extended partition

ntfs_boot_sector
 1 P MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB
filesystem size           1 35
sectors_per_cluster       0 0
mft_lcn                   0 1953458142
mftmirr_lcn               0 5010996442594911293
clusters_per_mft_record   0 -107
clusters_per_index_record 0 123
Boot sector
Status: Bad

Backup boot sector
Status: Bad

Sectors are not identical.

A valid NTFS Boot sector must be present in order to access
any data; even if the partition is not bootable.
You will have to reboot for the change to take effect.

TestDisk exited normally.


Thu Jun  2 20:01:51 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.17.5-76051705-generic (#202204271406~1653440576~22.04~6277a18 SMP PREEMPT Wed May 25 01) 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       468877312 sectors
/dev/sda: user_max   468877312 sectors
/dev/sda: native_max 468877312 sectors
/dev/sdb: LBA, HPA, LBA48, DCO support
/dev/sdb: size       3907029168 sectors
/dev/sdb: user_max   3907029168 sectors
/dev/sdb: native_max 3907029168 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/loop1 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop2 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop3 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop4 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop5 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop6 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop7 - 0 B - 0 sectors, sector size=512
Hard disk list
Disk /dev/sda - 240 GB / 223 GiB - CHS 29186 255 63, sector size=512 - SanDisk SSD PLUS 240 GB, S/N:174302803264, FW:UF3000RL
Disk /dev/sdb - 2000 GB / 1863 GiB - CHS 243201 255 63, sector size=512 - ST2000DL001-9VT156, S/N:5YD0WF5P, FW:CC41
Disk /dev/sdc - 248 GB / 231 GiB - CHS 30159 255 63, sector size=512, FW:PMAP
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63, sector size=512 - WD My Passport 0820, FW:1007
Disk /dev/sde - 4000 GB / 3725 GiB - CHS 3815415 64 32, sector size=512 - WD Elements 25A3, FW:1021
Disk /dev/loop0 - 3167 MB / 3020 MiB - 6186728 sectors (RO), sector size=512
Disk /dev/nvme0n1 - 2000 GB / 1863 GiB - CHS 1907729 64 32, sector size=512
Disk /dev/nvme1n1 - 1000 GB / 931 GiB - CHS 953869 64 32, sector size=512

Partition table type (auto): EFI GPT
Disk /dev/sdd - 1000 GB / 931 GiB - WD My Passport 0820
Partition table type: EFI GPT

Analyse Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953458175 (expected 1953458175)
hdr_lba_start=34
hdr_lba_end=1953458142
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
Current partition structure:
 1 P MS Data                     2048 1953458175 1953456128

search_part()
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB

Results
   P MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB

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


dir_partition inode=0
   P MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
Directory /

interface_write()
 1 P MS Data                     2048 1953456127 1953454080


dir_partition inode=0
   P MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
Directory /

interface_write()
 1 P MS Data                     2048 1953456127 1953454080

search_part()
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
     MS Data                     2048 1953456127 1953454080
     exFAT found using backup sector, blocksize=262144, 1000 GB / 931 GiB
     MS Data                     2048 1953456127 1953454080
     exFAT found using backup sector, blocksize=262144, 1000 GB / 931 GiB
Search for partition aborted

Results
   P MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB

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

interface_write()
 1 P MS Data                     2048 1953456127 1953454080
simulate write!

Analyse Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953458175 (expected 1953458175)
hdr_lba_start=34
hdr_lba_end=1953458142
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
Current partition structure:
 1 P MS Data                     2048 1953458175 1953456128

search_part()
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB

Results
   P MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 1953454080 linear /dev/sdd 2048" | dmsetup create test0
       0 0000 0000 00 00 00 00 00 00 00 00
gpt_change_part_type
       0 0000 0000 00 00 00 00 00 00 00 00
Change partition type:
     MS Data                        1 1953458175 1953458175
Change partition type:
     exFAT                          1 1953458175 1953458175
SIGINT detected! TestDisk has been killed.


Thu Jun  2 20:06:11 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.17.5-76051705-generic (#202204271406~1653440576~22.04~6277a18 SMP PREEMPT Wed May 25 01) 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       468877312 sectors
/dev/sda: user_max   468877312 sectors
/dev/sda: native_max 468877312 sectors
/dev/sdb: LBA, HPA, LBA48, DCO support
/dev/sdb: size       3907029168 sectors
/dev/sdb: user_max   3907029168 sectors
/dev/sdb: native_max 3907029168 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/loop1 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop2 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop3 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop4 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop5 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop6 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop7 - 0 B - 0 sectors, sector size=512
Hard disk list
Disk /dev/sda - 240 GB / 223 GiB - CHS 29186 255 63, sector size=512 - SanDisk SSD PLUS 240 GB, S/N:174302803264, FW:UF3000RL
Disk /dev/sdb - 2000 GB / 1863 GiB - CHS 243201 255 63, sector size=512 - ST2000DL001-9VT156, S/N:5YD0WF5P, FW:CC41
Disk /dev/sdc - 248 GB / 231 GiB - CHS 30159 255 63, sector size=512, FW:PMAP
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63, sector size=512 - WD My Passport 0820, FW:1007
Disk /dev/sde - 4000 GB / 3725 GiB - CHS 3815415 64 32, sector size=512 - WD Elements 25A3, FW:1021
Disk /dev/loop0 - 3167 MB / 3020 MiB - 6186728 sectors (RO), sector size=512
Disk /dev/nvme0n1 - 2000 GB / 1863 GiB - CHS 1907729 64 32, sector size=512
Disk /dev/nvme1n1 - 1000 GB / 931 GiB - CHS 953869 64 32, sector size=512

Partition table type (auto): EFI GPT
Disk /dev/sdd - 1000 GB / 931 GiB - WD My Passport 0820
Partition table type: EFI GPT
New options :
 Dump : No
 Align partition: Yes
 Expert mode : No

Interface Advanced
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953458175 (expected 1953458175)
hdr_lba_start=34
hdr_lba_end=1953458142
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
 1 P MS Data                     2048 1953458175 1953456128
     exFAT, blocksize=262144, 1000 GB / 931 GiB


dir_partition inode=0
 1 P MS Data                     2048 1953458175 1953456128
     exFAT, blocksize=262144, 1000 GB / 931 GiB
Directory /

exFAT_boot_sector
 1 P MS Data                     2048 1953458175 1953456128
     exFAT, blocksize=262144, 1000 GB / 931 GiB
Boot sector
exFAT OK

Backup boot record
exFAT OK

Sectors are not identical.

Analyse Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953458175 (expected 1953458175)
hdr_lba_start=34
hdr_lba_end=1953458142
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
Current partition structure:
 1 P MS Data                     2048 1953458175 1953456128

search_part()
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB

Results
   P MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 1953454080 linear /dev/sdd 2048" | dmsetup create test0
Can't open backup.log file: No such file or directory
interface_load


dir_partition inode=0
   P MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
Directory /
       0 0000 0000 00 00 00 00 00 00 00 00
gpt_change_part_type
       0 0000 0000 00 00 00 00 00 00 00 00
Change partition type:
     MS Data                        1 1953458175 1953458175
Change partition type:
     exFAT                          1 1953458175 1953458175
gpt_change_part_type
Change partition type:
   P EFI System                  2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
Change partition type:
   P ext2                        2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
Invalid partition structure.

TestDisk exited normally.


Thu Jun  2 20:14:50 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.17.5-76051705-generic (#202204271406~1653440576~22.04~6277a18 SMP PREEMPT Wed May 25 01) 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       468877312 sectors
/dev/sda: user_max   468877312 sectors
/dev/sda: native_max 468877312 sectors
/dev/sdb: LBA, HPA, LBA48, DCO support
/dev/sdb: size       3907029168 sectors
/dev/sdb: user_max   3907029168 sectors
/dev/sdb: native_max 3907029168 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/loop1 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop2 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop3 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop4 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop5 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop6 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop7 - 0 B - 0 sectors, sector size=512
Hard disk list
Disk /dev/sda - 240 GB / 223 GiB - CHS 29186 255 63, sector size=512 - SanDisk SSD PLUS 240 GB, S/N:174302803264, FW:UF3000RL
Disk /dev/sdb - 2000 GB / 1863 GiB - CHS 243201 255 63, sector size=512 - ST2000DL001-9VT156, S/N:5YD0WF5P, FW:CC41
Disk /dev/sdc - 248 GB / 231 GiB - CHS 30159 255 63, sector size=512, FW:PMAP
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63, sector size=512 - WD My Passport 0820, FW:1007
Disk /dev/sde - 4000 GB / 3725 GiB - CHS 3815415 64 32, sector size=512 - WD Elements 25A3, FW:1021
Disk /dev/loop0 - 3167 MB / 3020 MiB - 6186728 sectors (RO), sector size=512
Disk /dev/nvme0n1 - 2000 GB / 1863 GiB - CHS 1907729 64 32, sector size=512
Disk /dev/nvme1n1 - 1000 GB / 931 GiB - CHS 953869 64 32, sector size=512

Partition table type (auto): EFI GPT
Disk /dev/sdd - 1000 GB / 931 GiB - WD My Passport 0820
Partition table type: EFI GPT

Analyse Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953458175 (expected 1953458175)
hdr_lba_start=34
hdr_lba_end=1953458142
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
Current partition structure:
 1 P MS Data                     2048 1953458175 1953456128

search_part()
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB

Results
   P MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 1953454080 linear /dev/sdd 2048" | dmsetup create test0
The end state is looking like that:

Code: Select all

NTFS signature is missing.
NTFS signature is missing.
       0 0000 0000 00 00 00 00 00 00 00 00
       0 0000 0000 00 00 00 00 00 00 00 00
       0 0000 0000 00 00 00 00 00 00 00 00
gpt_change_part_type
       0 0000 0000 00 00 00 00 00 00 00 00
Change partition type:
     MS Data                     2048 1953456127 1953454080
Change partition type:
     exFAT                       2048 1953456127 1953454080


dir_partition inode=0
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
Directory /


dir_partition inode=0
   P MS Data                     2048 1953456127 1953454080
Directory /
       0 0000 0000 00 00 00 00 00 00 00 00
       0 0000 0000 00 00 00 00 00 00 00 00
       0 0000 0000 00 00 00 00 00 00 00 00
gpt_change_part_type
       0 0000 0000 00 00 00 00 00 00 00 00
Change partition type:
     MS Data                     2048 1953458175 1953456128
Change partition type:
     NTFS                        2048 1953458175 1953456128

   P MS Data                     2048 1953458175 1953456128
Can't open filesystem. Filesystem seems damaged.


dir_partition inode=0
   P MS Data                     2048 1953456127 1953454080
Directory /

interface_write()
 1 P MS Data                     2048 1953458175 1953456128

search_part()
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
     MS Data                     2048 1953456127 1953454080
     exFAT found using backup sector, blocksize=262144, 1000 GB / 931 GiB
     MS Data                     2048 1953456127 1953454080
     exFAT found using backup sector, blocksize=262144, 1000 GB / 931 GiB
Search for partition aborted

Results
   P MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 1953454080 linear /dev/sdd 2048" | dmsetup create test0
       0 0000 0000 00 00 00 00 00 00 00 00
       0 0000 0000 00 00 00 00 00 00 00 00
       0 0000 0000 00 00 00 00 00 00 00 00
gpt_change_part_type
       0 0000 0000 00 00 00 00 00 00 00 00
Change partition type:
     MS Data                     2048 1953458175 1953456128
Change partition type:
     exFAT                       2048 1953458175 1953456128

interface_write()
 1 P MS Data                     2048 1953458175 1953456128
write!
No extended partition
You will have to reboot for the change to take effect.

TestDisk exited normally.
I've just did a retrieval of the files through photorec but I still would prefer to have them with their name etc if possible.
Is there anyway to do that?

Thanks for taking the time to read me !

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

Re: Writed wrong partition at wrong sector start, would like to go back..

#2 Post by recuperation »

Would you please be so kind as to replace the gamer-speak abbreviations like "FS" into a name that I and others can understand?
Thank you for using English as a language because the French accents are a pain to reach on a German keyboard.

What is the operating system that was used to read the content of this drive?

Dragomitch
Posts: 2
Joined: 08 Jun 2022, 17:47

Re: Writed wrong partition at wrong sector start, would like to go back..

#3 Post by Dragomitch »

Dragomitch wrote: 08 Jun 2022, 20:13 Hello there !

First of all, I've seen that recuperation is the most active user on there in question of helping others. For that, bigg kuddos mate !

I have a problem about 2 disks.
First one that has sectors and harware problems that I'm trying to retrieve all the files for a friend. Lets call it DISK0
The second one being a mistake I caused stupidly while trying to retrieve the data of the friend. Lets call this one MY_DISK

I started by trying to scan, through testdisk, DISK0, to see if it was not only a problem of partitions or something that testdisk could fix fast and easily.... Which was not the case, as it is really an hardware problem.

So I wanted to use dd to backup DISK0 first ( and finished by doing it through ddrescue because dd had also problems).
There, I did a mistake when specifying the destination folder ... And ended "trying" to restore it to /dev/sdd/ which I cancelled quiet instantly realizing the mistake. Nonetheless, it corrupted the MY_DISK by doing so ( or at least the FileSystem(FS) table ).

So I restarted the ddrescue of DISK0 on another harddrive.

I didn't backup MY_DISK as I didn't expect to erase the content. But I kept the logs of testDisk where we see different information about the FileSystem and was able to see the files also. There is the log of that:

Code: Select all

Disk /dev/sdd - 1000 GB / 931 GiB - WD My Passport 0820
Partition table type: EFI GPT

Analyse Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953458175 (expected 1953458175)
hdr_lba_start=34
hdr_lba_end=1953458142
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
Current partition structure:
 1 P MS Data                     2048 1953456127 1953454080 [Elements SE]

search_part()
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
NTFS at 121597/37/40
filesystem size           1953456128
sectors_per_cluster       8
mft_lcn                   786432
mftmirr_lcn               122091007
clusters_per_mft_record   -10
clusters_per_index_record 1
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB

Results
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 1953454080 linear /dev/sdd 2048" | dmsetup create test0
echo "0 1953456128 linear /dev/sdd 2048" | dmsetup create test1
ntfs_device_testdisk_io_ioctl() unimplemented


dir_partition inode=5
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB
Directory /
       5 dr-xr-xr-x     0      0         0 31-May-2022 13:37 .
       5 dr-xr-xr-x     0      0         0 31-May-2022 13:37 ..
    2895 dr-xr-xr-x     0      0         0 12-Jan-2022 09:13 $RECYCLE.BIN
   75150 dr-xr-xr-x     0      0         0 29-Jul-2016 12:16 .minidlna
      45 dr-xr-xr-x     0      0         0 13-May-2022 04:00 Formations
      64 dr-xr-xr-x     0      0         0 31-May-2022 13:42 SaveOldDDCaroline
      27 dr-xr-xr-x     0      0         0 14-May-2016 10:15 System Volume Information
      44 dr-xr-xr-x     0      0         0 12-Jan-2022 11:34 Videos Surveillance
   84583 dr-xr-xr-x     0      0         0 11-Jul-2017 15:33 msdownld.tmp
   74757 dr-xr-xr-x     0      0         0 12-Jan-2022 11:19 zzz_NewDownloads

dir_partition inode=74757
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB
Directory /zzz_NewDownloads
   74757 dr-xr-xr-x     0      0         0 12-Jan-2022 11:19 .
       5 dr-xr-xr-x     0      0         0 31-May-2022 13:37 ..
   84584 dr-xr-xr-x     0      0         0 25-Sep-2016 09:14 Greys Anatomy
   84132 dr-xr-xr-x     0      0         0  9-May-2020 09:58 Jeux
   86573 dr-xr-xr-x     0      0         0  9-May-2020 09:58 Magazines
   84037 dr-xr-xr-x     0      0         0  9-May-2020 10:13 Musique
   74852 dr-xr-xr-x     0      0         0  9-May-2020 09:55 Naruto
   74864 dr-xr-xr-x     0      0         0  6-Jul-2021 16:34 One Piece
   75070 dr-xr-xr-x     0      0         0 11-Jul-2016 14:56 Sailor Moon Crystal
   85003 dr-xr-xr-x     0      0         0  9-May-2020 09:53 Softwares
   74936 dr-xr-xr-x     0      0         0  4-Aug-2016 10:31 The Big Bang Theory
   74871 dr-xr-xr-x     0      0         0  9-May-2020 09:51 The Flash
   72087 dr-xr-xr-x     0      0         0  9-May-2020 10:00 TorrentFiles
So I've attempted to repair and write the partition back... Which I failed because I probably made it start at 0 instead of after the sector/MasterBootRecord/table of 2048 bytes ?

There is the log of that:

Code: Select all

Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
NTFS at 121597/37/40
filesystem size           1953456128
sectors_per_cluster       8
mft_lcn                   786432
mftmirr_lcn               122091007
clusters_per_mft_record   -10
clusters_per_index_record 1
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB

Results
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 1953454080 linear /dev/sdd 2048" | dmsetup create test0
echo "0 1953456128 linear /dev/sdd 2048" | dmsetup create test1
       0 0000 0000 00 00 00 00 00 00 00 00
       0 0000 0000 00 00 00 00 00 00 00 00
Can't open backup.log file: No such file or directory
interface_load

interface_write()
 1 P MS Data                     2048 1953458175 1953456128 [My Passport]
write!
No extended partition

ntfs_boot_sector
 1 P MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB
filesystem size           1 35
sectors_per_cluster       0 0
mft_lcn                   0 1953458142
mftmirr_lcn               0 5010996442594911293
clusters_per_mft_record   0 -107
clusters_per_index_record 0 123
Boot sector
Status: Bad

Backup boot sector
Status: Bad

Sectors are not identical.

A valid NTFS Boot sector must be present in order to access
any data; even if the partition is not bootable.
You will have to reboot for the change to take effect.

TestDisk exited normally.

There, I retried because I didn't understood why it was in a bad status since that operation ...
I'll just post the entire log there (including the past 2 parts) :

Code: Select all



Thu Jun  2 19:51:59 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.17.5-76051705-generic (#202204271406~1653440576~22.04~6277a18 SMP PREEMPT Wed May 25 01) 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       468877312 sectors
/dev/sda: user_max   468877312 sectors
/dev/sda: native_max 468877312 sectors
/dev/sdb: LBA, HPA, LBA48, DCO support
/dev/sdb: size       3907029168 sectors
/dev/sdb: user_max   3907029168 sectors
/dev/sdb: native_max 3907029168 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/loop1 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop2 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop3 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop4 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop5 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop6 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop7 - 0 B - 0 sectors, sector size=512
Hard disk list
Disk /dev/sda - 240 GB / 223 GiB - CHS 29186 255 63, sector size=512 - SanDisk SSD PLUS 240 GB, S/N:174302803264, FW:UF3000RL
Disk /dev/sdb - 2000 GB / 1863 GiB - CHS 243201 255 63, sector size=512 - ST2000DL001-9VT156, S/N:5YD0WF5P, FW:CC41
Disk /dev/sdc - 248 GB / 231 GiB - CHS 30159 255 63, sector size=512, FW:PMAP
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63, sector size=512 - WD My Passport 0820, FW:1007
Disk /dev/sde - 4000 GB / 3725 GiB - CHS 3815415 64 32, sector size=512 - WD Elements 25A3, FW:1021
Disk /dev/loop0 - 3167 MB / 3020 MiB - 6186728 sectors (RO), sector size=512
Disk /dev/nvme0n1 - 2000 GB / 1863 GiB - CHS 1907729 64 32, sector size=512
Disk /dev/nvme1n1 - 1000 GB / 931 GiB - CHS 953869 64 32, sector size=512

Partition table type (auto): EFI GPT
Disk /dev/sdd - 1000 GB / 931 GiB - WD My Passport 0820
Partition table type: EFI GPT

Analyse Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953458175 (expected 1953458175)
hdr_lba_start=34
hdr_lba_end=1953458142
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
Current partition structure:
 1 P MS Data                     2048 1953456127 1953454080 [Elements SE]

search_part()
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
NTFS at 121597/37/40
filesystem size           1953456128
sectors_per_cluster       8
mft_lcn                   786432
mftmirr_lcn               122091007
clusters_per_mft_record   -10
clusters_per_index_record 1
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB

Results
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 1953454080 linear /dev/sdd 2048" | dmsetup create test0
echo "0 1953456128 linear /dev/sdd 2048" | dmsetup create test1
ntfs_device_testdisk_io_ioctl() unimplemented


dir_partition inode=5
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB
Directory /
       5 dr-xr-xr-x     0      0         0 31-May-2022 13:37 .
       5 dr-xr-xr-x     0      0         0 31-May-2022 13:37 ..
    2895 dr-xr-xr-x     0      0         0 12-Jan-2022 09:13 $RECYCLE.BIN
   75150 dr-xr-xr-x     0      0         0 29-Jul-2016 12:16 .minidlna
      45 dr-xr-xr-x     0      0         0 13-May-2022 04:00 Formations
      64 dr-xr-xr-x     0      0         0 31-May-2022 13:42 SaveOldDDCaroline
      27 dr-xr-xr-x     0      0         0 14-May-2016 10:15 System Volume Information
      44 dr-xr-xr-x     0      0         0 12-Jan-2022 11:34 Videos Surveillance
   84583 dr-xr-xr-x     0      0         0 11-Jul-2017 15:33 msdownld.tmp
   74757 dr-xr-xr-x     0      0         0 12-Jan-2022 11:19 zzz_NewDownloads

dir_partition inode=74757
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB
Directory /zzz_NewDownloads
   74757 dr-xr-xr-x     0      0         0 12-Jan-2022 11:19 .
       5 dr-xr-xr-x     0      0         0 31-May-2022 13:37 ..
   84584 dr-xr-xr-x     0      0         0 25-Sep-2016 09:14 Greys Anatomy
   84132 dr-xr-xr-x     0      0         0  9-May-2020 09:58 Jeux
   86573 dr-xr-xr-x     0      0         0  9-May-2020 09:58 Magazines
   84037 dr-xr-xr-x     0      0         0  9-May-2020 10:13 Musique
   74852 dr-xr-xr-x     0      0         0  9-May-2020 09:55 Naruto
   74864 dr-xr-xr-x     0      0         0  6-Jul-2021 16:34 One Piece
   75070 dr-xr-xr-x     0      0         0 11-Jul-2016 14:56 Sailor Moon Crystal
   85003 dr-xr-xr-x     0      0         0  9-May-2020 09:53 Softwares
   74936 dr-xr-xr-x     0      0         0  4-Aug-2016 10:31 The Big Bang Theory
   74871 dr-xr-xr-x     0      0         0  9-May-2020 09:51 The Flash
   72087 dr-xr-xr-x     0      0         0  9-May-2020 10:00 TorrentFiles
   72346 dr-xr-xr-x     0      0         0  9-May-2020 10:24 XxX
Directory /
       5 dr-xr-xr-x     0      0         0 31-May-2022 13:37 .
       5 dr-xr-xr-x     0      0         0 31-May-2022 13:37 ..
    2895 dr-xr-xr-x     0      0         0 12-Jan-2022 09:13 $RECYCLE.BIN
   75150 dr-xr-xr-x     0      0         0 29-Jul-2016 12:16 .minidlna
      45 dr-xr-xr-x     0      0         0 13-May-2022 04:00 Formations
      64 dr-xr-xr-x     0      0         0 31-May-2022 13:42 SaveOldDDCaroline
      27 dr-xr-xr-x     0      0         0 14-May-2016 10:15 System Volume Information
      44 dr-xr-xr-x     0      0         0 12-Jan-2022 11:34 Videos Surveillance
   84583 dr-xr-xr-x     0      0         0 11-Jul-2017 15:33 msdownld.tmp
   74757 dr-xr-xr-x     0      0         0 12-Jan-2022 11:19 zzz_NewDownloads
ntfs_device_testdisk_io_ioctl() unimplemented


dir_partition inode=5
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB
Directory /
       5 dr-xr-xr-x     0      0         0 31-May-2022 13:37 .
       5 dr-xr-xr-x     0      0         0 31-May-2022 13:37 ..
    2895 dr-xr-xr-x     0      0         0 12-Jan-2022 09:13 $RECYCLE.BIN
   75150 dr-xr-xr-x     0      0         0 29-Jul-2016 12:16 .minidlna
      45 dr-xr-xr-x     0      0         0 13-May-2022 04:00 Formations
      64 dr-xr-xr-x     0      0         0 31-May-2022 13:42 SaveOldDDCaroline
      27 dr-xr-xr-x     0      0         0 14-May-2016 10:15 System Volume Information
      44 dr-xr-xr-x     0      0         0 12-Jan-2022 11:34 Videos Surveillance
   84583 dr-xr-xr-x     0      0         0 11-Jul-2017 15:33 msdownld.tmp
   74757 dr-xr-xr-x     0      0         0 12-Jan-2022 11:19 zzz_NewDownloads
Can't open backup.log file: No such file or directory
interface_load
       0 0000 0000 00 00 00 00 00 00 00 00
gpt_change_part_type
       0 0000 0000 00 00 00 00 00 00 00 00
Change partition type:
     EFI System                     1 1953458175 1953458175
Change partition type:
     Unknown                        1 1953458175 1953458175

interface_write()
 1 P EFI System                     1 1953458175 1953458175
simulate write!

Analyse Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953458175 (expected 1953458175)
hdr_lba_start=34
hdr_lba_end=1953458142
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
Current partition structure:
 1 P MS Data                     2048 1953456127 1953454080 [Elements SE]

search_part()
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
NTFS at 121597/37/40
filesystem size           1953456128
sectors_per_cluster       8
mft_lcn                   786432
mftmirr_lcn               122091007
clusters_per_mft_record   -10
clusters_per_index_record 1
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB

Results
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
     MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 1953454080 linear /dev/sdd 2048" | dmsetup create test0
echo "0 1953456128 linear /dev/sdd 2048" | dmsetup create test1
       0 0000 0000 00 00 00 00 00 00 00 00
       0 0000 0000 00 00 00 00 00 00 00 00
Can't open backup.log file: No such file or directory
interface_load

interface_write()
 1 P MS Data                     2048 1953458175 1953456128 [My Passport]
write!
No extended partition

ntfs_boot_sector
 1 P MS Data                     2048 1953458175 1953456128 [My Passport]
     NTFS found using backup sector, blocksize=4096, 1000 GB / 931 GiB
filesystem size           1 35
sectors_per_cluster       0 0
mft_lcn                   0 1953458142
mftmirr_lcn               0 5010996442594911293
clusters_per_mft_record   0 -107
clusters_per_index_record 0 123
Boot sector
Status: Bad

Backup boot sector
Status: Bad

Sectors are not identical.

A valid NTFS Boot sector must be present in order to access
any data; even if the partition is not bootable.
You will have to reboot for the change to take effect.

TestDisk exited normally.


Thu Jun  2 20:01:51 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.17.5-76051705-generic (#202204271406~1653440576~22.04~6277a18 SMP PREEMPT Wed May 25 01) 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       468877312 sectors
/dev/sda: user_max   468877312 sectors
/dev/sda: native_max 468877312 sectors
/dev/sdb: LBA, HPA, LBA48, DCO support
/dev/sdb: size       3907029168 sectors
/dev/sdb: user_max   3907029168 sectors
/dev/sdb: native_max 3907029168 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/loop1 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop2 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop3 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop4 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop5 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop6 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop7 - 0 B - 0 sectors, sector size=512
Hard disk list
Disk /dev/sda - 240 GB / 223 GiB - CHS 29186 255 63, sector size=512 - SanDisk SSD PLUS 240 GB, S/N:174302803264, FW:UF3000RL
Disk /dev/sdb - 2000 GB / 1863 GiB - CHS 243201 255 63, sector size=512 - ST2000DL001-9VT156, S/N:5YD0WF5P, FW:CC41
Disk /dev/sdc - 248 GB / 231 GiB - CHS 30159 255 63, sector size=512, FW:PMAP
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63, sector size=512 - WD My Passport 0820, FW:1007
Disk /dev/sde - 4000 GB / 3725 GiB - CHS 3815415 64 32, sector size=512 - WD Elements 25A3, FW:1021
Disk /dev/loop0 - 3167 MB / 3020 MiB - 6186728 sectors (RO), sector size=512
Disk /dev/nvme0n1 - 2000 GB / 1863 GiB - CHS 1907729 64 32, sector size=512
Disk /dev/nvme1n1 - 1000 GB / 931 GiB - CHS 953869 64 32, sector size=512

Partition table type (auto): EFI GPT
Disk /dev/sdd - 1000 GB / 931 GiB - WD My Passport 0820
Partition table type: EFI GPT

Analyse Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953458175 (expected 1953458175)
hdr_lba_start=34
hdr_lba_end=1953458142
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
Current partition structure:
 1 P MS Data                     2048 1953458175 1953456128

search_part()
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB

Results
   P MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB

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


dir_partition inode=0
   P MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
Directory /

interface_write()
 1 P MS Data                     2048 1953456127 1953454080


dir_partition inode=0
   P MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
Directory /

interface_write()
 1 P MS Data                     2048 1953456127 1953454080

search_part()
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
     MS Data                     2048 1953456127 1953454080
     exFAT found using backup sector, blocksize=262144, 1000 GB / 931 GiB
     MS Data                     2048 1953456127 1953454080
     exFAT found using backup sector, blocksize=262144, 1000 GB / 931 GiB
Search for partition aborted

Results
   P MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB

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

interface_write()
 1 P MS Data                     2048 1953456127 1953454080
simulate write!

Analyse Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953458175 (expected 1953458175)
hdr_lba_start=34
hdr_lba_end=1953458142
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
Current partition structure:
 1 P MS Data                     2048 1953458175 1953456128

search_part()
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB

Results
   P MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 1953454080 linear /dev/sdd 2048" | dmsetup create test0
       0 0000 0000 00 00 00 00 00 00 00 00
gpt_change_part_type
       0 0000 0000 00 00 00 00 00 00 00 00
Change partition type:
     MS Data                        1 1953458175 1953458175
Change partition type:
     exFAT                          1 1953458175 1953458175
SIGINT detected! TestDisk has been killed.


Thu Jun  2 20:06:11 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.17.5-76051705-generic (#202204271406~1653440576~22.04~6277a18 SMP PREEMPT Wed May 25 01) 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       468877312 sectors
/dev/sda: user_max   468877312 sectors
/dev/sda: native_max 468877312 sectors
/dev/sdb: LBA, HPA, LBA48, DCO support
/dev/sdb: size       3907029168 sectors
/dev/sdb: user_max   3907029168 sectors
/dev/sdb: native_max 3907029168 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/loop1 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop2 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop3 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop4 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop5 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop6 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop7 - 0 B - 0 sectors, sector size=512
Hard disk list
Disk /dev/sda - 240 GB / 223 GiB - CHS 29186 255 63, sector size=512 - SanDisk SSD PLUS 240 GB, S/N:174302803264, FW:UF3000RL
Disk /dev/sdb - 2000 GB / 1863 GiB - CHS 243201 255 63, sector size=512 - ST2000DL001-9VT156, S/N:5YD0WF5P, FW:CC41
Disk /dev/sdc - 248 GB / 231 GiB - CHS 30159 255 63, sector size=512, FW:PMAP
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63, sector size=512 - WD My Passport 0820, FW:1007
Disk /dev/sde - 4000 GB / 3725 GiB - CHS 3815415 64 32, sector size=512 - WD Elements 25A3, FW:1021
Disk /dev/loop0 - 3167 MB / 3020 MiB - 6186728 sectors (RO), sector size=512
Disk /dev/nvme0n1 - 2000 GB / 1863 GiB - CHS 1907729 64 32, sector size=512
Disk /dev/nvme1n1 - 1000 GB / 931 GiB - CHS 953869 64 32, sector size=512

Partition table type (auto): EFI GPT
Disk /dev/sdd - 1000 GB / 931 GiB - WD My Passport 0820
Partition table type: EFI GPT
New options :
 Dump : No
 Align partition: Yes
 Expert mode : No

Interface Advanced
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953458175 (expected 1953458175)
hdr_lba_start=34
hdr_lba_end=1953458142
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
 1 P MS Data                     2048 1953458175 1953456128
     exFAT, blocksize=262144, 1000 GB / 931 GiB


dir_partition inode=0
 1 P MS Data                     2048 1953458175 1953456128
     exFAT, blocksize=262144, 1000 GB / 931 GiB
Directory /

exFAT_boot_sector
 1 P MS Data                     2048 1953458175 1953456128
     exFAT, blocksize=262144, 1000 GB / 931 GiB
Boot sector
exFAT OK

Backup boot record
exFAT OK

Sectors are not identical.

Analyse Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953458175 (expected 1953458175)
hdr_lba_start=34
hdr_lba_end=1953458142
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
Current partition structure:
 1 P MS Data                     2048 1953458175 1953456128

search_part()
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB

Results
   P MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 1953454080 linear /dev/sdd 2048" | dmsetup create test0
Can't open backup.log file: No such file or directory
interface_load


dir_partition inode=0
   P MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
Directory /
       0 0000 0000 00 00 00 00 00 00 00 00
gpt_change_part_type
       0 0000 0000 00 00 00 00 00 00 00 00
Change partition type:
     MS Data                        1 1953458175 1953458175
Change partition type:
     exFAT                          1 1953458175 1953458175
gpt_change_part_type
Change partition type:
   P EFI System                  2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
Change partition type:
   P ext2                        2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
Invalid partition structure.

TestDisk exited normally.


Thu Jun  2 20:14:50 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.17.5-76051705-generic (#202204271406~1653440576~22.04~6277a18 SMP PREEMPT Wed May 25 01) 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       468877312 sectors
/dev/sda: user_max   468877312 sectors
/dev/sda: native_max 468877312 sectors
/dev/sdb: LBA, HPA, LBA48, DCO support
/dev/sdb: size       3907029168 sectors
/dev/sdb: user_max   3907029168 sectors
/dev/sdb: native_max 3907029168 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/loop1 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop2 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop3 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop4 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop5 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop6 - 0 B - 0 sectors, sector size=512
Warning: can't get size for Disk /dev/loop7 - 0 B - 0 sectors, sector size=512
Hard disk list
Disk /dev/sda - 240 GB / 223 GiB - CHS 29186 255 63, sector size=512 - SanDisk SSD PLUS 240 GB, S/N:174302803264, FW:UF3000RL
Disk /dev/sdb - 2000 GB / 1863 GiB - CHS 243201 255 63, sector size=512 - ST2000DL001-9VT156, S/N:5YD0WF5P, FW:CC41
Disk /dev/sdc - 248 GB / 231 GiB - CHS 30159 255 63, sector size=512, FW:PMAP
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63, sector size=512 - WD My Passport 0820, FW:1007
Disk /dev/sde - 4000 GB / 3725 GiB - CHS 3815415 64 32, sector size=512 - WD Elements 25A3, FW:1021
Disk /dev/loop0 - 3167 MB / 3020 MiB - 6186728 sectors (RO), sector size=512
Disk /dev/nvme0n1 - 2000 GB / 1863 GiB - CHS 1907729 64 32, sector size=512
Disk /dev/nvme1n1 - 1000 GB / 931 GiB - CHS 953869 64 32, sector size=512

Partition table type (auto): EFI GPT
Disk /dev/sdd - 1000 GB / 931 GiB - WD My Passport 0820
Partition table type: EFI GPT

Analyse Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=1953458175 (expected 1953458175)
hdr_lba_start=34
hdr_lba_end=1953458142
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
Current partition structure:
 1 P MS Data                     2048 1953458175 1953456128

search_part()
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB

Results
   P MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 1953454080 linear /dev/sdd 2048" | dmsetup create test0
The end state is looking like that:

Code: Select all

NTFS signature is missing.
NTFS signature is missing.
       0 0000 0000 00 00 00 00 00 00 00 00
       0 0000 0000 00 00 00 00 00 00 00 00
       0 0000 0000 00 00 00 00 00 00 00 00
gpt_change_part_type
       0 0000 0000 00 00 00 00 00 00 00 00
Change partition type:
     MS Data                     2048 1953456127 1953454080
Change partition type:
     exFAT                       2048 1953456127 1953454080


dir_partition inode=0
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
Directory /


dir_partition inode=0
   P MS Data                     2048 1953456127 1953454080
Directory /
       0 0000 0000 00 00 00 00 00 00 00 00
       0 0000 0000 00 00 00 00 00 00 00 00
       0 0000 0000 00 00 00 00 00 00 00 00
gpt_change_part_type
       0 0000 0000 00 00 00 00 00 00 00 00
Change partition type:
     MS Data                     2048 1953458175 1953456128
Change partition type:
     NTFS                        2048 1953458175 1953456128

   P MS Data                     2048 1953458175 1953456128
Can't open filesystem. Filesystem seems damaged.


dir_partition inode=0
   P MS Data                     2048 1953456127 1953454080
Directory /

interface_write()
 1 P MS Data                     2048 1953458175 1953456128

search_part()
Disk /dev/sdd - 1000 GB / 931 GiB - CHS 121597 255 63
     MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB
     MS Data                     2048 1953456127 1953454080
     exFAT found using backup sector, blocksize=262144, 1000 GB / 931 GiB
     MS Data                     2048 1953456127 1953454080
     exFAT found using backup sector, blocksize=262144, 1000 GB / 931 GiB
Search for partition aborted

Results
   P MS Data                     2048 1953456127 1953454080
     exFAT, blocksize=262144, 1000 GB / 931 GiB

Hint for advanced users: dmsetup may be used if you prefer to avoid rewriting the partition table for the moment:
echo "0 1953454080 linear /dev/sdd 2048" | dmsetup create test0
       0 0000 0000 00 00 00 00 00 00 00 00
       0 0000 0000 00 00 00 00 00 00 00 00
       0 0000 0000 00 00 00 00 00 00 00 00
gpt_change_part_type
       0 0000 0000 00 00 00 00 00 00 00 00
Change partition type:
     MS Data                     2048 1953458175 1953456128
Change partition type:
     exFAT                       2048 1953458175 1953456128

interface_write()
 1 P MS Data                     2048 1953458175 1953456128
write!
No extended partition
You will have to reboot for the change to take effect.

TestDisk exited normally.
I have already did a retrieval of the files through photorec but I still would prefer to have them with their name etc if possible.
Is there anyway to do that?

Thanks for taking the time to read me !
Hello there !
I had some vacations and had hard time coming back at work, so I totally forgot about all of this until my friend asked me again about the HardDrive, 2 days ago.
So I'm coming back to you for seeking help :D .

I have edited in the quotation (because I can't edit the first post) all the parts that could be unclear or that was using abreviations.
I used Pop-Os, a linux distribution based on Ubuntu.

Please let me know if you need any other information that I can provide to find help you finding a solution.

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

Re: Writed wrong partition at wrong sector start, would like to go back..

#4 Post by recuperation »

Dragomitch wrote: 08 Jun 2022, 20:13 I've just did a retrieval of the files through photorec but I still would prefer to have them with their name etc if possible.
Is there anyway to do that?
You would simply try out if the "p"-key in Testdisk yields results that you expect. In case of the directory being shown you can use Testdisk to copy files and folders to a safe location.
If the copies do not meet your expectation, try out any other recovery software for better results.

Locked