I was trying to make a bootable USB drive. I entered the following:
root@BlackBox:/home/bgp# pv XP32bit.iso > /dev/sdb
I let it run, and then became aware that I had the wrong target. I meant to target /dev/sdc which is a thumb drive, not /dev/sdb which is my external hard drive containing 20+ years of memories. Oops, my bad.
After the process was complete and I realized my mistake, I was still able to mount and access all the files on my external drive, but gparted shows the file system as iso9660. I rebooted my system and now instead of my external drive showing on the desktop as "Storage" (its former label) it shows up as something else and it is inaccessible. Holy God, where do I start?
The drive is a WD 1.5TB. I am attempting data rescue with gparted, and I assume the scanning process will take 6 years or so on my ancient hardware. I can't describe how losing these files will make me feel, but I'm sure you know. Is the data still there? Please help if you can.
edit: Thank you Nmath, for the link, and for reminding me not to do incredibly stupid things as root, but everything I ever learned about computers was by breaking them. I'm trying foremost right now. I have no idea how long it will take, or if it will work, but I will be back with results. I feel like a lot of the data must still be there, because I could navigate the drive folders and open files after the ill-fated operation.
edit: I read the links below and many more and ran sudo apt install testdisk
then photorec
then let it run for 15 days. I recovered thousands of pictures but many of them were, sadly, overwritten. Glad I recovered some. Thanks for the help.
dd
andpv
copy data indiscriminately. These commands ignore anything located at the destination path. if you tell it to copy 800MB to a disk, it will overwrite that much from the beginning. The partition table is at the beginning and would have been overwritten. If you keep using the disk, you risk overwriting more. See: https://askubuntu.com/questions/676242/how-to-recover-deleted-files-in-ubuntu-using-live-usb-based-on-filetype. – Nmath Mar 23 '20 at 00:26