WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Data Recovery from bad SSD
« on: September 06, 2022, 04:40:38 PM »
Hello, I'm sorry it's been such a long time since my last visit here, has been a crazy year. I'm still working on my new receivers with VortexDX3 and 24DSI12 with TinyCore kernel 2.6.33.3, just need to incorporate the output of "digitemp" into the acquisition C code and modify as well to report GPS+Glonass+Galileo satellites and that should be it software wise! Thank you very much to Rich, Curaga, patrickg, and many others who have helped so much.

I did an experiment this past long weekend in the extreme heat with my old gear (650 MHz Celeron, Slackware Linux) and it seems that the base station SSD has become damaged (heat stressed ?).

I've attached the output of "fdisk -l" here done on both the rover receiver (which is currently working just fine), and for the base station receiver, which will not boot up at all, I get a bunch of "9A" characters echoed to screen when trying to boot up the base station off the main SSD. The base station and rover receivers were identical, the output of "fdisk -l" should be the same in both cases. Both receivers have 64 GByte SSD's which are reported as PATA on boot up on the rover receiver.

So I booted the base station receiver with one of my old TC sticks (3.8.4, kernel 2.6.33.3, no real time patch) and was able to get an "fdisk -l" output that way on the base station receiver, but I'm not able to mount the (apparently) damaged drive, which is now being reported as ~ 32 GBytes ? (supposed to be 64 GBytes).

There's some data on the base station receiver I would like to recover, but I don't know if this is even possible without being able to mount the drive ?

Thanks,

David

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: Data Recovery from bad SSD
« Reply #1 on: September 06, 2022, 05:32:51 PM »
Hi MTCAT
Do not mount or attempt to write to the disk. You want to try to copy the entire drive and
then work from the copy. This should provide a good starting point:
https://www.linux.com/topic/desktop/gnu-ddrescue-best-damaged-drive-rescue/

Its possible just the partition table got corrupted. Create an image copy of the drive:
Code: [Select]
dd if=/dev/sdb of=base.imgwhere  /dev/sdb  is the damaged drive. Google how to fix partition table and attempt
the fix on the file you created.

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: Data Recovery from bad SSD
« Reply #2 on: September 06, 2022, 09:46:42 PM »
Hi Rich,

Thanks a lot for the help!, and the link, I'll use dd to make an image of the drive, and then see if I can find any problems with the partition table.

Thanks again,

David

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: Data Recovery from bad SSD
« Reply #3 on: September 06, 2022, 10:51:01 PM »
Hi MTCAT
A couple of things. It looks like you used the busybox version of  fdisk  for  base.txt.
Install  util-linux-ng.tcz  and run  fdisk  on the corrupt drive again.

Code: [Select]
tc@E310:~/part$ dd if=/dev/sdg of=base.img
962560+0 records in
962560+0 records out
492830720 bytes (493 MB, 470 MiB) copied, 47.0264 s, 10.5 MB/s
The  dd  command defaults to copying  512  byte blocks so it will take some time to
create the image file. Do not attempt to speed it up by increasing the block size.
Once you've created the image file, you can copy it using the  cp  command to create
additional copies to experiment on.

If  dd  errors out on you, look into  ddrescue.

To use the image file, you need to assign a device to it. You will need  util-linux-ng.tcz
installed for this.
Code: [Select]
tc@E310:~/part$ sudo losetup --show --find --partscan base.img
/dev/loop241
The image file has been assigned to  /dev/loop241.  You can use that anywhere you
would use something like  /dev/sdb.

Code: [Select]
tc@E310:~/part$ fdisk -l /dev/loop241
Disk /dev/loop241: 470 MiB, 492830720 bytes, 962560 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
Disklabel type: dos
Disk identifier: 0x2feba4f6

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
And  /dev/loop241  has 3 partitions,  /dev/loop241p1, /dev/loop241p2, and /dev/loop241p3.

When you are done, free up the device:
Code: [Select]
sudo losetup -d /dev/loop241

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11041
Re: Data Recovery from bad SSD
« Reply #4 on: September 07, 2022, 10:32:46 AM »
Just a warning, when SSDs fail, there's a high chance the data is not recoverable at all. That's unlike the old spinning rust, where a data recovery service can usually get most of it back for a fee.
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 #5 on: September 08, 2022, 09:27:06 PM »
Hi Rich and curaga,

Thanks a lot for the help, I still need to get an ethernet connection on my base station receiver when booted with Tinycore, so hopefully I'll have that done soon so I can install util-linux-ng.tcz and maybe ddrescue as well if need be.

So tonight I thought I would just try using dd on /dev/hda3 where all the data is (I think).

I tried making an image of /dev/hda3 with;

dd if=/dev/hda3 of=/dev/sda1/base.img

But I got an error

dd: "Can't open /dev/sda1/base.img' :Not a directory

Seems I need to mount sda1 first ? (sda is a 64 GByte pen drive). So I typed;

mount /dev/sda1
dd if=/dev/hda3 of=/mnt/sda1/base.img

This seems to be running now, hopefully my 12V battery will last long enough for the process to complete with USB1.0 ports, should have ~ 24 hrs run time, hopefully will be enough!

Hope mounting sda1 was correct, I recall when making duplicate boot TC drives that I did not mount either the source or destination pen drive.

Thanks,

David

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: Data Recovery from bad SSD
« Reply #6 on: September 08, 2022, 09:38:37 PM »
Hi MTCAT
No, no, no.

Code: [Select]
dd if=/dev/hda of=base.imgYou want to copy  /dev/hda  which is not mounted to an actual file located on another drive.

Connect the damaged drive to another machine that has a drive with plenty of free space.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: Data Recovery from bad SSD
« Reply #7 on: September 08, 2022, 11:57:40 PM »
Hi MTCAT
You want to image the entire drive. Don't try to image a partition. Connect the
damaged SSD to a Linux machine that has a large drive. Also, make sure the
machine does not auto mount every drive it finds.

Create a directory to work in:
Code: [Select]
mkdir Recovery
cd Recovery

Find out which device the SSD was assigned to.
Now create an image of the SSD:
Code: [Select]
dd if=/dev/sdb of=master.img
sync

Shut down the machine, disconnect the SSD and put it someplace safe.
Power up the machine and:
Code: [Select]
cd Recovery
cp master.img base.img

You can now work on  base.img.  If you mess it up, just copy  master.img  again.
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

If the contents appear messed up, you might have to try to repair the partition table.
That would require working on  /dev/loop241  because that's where the partition table
is located.

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: Data Recovery from bad SSD
« Reply #8 on: September 09, 2022, 08:12:26 AM »
Hi Rich,

Oh, okay, thanks for the help, I will try that tonight/this weekend, I don't think I can remove the SSD and connect up to a normal Linux desktop though, hmm, not sure, the SSD in the base station is on a card carrier that connects right into the PCI bus, but the hard drive itself is an IDE interface, which is why it was so expensive, I don't think I have an external IDE hard drive enclosure anymore (with a USB external connection),threw it out I think, maybe could get one off Ebay or something, or connect up the SSD internally inside my old AMD Phenom Linux box, I'm pretty sure even that guy uses SATA hard drives though.

Another wrinkle perhaps, I do have a clone of the rover receiver (made with Clonezilla) put on an old external (regular platter spinner) hard-drive, as a backup of sorts, I have booted off that in the past and it "worked" in so far as booting up the system, was very slow to boot, but it did boot.

Not sure if that might help in some way.

Thanks,

David

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: Data Recovery from bad SSD
« Reply #9 on: September 09, 2022, 08:36:13 AM »
Hi MTCAT
... or connect up the SSD internally inside my old AMD Phenom Linux box, I'm pretty sure even that guy uses SATA hard drives though. ...
If that machine has CD/DVD drives, they might be controlled by an IDE interface.

An external drive would work, but might be slower than an internal drive.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11041
Re: Data Recovery from bad SSD
« Reply #10 on: September 09, 2022, 10:32:15 AM »
IDE SSDs are expensive, but there's a cheaper way: Compact Flash cards are IDE compatible. May need a physical adapter, but those are cheap too, being just wires.
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 #11 on: September 10, 2022, 12:16:12 PM »
Hi Rich and Curaga,

Since I started my dd command I let that run (to make an image of hda3), it took about 25 hours, finished last night around 7 PM, but when complete I got an error;

dd: writing '/mnt/sda1/base.img': File too large
8388609+0 records in
8388607+1 records out

The pen drive to which I was writing too was 64 GByte (FAT32), the total size of the (damaged) SSD size is also 64 GByte but I thought I would be okay since I'm not writing out hda1 (boot partition) or hda2 (root partition), so the size for dd to write out should be less than 64 GByte?

But, when I take the pen drive over to my old Slackware box, it shows base.img as being only 4 GByte ? A 32 bit thing ? (FAT32? - need to reformat the pen drive first ?)

I made a directory in /home/dave on my Slackware bix called recovery, and with base.img in /home/dave, typed (as root) "mount -o ro base.img /home/dave/recovery" but I got an error for that as well

mount: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error

I also tried the mount command without the "ro" option and then got an error;
mount: can't find /home/dave/recovery in /etc/fstab or /etc/mtab

Thanks for the idea to "poach" off a CD/DVD IDE interface Rich, I'll check to see if the CD/DVD on my Slackware box is IDE, that could work, but otherwise, looks like I will have to order an external IDE enclosure off Amazon and work off my Slackware box that way, as Rich has been suggesting all along.

I guess if one good thing comes out of this is that it pushes my VortexDX3/TInyCore 3.8.4 system into use, and forces me to finish that and get it going 100 percent, and move on from this power hungry Celeron and old/expensive SSD.

Thankfully, the new VortexDX3 setup does indeed use CF-card as the "hard-drive", so that will be another step forward I think.

Thanks,

David

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11041
Re: Data Recovery from bad SSD
« Reply #12 on: September 10, 2022, 12:51:45 PM »
FAT32 has a 4gb file size limit. Your error message says it wrote 4gb. Use a Linux filesystem to use larger files.
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 #13 on: September 10, 2022, 01:39:06 PM »
Okay, thanks Curaga, if I try that again I'll format the pen drive to ext4 first.

Some good news though, my old Phenom Slackware box does indeed use an IDE interface for the CD/DVD!, and there's even an extra pigtail in there, so, I should be be able to hook up the damaged SSD right into my old desktop, thanks for that suggestion Rich, just have to take the PC104 stack all apart, the SSD is right on the bottom....

Thanks,

David

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: Data Recovery from bad SSD
« Reply #14 on: September 11, 2022, 12:33:19 PM »
Hi Rich and curaga,

I took the base station receiver all apart but now have found that the SSD (64 GByte Innodisk, part number D2D6-64GD11W11) uses a 44 pin IDE connector, the extra pigtails inside my Linux box are 40 pin IDE connectors, so..., not sure now, maybe I do need to get an external 2.5 inch IDE enclosure to get this hooked up to my Slackware box. Inside the base station receiver, the SSD plugs into a Real-Time-Devices carrier board, part number CMT36106HR.

Thanks,

David