You are not logged in.
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
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...
-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)
Offline
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
I edited my post after you read it. I meant to say try using photorec, not testdisk.
Offline
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
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