I had my USB hard drive partitioned with ext4. Then I accidentally did
mkswap /dev/sda1 swapon /dev/sda1
Now I cannot mount my drive and it seems like my data is gone. Is there any way to recover?
Per comments below, I am trying qphotorec. However, I think I will have to go buy another drive and recover all files to it, since I'm running low on space; I'll report back later.
But I did run it a little bit, and it's finding a lot of stuff that wasn't there so it's a bit confusing. Like jpg, txt, and zip files that I'm pretty sure were never on that drive. But I'll have to recover all to really see what all it finds.
FYI: It was NTFS, then I reformatted to EXT4 (had backed up the NTFS drive then restored to the EXT4 after reformatting), then did the accidental mkswap, I didn't think photorec would find the NTFS partition but I guess it did.