I had two USB drives containing the same files, but one was lost. I then flashed SteamOS onto the other drive because I planned to replace my SSD. I'm hoping the old files may still exist somewhere on the USB rather than being completely erased, possibly in another partition. Is there a safe way to access or recover them? I'm new to Linux and PC gaming, so I'm not sure where to start.
3 Answers
Flashing the SteamOS image likely overwrote at least part of the old data, so it may not simply be hidden in another partition. Stop using the USB immediately to avoid overwriting more files. If the data matters, make a full image of the drive first and attempt recovery from that image or a copy. PhotoRec can recover files by scanning for file signatures, while TestDisk may be able to reconstruct the old filesystem, but recovered filenames and folder structure may not survive.
Before running recovery tools, create a sector-by-sector image of the entire USB and work on the image instead of the original. For example, after identifying the correct device, a command such as `sudo dd if=/dev/sdX of=backup.img status=progress` can create an image. Be extremely careful with the device name, because reversing the input and output could overwrite another drive. Also, the whole device should generally be imaged rather than only one partition.
PhotoRec is worth trying, but it usually won’t restore everything exactly as it was. It may find file contents without the original names or folders, and a full scan can take quite a while. TestDisk is another useful option if the previous partition or filesystem metadata is still intact.

The files aren’t critical, mostly old college work and a game I made, so I’ll probably wait and hope the other USB turns up.