[svlug] Detecting 'virgin' disks ?

J. Paul Reed preed at svlug.org
Tue Jul 26 16:25:44 PDT 2005


On 26 Jul 2005 at 07:39:41, Steve arranged the bits on my disk to say:

> 
> 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 ?

You could look at the anaconda source to see what it does. It has a message
it throws up where it says "The partition table on device %s was unreadable
This disk is uninitialized"

It's using some heuristic, based upon information from parted when the disk
is queried. I suppose that's *like* a standard. ;-)

Later,
Paul
--
President
Silicon Valley Linux Users' Group
preed at svlug.org




More information about the svlug mailing list