External hard drive cannot be mounted

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
wch090
Posts: 2
Joined: 07 Sep 2020, 17:58

External hard drive cannot be mounted

#1 Post by wch090 »

Hi, I'm not very proficient with computers, and I'm having some problems with a hard drive.

I have a hard drive enclosure and a 4TB internal hard drive with important data. I connected the hard drive enclosure to a Linux Mint laptop, but the hard drive won't mount at all.

With ls /dev/ | grep sd it lists the following:

Code: Select all

sda
sda1
sda2
sda5
sdb
sdb is the hard drive in question. I posted my question on an online forum and received some help, but I still don't know how to safely recover the files.

sudo fsck /dev/sdb

Code: Select all

fsck from util-linux 2.34
e2fsck 1.45.5 (07-Jan-2020)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sdb

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

Found a PMBR partition table in /dev/sdb
sudo lsusb

Code: Select all

Bus 002 Device 002: ID 8087:8000 Intel Corp. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 010: ID 152d:1561 JMicron Technology Corp. / JMicron USA Technology Corp. JMS561U two ports SATA 6Gb/s bridge
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 006: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
Bus 003 Device 003: ID 04f2:b39a Chicony Electronics Co., Ltd Integrated Camera
Bus 003 Device 017: ID 046d:c31c Logitech, Inc. Keyboard K120
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
sudo fdisk -l

Code: Select all

Disk /dev/sda: 119.25 GiB, 128035676160 bytes, 250069680 sectors
Disk model: Samsung SSD 840 
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: 0x1e94e312

Device     Boot   Start       End   Sectors   Size Id Type
/dev/sda1  *       2048   1050623   1048576   512M  b W95 FAT32
/dev/sda2       1052670 250068991 249016322 118.8G  5 Extended
/dev/sda5       1052672 250068991 249016320 118.8G 83 Linux




Disk /dev/sdb: 3.65 TiB, 4000787030016 bytes, 976754646 sectors
Disk model:                 
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 33550336 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start        End    Sectors Size Id Type
/dev/sdb1           1 4294967295 4294967295  16T ee GPT
sudo gdisk -l /dev/sdb

Code: Select all

GPT fdisk (gdisk) version 1.0.5

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

Creating new GPT entries in memory.
Disk /dev/sdb: 976754646 sectors, 3.6 TiB
Model:                 
Sector size (logical/physical): 4096/4096 bytes
Disk identifier (GUID): 6F2DBA10-E0FC-4323-9E42-EB43C432C213
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 5
First usable sector is 6, last usable sector is 976754640
Partitions will be aligned on 256-sector boundaries
Total free space is 976754635 sectors (3.6 TiB)

Number  Start (sector)    End (sector)  Size       Code  Name
testdisk, then EFI/GPT -> Analyse -> Quick Search:

Code: Select all

Disk /dev/sdb - 4000 GB / 3726 GiB - CHS 60800 255 63
     Partition               Start        End    Size in sectors
>P MS Data                     4096  976754175  976750080 [Files]
I tried using p to list the files, and everything seemed alright. But I don't know how to safely recover the files.

At this point, the user who helped me said:
Okay perfect, seems to be all there, and only one partition (basically start + end/size cover all of the disk)

I'm just now wondering what "MS Data" means and if we can just write the partition table as it has been recovered...

it seems to be a common issue with prebuilt encased hard drives...

Sorry, I'm at a loss. Your data is not lost, but the partition ("MS Data") seems to be deleted or hidden. This seems to be common to very big preformatted external hard drives. It could be as easy as recovering the partition in testdisk (i.e. write the new partition table), but I'm not sure if this could break anything. Maybe someone else could chime in...

You could check with the testdisk forums at https://forum.cgsecurity.org/phpBB3/. They are very helpful and very knowledgeable. Your case should not be very difficult to solve (only 1 partition across the whole disk, files can be read), I'm just not sure how to recover it safely...

Provide the gdisk and testdisk info and someone should be able to help.
Does anyone know how to safely recover the drive? Thanks in advance.

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

Re: External hard drive cannot be mounted

#2 Post by recuperation »

wch090 wrote: 07 Sep 2020, 18:18 Does anyone know how to safely recover the drive? Thanks in advance.
Consider your broken drive as "source". Get yourself a sufficiently large free "target" drive.
Create a folder in the target with an easy find name like "wch090".

In the list file menu select in source everything you want to copy.
When Testdisk ask you where to write, navigate through the dirctory tree until you find your folder labeled "wch090" in your target drive.

Do not write on your broken source drive!

wch090
Posts: 2
Joined: 07 Sep 2020, 17:58

Re: External hard drive cannot be mounted

#3 Post by wch090 »

recuperation wrote: 09 Sep 2020, 00:54
wch090 wrote: 07 Sep 2020, 18:18 Does anyone know how to safely recover the drive? Thanks in advance.
Consider your broken drive as "source". Get yourself a sufficiently large free "target" drive.
Create a folder in the target with an easy find name like "wch090".

In the list file menu select in source everything you want to copy.
When Testdisk ask you where to write, navigate through the dirctory tree until you find your folder labeled "wch090" in your target drive.

Do not write on your broken source drive!
Alright, I'll buy a new hard drive to copy everything into

Locked