On Tue, Feb 19, 2008 at 12:46:28PM +0000, Daniel P. Berrange wrote:
On Tue, Feb 19, 2008 at 03:43:11AM -0500, Daniel Veillard wrote:
> > +
> > + /*
> > + * LVM requires that the first 512 bytes are blanked if using
> > + * a whole disk as a PV. So we just blank them out regardless
> > + * rather than trying to figure out if we're a disk or partition
> > + */
>
> is it really 512 or the block size on the device used ? But 512 is
> probably sufficient for LVM to consider it cleared, just wondering ...
The 'pvcreate' man page explicitly says the first sector
<quote>
For whole disk devices only the partition table must be erased,
which will effectively destroy all data on that disk. This can
be done by zeroing the first sector with:
dd if=/dev/zero of=PhysicalVolume bs=512 count=1
</quote>
So 512 is fine for MSDOS partition tables at least.
Ahh, the legacy :-) thanks for the explanations !
Daniel
--
Red Hat Virtualization group
http://redhat.com/virtualization/
Daniel Veillard | virtualization library
http://libvirt.org/
veillard(a)redhat.com | libxml GNOME XML XSLT toolkit
http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine
http://rpmfind.net/