You are not logged in.

#1 2023-02-01 19:27:15

andav
Member
Registered: 2006-12-04
Posts: 117

[SOLVED] can't access my usb thumb drive after canceling badblocks.

i have a lot of data in this drive and an hour ago i moved more files to it and everything was good.
but i wanted to see if my drive is good (just for curiosity).
so i did:

sudo badblocks -w -s -o error.log /dev/sdb

but i saw that it is very slow so i CTRL + C it after 2 minutes.
but now i can't access this drive.
i don't know if this was the cause of the problem but this is the order of actions i made.
the command

lsblk 

recognized it as sdb but there is no sdb1 anymore.
also,

 lsusb

recognized my usb by it's name.
but i can't mount it (again there is no sdb1 so i can't mount).
also i move this disk to a windows machine and there it's saying that i need to format my disk so i can use it (WTF?).
i also open gparted and there my thumb drive is in a state of unknown file system (it was ntfs if i'm not wrong):
https://imgur.com/mzPT3gw

is there a magic command that will give me access again to my usb drive or the data is lost?

Last edited by andav (2023-02-01 21:54:42)

Offline

#2 2023-02-01 19:37:32

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] can't access my usb thumb drive after canceling badblocks.

Using the -w flag with badblocks instructs it to do a destructive write test which overwrites any data already on the drive.
You've just destroyed the partition table and as much data as the command was able to delete before you cancelled it.
There's a small chance that you may be able to recover some of the files using photorec but it's not guaranteed.

Badblocks did exactly what you told it to, you need to read the man page more carefully next time...

man badblocks wrote:

-w
    Use write-mode test. With this option, badblocks scans for bad blocks by writing some patterns (0xaa, 0x55, 0xff, 0x00) on every block of the device, reading every block and comparing the contents. This option may not be combined with the -n option, as they are mutually exclusive.

Last edited by Slithery (2023-02-01 20:02:46)


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2023-02-01 19:59:46

andav
Member
Registered: 2006-12-04
Posts: 117

Re: [SOLVED] can't access my usb thumb drive after canceling badblocks.

Slithery wrote:

There's a small chance that you may be able to recover some of the data using testdisk but it's not guaranteed.

tried that and it is also recognize damage file system


Badblocks did exactly what you told it to, you need to read the man page more carefully next time...
.

you are right of course.
thanks for the help.

Offline

#4 2023-02-01 20:01:55

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] can't access my usb thumb drive after canceling badblocks.

I edited my post after you read it. I meant to say try using photorec, not testdisk.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2023-02-01 20:32:01

andav
Member
Registered: 2006-12-04
Posts: 117

Re: [SOLVED] can't access my usb thumb drive after canceling badblocks.

well i didn't saw your edit so i already formatted the drive...
but after i saw your edit i nevertheless in photorec right now.
22 minutes of trying to find files passed, and it should take another 3 hours.
till now no files have found.
i'll update when it will be finished.

Offline

#6 2023-02-01 21:25:19

andav
Member
Registered: 2006-12-04
Posts: 117

Re: [SOLVED] can't access my usb thumb drive after canceling badblocks.

well it didn't finished yet, but it already found and restore some of my video files.
the names it give them are not the original one's but it's OK.
till now it found and restore 12 video files and now the estimated time to finish is almost 4 hours so i'll wait for it to finish (i think it will take more then 4 hours...).
i think it will succeed to restore almost all of them (from what i see it succeeded till now).
thank you very much!

Offline

Board footer

Powered by FluxBB