Computer detects internal HDD but is unable to be mounted

Hello,

A while a go, my computer suddenly stopped detecting the HDD I have plugged into the system. I initially thought the drive was dead, but using the fdisk -l command, it shows the affected disk still being detected.

Here’s what it gives me when I use the command.

Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000DM010-2EP1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xdc8dea5e

Device     Boot Start        End    Sectors   Size Id Type
/dev/sda1  *     2048 1953520064 1953518017 931.5G 83 Linux


Disk /dev/sdb: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Samsung SSD 870 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdc: 238.47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: ADATA SU750     
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: 0x46336afe

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdc1  *     2048 500103449 500101402 238.5G 83 Linux


Disk /dev/loop0: 74.11 MiB, 77713408 bytes, 151784 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop3: 91.69 MiB, 96141312 bytes, 187776 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop2: 496.98 MiB, 521121792 bytes, 1017816 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 4 KiB, 4096 bytes, 8 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop4: 40.43 MiB, 42393600 bytes, 82800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

The affected drive is the first one.

Any advice on what’s happening or what I should do?

I am running 6.6.10-1-MANJARO Linux Xfce edition.

Be careful

Keeping data on a dying disk is no good idea.

  • Does gparted display the disk and its partitions?

You may decide to use a filesystem with checksums. But this does not prevent data loss.

Yes, GParted is able to display the disk. It’s entirely unallocated as I’ve only used that disk to store files on. I will also add that I ran the program GSmartControl and the affected drive passes the health test.

Which doesn’t match the first device

It appears to have a Linux partition - which means it has a signature - but may have lost it’s primary partition table causing the kernel to not mount it.

Whereas the second device is entirely unallocated

What happens if you try to mount it manually on command line? Error message?

sudo mount /dev/sda1 /mnt

advanced filesystem check

Ensure the device is unmounted - likely not an issue since you posted - anyway never do anything advanced on a mounted filesystem

The device may have lost partition information - then running testdisk from testdisk package may be able rebuild the partition table from backup locations.

If you don’t have data worth saving you can reformat using the Linux filesystem of choice.

If you know the filesystem to be ext4 (the most common) you can use dumpe2fs to locate superblock then use the a superblock to check the filesystem

dumpe2fs /dev/sda1 | grep -i superblock
e2fsck -f -b <superblock> /dev/sda1

Or try to mount the device using the superblock

mount -o sb=<superblock> /dev/sda1 /mnt

I couldn’t remember the above so I did a quick search to refresh my memory - credit to https://www.cyberciti.biz/faq/linux-find-alternative-superblocks/

2 Likes

Are you talking about /dev/sdb, which seems to have no partitions?

I attempted to find the superblock for the drive. This is the result I got:

dumpe2fs 1.47.0 (5-Feb-2023)
dumpe2fs: Permission denied while trying to open /dev/sda1
Couldn't find valid filesystem superblock.

Attempting to manually mount also failed:

mount: /mnt: /dev/sda1 already mounted or mount point busy.
       dmesg(1) may have more information after failed mount system call.

use

sudo dump2fs

and get interested into using linux !

After a bit more testing, I found that the drive is considered mounted and attempts to unmount it are unsuccessful:

umount: /: target is busy.

Attempting to check the filesystem using the superblock yields this:

e2fsck 1.47.0 (5-Feb-2023)
/dev/sda1 is mounted.



WARNING!!!  The filesystem is mounted.   If you continue you ***WILL***
cause ***SEVERE*** filesystem damage.


Do you really want to continue<n>? 

Obviously I didn’t continue after that.

I got the drives mixed up and thought sdb was the affected drive. However GSmartControl still sees the affected drive.

This is your system drive.
/” means: the root of your file system

/dev/sdb is probably what you mean

That was the output. Here’s the full thing:

sudo umount /dev/sda1
[sudo] password for kacie: 
umount: /: target is busy.

Again:
you cannot unmount the drive your system is at and running from.
(why would you even want to do that? …)

/dev/sda1 is that drive

You started the thread with fdisk -l output
and said:

which is: /dev/sda

apparently some mixup occurred

to shed some light from another direction:

mount| grep /dev/sd

lsblk -f

sudo parted -l

2 Likes

Okay so I figured out what happened, mostly. I’m still not sure why my internal HDD wasn’t being shown in the file manager before all this. But as it turns out, when I was installing Manjaro, I hadn’t checked which drive it was installing on. Instead of going onto my Samsung SSD like I intended, it instead installed onto the HDD. I wasn’t aware of this and had assumed I installed it on the appropriate drive. It took an embarrassingly long time of looking at the drive information on GParted, the FDisk command, and GSmartControl for it to slowly dawn on me what I had done.

Which means unfortunately the data I was hoping to save had been overwritten by Manjaro, all because I forgot to check which drive I was installing Manjaro onto. I feel embarrassed.

Is there a way for me to recover at least a bit of the data?

All I can recommend is trying Testdisk from aa Live Environment and hope for the best.

Also that you learn from your mistake and keep regular backups! It’s a thing!

Since the the whole disk sda ( ST1000DM010-2EP1) is formatted with ext4, I doubt you can rescue any data, since ext4 zeros data on lazyinit process. That means that even if data would be found, they wouldn’t be completely recoverable, but only chunks of it.

Thanks! A friend of mine, who also uses Manjaro Linux, will be helping me with this, as he has some experience in recovering data.

And yeah, this was one massive blunder on my part, installing to the wrong disc. I’ve been using Linux for almost ten years. I should’ve known better.

Ah I see. Well it’s worth a try. If I can’t get anything back, yeah it sucks but the best thing I can do is move on and try not to repeat the same mistake.

This worked. Thanks again!

2 Likes

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.