[svlug] Detecting 'virgin' disks ?

Ian Kluft ikluft at thunder.sbay.org
Tue Jul 26 13:29:52 PDT 2005

On Tue, Jul 26, 2005 at 07:39:41AM -0700, Steve wrote:
> Anyone know a 'safe' method for detecting 'virgin' disks (disks that 
> have never been formatted...)
> I'm doing an installer, which will have to run MBR on these disks in 
> addition to partitioning them.
> With a brand new disk, is the entire disk zeroed out ? (ie can I just dd 
> the MBR and compare it to all zero's or all ones ?

Well, I'm speculating... hopefully the ideas will be useful to you.

Before drawing conclusions, you'll probably need to check what people find
on their new drives from various manufacturers.  I would expect that the
results will vary with each manufacturer, maybe even among divisions of
a manufacturer.  You know they'll all do automated testing.  But there is
no standard about what to leave on the drive afterward, since the
assumption is the customer will usually wipe it out anyway.

The drives technically could be left with a specific test pattern (such
as all zeroes or something else) or formatted with an empty VFAT or NTFS
filesystem.  If it's a test pattern, then you have your answer.  If it's
an empty filesystem, you possibly could hazard a guess that it's a
new drive.  

I'd guess that if you look at what some of the manufacturers actually
ship, we'll probably all be surprised at some of the things you'll find.
So unfortunately, I think a single simple rule won't exist.

In the late 80's when I was in college, the university (CSU Chico) bought
some Mac hard drives that came with not only a filesystem but also a bunch
of free software for the Mac, all of it infected with viruses.  (Back then
Macs hadn't yet solved their virus problems.)  The university got back to
the manufacturer and helped them institute a virus-checking procedure
so that it wouldn't happen again.  But it shows what they were doing
with new drives even back then.

More information about the svlug mailing list