I ran ntfsfix by a mistake as follows:
sudo ntfsfix -b /dev/sda
Instead of:
sudo ntfsfix -b /dev/sda1
Now my external hard drive does not show up anymore. If I run lsblk, I get:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 74.2M 1 loop /snap/core22/1380
loop1 7:1 0 4K 1 loop /snap/bare/5
loop2 7:2 0 269.6M 1 loop /snap/firefox/4173
loop3 7:3 0 74.2M 1 loop /snap/core22/1439
loop4 7:4 0 505.1M 1 loop /snap/gnome-42-2204/176
loop5 7:5 0 269.8M 1 loop /snap/firefox/4698
loop6 7:6 0 10.7M 1 loop /snap/firmware-updater/127
loop7 7:7 0 91.7M 1 loop /snap/gtk-common-themes/1535
loop8 7:8 0 38.7M 1 loop /snap/snapd/21465
loop9 7:9 0 14M 1 loop /snap/icon-theme-breeze/2
loop10 7:10 0 10.3M 1 loop /snap/snap-store/1124
loop11 7:11 0 476K 1 loop /snap/snapd-desktop-integration/157
loop12 7:12 0 38.8M 1 loop /snap/snapd/21759
sda 8:0 0 1.8T 0 disk
nvme0n1 259:0 0 476.9G 0 disk
├─nvme0n1p1 259:1 0 260M 0 part /boot/efi
├─nvme0n1p2 259:2 0 16M 0 part
├─nvme0n1p3 259:3 0 233.1G 0 part /media/lau/Local Disk
├─nvme0n1p4 259:4 0 1.4G 0 part
└─nvme0n1p5 259:5 0 242.1G 0 part /var/snap/firefox/common/host-hunspell
/
Any idea how I can restore or recover this external from /dev/sda to /dev/sda1? I have important data in it that I want to rescue.
Edit:
Using sudo gdisk -l /dev/sda:
$ sudo gdisk -l /dev/sda
[sudo] password for lau:
GPT fdisk (gdisk) version 1.0.10
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: not present
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory.
Exact type match not found for type code 7200; assigning type code for
'Linux filesystem'
Exact type match not found for type code 7400; assigning type code for
'Linux filesystem'
Exact type match not found for type code 6500; assigning type code for
'Linux filesystem'
Disk /dev/sda: 3906963456 sectors, 1.8 TiB
Model: My Passport 0748
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 1205348D-AA02-4799-95B8-4ACB0A5080CE
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 3906963422
Partitions will be aligned on 8-sector boundaries
Total free space is 2204972979 sectors (1.0 TiB)
Number Start (sector) End (sector) Size Code Name
1 218129509 1920119918 811.6 GiB 8300 Linux filesystem
2 729050177 1273024900 259.4 GiB 8300 Linux filesystem
3 168653938 0 16.0 EiB 8300 Linux filesystem
Using fdisk -l /dev/sda:
$ sudo fdisk -l /dev/sda
[sudo] password for lau:
Disk /dev/sda: 1.82 TiB, 2000365289472 bytes, 3906963456 sectors
Disk model: My Passport 0748
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x69205244
Device Boot Start End Sectors Size Id Type
/dev/sda1 218129509 1920119918 1701990410 811.6G 72 unknown
/dev/sda2 729050177 1273024900 543974724 259.4G 74 unknown
/dev/sda3 168653938 168653938 0 0B 65 Novell Netware 386
/dev/sda4 2692939776 2692991410 51635 25.2M 0 Empty
Edit 2:
TestDisk 7.2, Data Recovery Utility, February 2024
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org
Disk /dev/sda - 2000 GB / 1862 GiB - My Passport 0748
Please select the partition table type, press Enter when done.
[Intel ] Intel/PC partition
[EFI GPT] EFI GPT partition map (Mac i386, some x86_64...)
[Humax ] Humax partition table
[Mac ] Apple partition map (legacy)
>[None ] Non partitioned media
[Sun ] Sun Solaris partition
[XBox ] XBox partition
[Return ] Return to disk selection
Hint: None partition table type has been detected.
Then I pressed 'enter' on my keyboard:
Disk /dev/sda - 2000 GB / 1862 GiB - CHS 243197 255 63
Partition Start End Size in sectors
> P NTFS 0 0 1 243197 57 60 3906963456
Enter again:
Disk /dev/sda - 2000 GB / 1862 GiB - CHS 243197 255 63
Partition Start End Size in sectors
P NTFS 0 0 1 243197 57 60 3906963456
Boot sector
Status: OK
Backup boot sector
Status: OK
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.
>[ Quit ] [ List ] [Org. BS ] [Backup BS] [Rebuild BS] [ Dump ]
Which option should I select to go forward? Backup BS?