Can virus, malware etc make it through a format?

okppko

Distinguished
Nov 6, 2009
347
0
18,790
This question goes for win 7 vista xp and linux distributions.

If you format an usb memory stick or a hard drive, can any virus malware,
etc survive that, and still be on the storage device?
Thank you.
 
It's certainly possible. A "quick" format only rewrites certain structures on the disk but leaves most of the data unchanged. And you should never overlook the possibility that a clever virus may be intercepting the normal Operating System commands. "Format" may not be doing what you expect it to.
 

plasmastorm

Distinguished
Oct 18, 2008
726
0
19,160
Simple answer is yes, yes they can survive.
However it is unlikely, it's more likely that your HDD may be faulty if you are still experiencing issues after a format or that any virus may be on another partition of the same drive.
 

randomizer

Champion
Moderator
dd if=/dev/random of=/dev/sdX

Don't expect to find anything useful on the drive after that, not even a partition table. Just make sure you don't specify the wrong drive for "of" or you can kiss your good data goodbye as well. If a virus happens to hijack dd, well, you should probably worry about your flash drive later.
 

okppko

Distinguished
Nov 6, 2009
347
0
18,790
Thank you for the answers.
I thought virus couldn't get through a format. I now understand it can. That makes it difficult to get a safe
usb stick.
So what if you fill up the usb stick with data files after deleting the usb stick? That won't work, because
the virus can be written in a way, so it actually doesn't get overwritten?

To clearify, I'm not asking this quistion because I suspect I have a virus problem on a usb stick. It was
a general question, whether you can make a usb stick, that you reason not to trust, safe again.
But it seems you can't.
Thanks.