WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Data Recovery from bad SSD  (Read 5542 times)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11675
Re: Data Recovery from bad SSD
« Reply #15 on: September 11, 2022, 03:41:25 PM »
Hi MTCAT
The difference between 40 and 44 pins is the latter also brings in power on the IDE connector.
Adapters are available. It's just a small board with a 44 pin connector on one end and two
connectors at the other end, one 40 pin and a 4 pin power connector. Or the power connection
might be a pigtail that hangs off of the board.

« Last Edit: September 11, 2022, 03:42:58 PM by Rich »

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: Data Recovery from bad SSD
« Reply #16 on: September 13, 2022, 07:27:02 AM »
Hi Rich,

Thanks, I slowly clued into that as well, I have one of those adapters coming, but it won't be here until Thursday, the 2.5 inch external enclosure I got yesterday was just for 40 pin IDE...sigh, so, have to wait to Thursday now before I can try imaging the entire SSD with my Slackware desktop...

For my own education, can you tell me why we can't make an image of a single partition by itself ?, i.e., just hda3 as I was attempting before. I read online that it's actually easier to do that since when mounting the image of a single partition you don't need to worry about block offsets when mounting.

I do understand that if we want to try to repair the disk that we need to image the whole drive, to be able to possibly repair the partition table, but otherwise, is it possible to just mount an image of one partition by itself ?

Thanks,

David

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11675
Re: Data Recovery from bad SSD
« Reply #17 on: September 13, 2022, 09:11:37 AM »
Hi MTCAT
... For my own education, can you tell me why we can't make an image of a single partition by itself ?, ...
You can, but what you get will be based on how big the partition table says that partition is. If the table says
your 300 Meg partition is only 17 Megs, thats all you'll get.

Quote
... I read online that it's actually easier to do that since when mounting the image of a single partition you don't need to worry about block offsets when mounting.
I read online that it's easy to do without worrying about block offsets. I saw it in reply #7:
... Assign a device to the image file:
Code: [Select]
sudo losetup --show --find --partscan base.img
/dev/loop241
In this example the operating system returned  /dev/loop241  for the image file.

Use fdisk to get a partition list:
Code: [Select]
fdisk -l /dev/loop241
 ----- Snip -----
Device         Boot  Start    End Sectors  Size Id Type
/dev/loop241p1        2048 206847  204800  100M 83 Linux
/dev/loop241p2      206848 309247  102400   50M 83 Linux
/dev/loop241p3      309248 923647  614400  300M 83 Linux
In this example there are 3 partitions.

If you want to try looking at partition 3:
Code: [Select]
mkdir P3
sudo mount /dev/loop241p3 P3
cd P3
ls -l
...
All you need to do is create a mount point (subdirectory) and mount it:
Code: [Select]
mkdir PickAnyName
sudo mount /dev/loop241p1 PickAnyName

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 718
Re: Data Recovery from bad SSD
« Reply #18 on: September 13, 2022, 12:17:51 PM »
And as default, Linux mounts partitions with write permissions.
And don't write any data to some bad ssd/hd.

So if you try to mount the partition you should just mount it as read only.

And many Linux systems also auto mount, that rely bad.
Because when mounting a ssd/hd it's also write's some data to it. 

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: Data Recovery from bad SSD
« Reply #19 on: September 13, 2022, 09:29:28 PM »
Hi Rich, curaga and patrikg,

Okay, thanks for the explanation with the single partition image...sorry for not realizing what you were showing me there Rich, I just haven't got that far yet, I will definitely follow along your post 7 if I can get an image made of the entire disk.

I managed to get an external enclosure today that fits the 44 pin 2.5 inch SSD (with a USB connection to the desktop) but neither one of my Slackware desktops can see the external drive, when I type "fdisk -l" all the devices get listed as usual but at the end the terminal prompt hangs (with just a blinking cursor) until I unplug the USB cable for the external hard-drive enclosure, then I get the command prompt back.

This happened on both 2.6.37.4 and 4.4.14.

I do have an 44 pin to 40 pin adapter coming as well, which would allow me to hook up to my older desktop internally, with the extra CD/DVD pigtail as Rich suggested, but it won't be here until Thursday.

So not sure, maybe could try booting up TInyCore 3.0 on one of the desktops as well ? TC 3.0 was able to see hda at least (when booting the PC104 stack), but so far I've had no luck with Slackware.

Thanks,

David

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11048
Re: Data Recovery from bad SSD
« Reply #20 on: September 14, 2022, 05:29:32 AM »
USB adapters use different drivers, so older Linux probably won't affect anything.
The only barriers that can stop you are the ones you create yourself.

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: Data Recovery from bad SSD
« Reply #21 on: September 17, 2022, 09:41:46 AM »
Hi everyone,

Having problems posting, long story short, can't get Slackware to recognize the external 2.5 inch drive. I did make a 21.7 GByte image of hda3 (user partition), which I still have, on a pen drive, but I wasn't able to mount the image file, getting the following error in dmesg,

[1810.399627] EXT4-fs [loop 0]: failed to parse options in superblock: y?
[1810.399652] EXT4-fs [loop0]: bad geometry: block count 13565696 exceeds size of device (5701216 blocks)

Any ideas what I can do to try to mount this 21.7 GByte image file ?

Thanks,

David

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11675
Re: Data Recovery from bad SSD
« Reply #22 on: September 17, 2022, 08:40:39 PM »
Hi MTCAT
First make a copy of your image file to experiment on:
Code: [Select]
cp hda3Data.img hda3Test.imgThis way if something goes wrong, you can just copy it again.

Next you want to get a list of backup superblocks:
Code: [Select]
sudo mke2fs -n hda3Test.imgWhen it asks:
Code: [Select]
Proceed anyway? (y,N)just hit  y  then  Enter.

It should look similar to this:
Code: [Select]
tc@E310:~/DD$ sudo mke2fs -n /dev/sda2
mke2fs 1.44.4 (18-Aug-2018)
/dev/sda2 contains a ext4 file system
        last mounted on /mnt/sda2 on Mon Jul  4 20:32:05 2022
Proceed anyway? (y,N) y
Creating filesystem with 3840000 4k blocks and 960992 inodes
Filesystem UUID: f6a323d6-9619-454f-aaeb-09a8a1b00d26
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

tc@E310:~/DD$

Pick the first superblock backup listed and try to restore the superblock.
For example:
Code: [Select]
sudo e2fsck -b 32768 hda3Test.img
Now try mounting it again:
Code: [Select]
mkdir PickAnyName
sudo mount hda3Test.img PickAnyName

If it fails, pick the next superblock backup listed and try to restore the superblock.
Then try mounting again. Work your way through the superblock backups as required.

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: Data Recovery from bad SSD
« Reply #23 on: September 19, 2022, 07:35:59 AM »
Thanks for the help Rich, I'll give that a try this week.

Thanks,

David

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: Data Recovery from bad SSD
« Reply #24 on: September 20, 2022, 07:46:15 AM »
Hi Rich,

I went through all the super-blocks as instructed but I still get the same error as in post 21 when trying to mount. Need to run resize2fs somehow?, without it complaining that I need to run e2fsck first.

Thanks,

David

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 718
Re: Data Recovery from bad SSD
« Reply #25 on: September 20, 2022, 08:17:40 AM »
I think you can also use some tools for your image, for carving out the files.
I think of one program called scalpel, that uses the magic descriptor of files.
But if the blockchain is lost there no easy solution, i think.
You can visit the arch wiki if you like to spend little more time about Data/File recovery.
https://wiki.archlinux.org/title/file_recovery

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: Data Recovery from bad SSD
« Reply #26 on: September 21, 2022, 09:14:34 PM »
Hi everyone,

Thanks for all the help, I sent the SSD off to a recovery firm, they've examined it and said there was "firmware corruption" and that data would need to be restored "off-chip", apparently there are many individual flash drives within the SSD that act as a RAID array?, so it sounds like the individual flash drives (if that's the right word) need to be pulled out and data pulled off each sub-drive individually, will be no charge if they can't recover any data and I won't tell how much it will cost if they are successful!

Suffice to say it's almost as much as a whole new SSD!

At least it forces me to get to get the VortexDX3 setup going 100 percent asap!

Thanks,

David

Offline neonix

  • Wiki Author
  • Sr. Member
  • *****
  • Posts: 395
Re: Data Recovery from bad SSD
« Reply #27 on: March 30, 2024, 05:30:07 AM »
Could you guys create a SystemRescueCd type flavor of TinyCore (gui) and Microcore (cli) that will be designed to recover or fix HDDs.

The best version will be 2 file version, kernel + core.gz, easy to install and easy to remaster.