0

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.

  • When you say overwrite data, the .iso file I was writing was about 800MB. I had about 250GB of files on the drive, and the drive size is 1.5TB. Would pv overwrite the rest of the drive with...what? Zeroes? – Moogus Show Mar 22 '20 at 22:58
  • dd and pv 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
  • Based on this, I feel like most of my stuff is still there except for a gig or so at the beginning of the disk. Thank you for your assistance and I'll be checking back if anything comes to you! – Moogus Show Mar 23 '20 at 01:02
  • I'm so sorry you had to go through this. Loosing data is a such a horrible feeling. My suggestion is to implement a backup strategy from now on so that this is much less likely to happen in the future. For the cost of an external USB drive of a few TB in size (like 3 TB in your case would be enough) you can have incremental (over time) backups of all your files. I have outlined one way here: https://unix.stackexchange.com/a/567933/7816 let me know if you need any help setting up something like this. (Anything to avoid that data loss feeling again, right?) – Azendale Apr 06 '20 at 00:58
  • Yes, after all this (of course) I am playing around with the Xubuntu 20.04 daily build and what do I see? ZFS. I didn't know what it was, so I read about it and it sure sounds useful. Just a little too late for me. Live and learn! Thx! – Moogus Show Apr 06 '20 at 02:28

0 Answers0