Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Pen drive recovery

Off-Topic discussions about science, technology, and non Debian specific topics.
Post Reply
Message
Author
User avatar
qyron
Posts: 206
Joined: 2008-07-21 20:47

Pen drive recovery

#1 Post by qyron »

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

Dai_trying
Posts: 1101
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: Pen drive recovery

#2 Post by Dai_trying »

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.

User avatar
sunrat
Administrator
Administrator
Posts: 6470
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 117 times
Been thanked: 474 times

Re: Pen drive recovery

#3 Post by sunrat »

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
qyron
Posts: 206
Joined: 2008-07-21 20:47

Re: Pen drive recovery

#4 Post by qyron »

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

Dai_trying
Posts: 1101
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: Pen drive recovery

#5 Post by Dai_trying »

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

User avatar
qyron
Posts: 206
Joined: 2008-07-21 20:47

Re: Pen drive recovery

#6 Post by qyron »

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

Dai_trying
Posts: 1101
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: Pen drive recovery

#7 Post by Dai_trying »

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.

User avatar
qyron
Posts: 206
Joined: 2008-07-21 20:47

Re: Pen drive recovery

#8 Post by qyron »

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: 206
Joined: 2008-07-21 20:47

Output

#9 Post by qyron »

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
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Pen drive recovery

#10 Post by Head_on_a_Stick »

Try gddrescue instead.
deadbang

Dai_trying
Posts: 1101
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: Pen drive recovery

#11 Post by Dai_trying »

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

User avatar
qyron
Posts: 206
Joined: 2008-07-21 20:47

Re: Pen drive recovery

#12 Post by qyron »

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: 206
Joined: 2008-07-21 20:47

Re: Pen drive recovery

#13 Post by qyron »

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

Post Reply