Pen drive recovery

If it doesn't relate to Debian, but you still want to share it, please do it here

Pen drive recovery

Postby qyron » 2019-04-26 20:10

I have a pen drive being reported as corrupted. It's a hybrid PC & smartphone connectable model. It has very little time of use and I'm not the kind of person to mistreat my data storage.

It has simply, over the night, started to be flagged has corrupted by my tablet and the OS wants to format it in order to solve the problem but I want to avoid this because I have some files in there (mostly family photos) that I want to try to recover before throwing the damn thing away.

I'm running GParted on it as I write this, for the second time, because the first time the result made no sense to me. I've also installed TestDisk for step two but I feel as if I'm threading water here.

Can someone share some wisdom on this? Tell if I'm going the right way?
Stop hitting me with anvils!|Parem de me bater com bigornas!
Willie E. Coyote

Running Debian 9.2
User avatar
qyron
 
Posts: 189
Joined: 2008-07-21 20:47

Re: Pen drive recovery

Postby Dai_trying » 2019-04-26 20:58

If it were me I would use dd to make a clone of it before any further corruption and then loop mount the image and recover anything that is available from that.
Dai_trying
 
Posts: 833
Joined: 2016-01-07 12:25

Re: Pen drive recovery

Postby sunrat » 2019-04-26 23:25

Never trust flash drives, they are fickle and fragile. Always have their data backed up somewhere else.
Do what Dai_trying suggested, clone it and run Testdisk and Photorec on the clone.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 2920
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Pen drive recovery

Postby qyron » 2019-04-27 14:08

After several tests, TestDisk returned that there is a problem and returned an address: 0xAA55.

Dai_trying wrote:If it were me I would use dd to make a clone of it before any further corruption and then loop mount the image and recover anything that is available from that.

Would you mind helping me with that? I don't have any experience with dd.

sunrat wrote:Never trust flash drives, they are fickle and fragile. Always have their data backed up somewhere else.
Do what Dai_trying suggested, clone it and run Testdisk and Photorec on the clone.

I always make my best to keep copies of copies of pretty much anything I have. But cases like this serve to teach a lesson for the future. I think I'll buy an HDD to keep a "dead" backup on the side and break my data into several flash cards for added security.
Stop hitting me with anvils!|Parem de me bater com bigornas!
Willie E. Coyote

Running Debian 9.2
User avatar
qyron
 
Posts: 189
Joined: 2008-07-21 20:47

Re: Pen drive recovery

Postby Dai_trying » 2019-04-27 14:41

qyron wrote:
Dai_trying wrote:If it were me I would use dd to make a clone of it before any further corruption and then loop mount the image and recover anything that is available from that.

Would you mind helping me with that? I don't have any experience with dd.


dd must be used with care!

EDIT: ensure the device is NOT mounted

I do the following

first determine the usb device id, for this I use lsblk, typical output will be something like

Code: Select all
sdb       8:16   1  14.5G  0 disk
└─sdb1    8:17   1  14.5G  0 part
sr0      11:0    1  1024M  0 rom 


In this example I can see my USB stick (16Gb) as sdb and I only want partition sdb1 (there may be more available on yours)

Now I can create an image with the following command

Code: Select all
sudo dd if=/dev/sdb1 of=~/test_usb_disc.img status=progress


Now you will have an image file in your home directory named test_usb_disc.img obviously you can name it anything you want. I added the progress so you can see it is doing something, otherwise you will be sat waiting until it has finished before you get any feedback.

Now you have the image it can be loop mounted with the following command

Code: Select all
sudo mount -o ro,noload test_usb_disc.img /mnt/


obviously you can change the mount point to another location as to your preference. you could now run testdisk (or any command) on the mounted image. I have not tested this but it should work as I have used it on other images.
If you have any problems mounting the file run the following and post the output here.

Code: Select all
file ~/test_usb_disc.img
Dai_trying
 
Posts: 833
Joined: 2016-01-07 12:25

Re: Pen drive recovery

Postby qyron » 2019-04-27 14:49

The device does not even show on my file explorer when I plug it in; I assume the system can't mount it and disregards it. GParted lists it, as does TestDisk, but nothing else.

I'll get right on it. Thank you.
Stop hitting me with anvils!|Parem de me bater com bigornas!
Willie E. Coyote

Running Debian 9.2
User avatar
qyron
 
Posts: 189
Joined: 2008-07-21 20:47

Re: Pen drive recovery

Postby Dai_trying » 2019-04-27 15:15

I would guess this didn't help...

After several tests, TestDisk returned that there is a problem...


you may have inadvertently created further problems, but follow my advise (carefully) and see if that helps.
Dai_trying
 
Posts: 833
Joined: 2016-01-07 12:25

Re: Pen drive recovery

Postby qyron » 2019-04-27 15:20

Dai_trying wrote:I would guess this didn't help...

After several tests, TestDisk returned that there is a problem...


you may have inadvertently created further problems, but follow my advise (carefully) and see if that helps.


TestDrive was unable to do nothing on the drive besides scanning it. It kept returning that no file systems were found. It is as if the drive was formatted. I keep remembering what would happen to floppy disks when the things were left out in the sun or if I was dumb enough to carry it with me on the subway.
Stop hitting me with anvils!|Parem de me bater com bigornas!
Willie E. Coyote

Running Debian 9.2
User avatar
qyron
 
Posts: 189
Joined: 2008-07-21 20:47

Output

Postby qyron » 2019-04-27 15:23

I got sent packing with my tail tucked between my legs!

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

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
Stop hitting me with anvils!|Parem de me bater com bigornas!
Willie E. Coyote

Running Debian 9.2
User avatar
qyron
 
Posts: 189
Joined: 2008-07-21 20:47

Re: Pen drive recovery

Postby Head_on_a_Stick » 2019-04-27 15:26

Try gddrescue instead.
Don't break DebianHow to report bugs

SharpBang GNU/Linux — a pre-configured Openbox/Tint2 desktop running on Debian stable
User avatar
Head_on_a_Stick
 
Posts: 10688
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Pen drive recovery

Postby Dai_trying » 2019-04-27 18:16

Dai_trying wrote:If you have any problems mounting the file run the following and post the output here.

Code: Select all
file ~/test_usb_disc.img
Dai_trying
 
Posts: 833
Joined: 2016-01-07 12:25

Re: Pen drive recovery

Postby qyron » 2019-04-30 08:10

I tried gddrescue and the drive appears to be completely blank.

I haven't had the time to work on it for the last few days but I'll be back on it this evening.
Stop hitting me with anvils!|Parem de me bater com bigornas!
Willie E. Coyote

Running Debian 9.2
User avatar
qyron
 
Posts: 189
Joined: 2008-07-21 20:47

Re: Pen drive recovery

Postby qyron » 2019-05-19 13:38

After several tries ans attempts, the image seems to be completely empty. I don't know how to chalk it up. Every single test I ran on it returned nothing.
Stop hitting me with anvils!|Parem de me bater com bigornas!
Willie E. Coyote

Running Debian 9.2
User avatar
qyron
 
Posts: 189
Joined: 2008-07-21 20:47


Return to Offtopic

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable