[linux-lvm] sector zero on a Logical Volume
Bryn M. Reeves
bmr at redhat.com
Mon Jul 14 10:34:08 UTC 2008
-----BEGIN PGP SIGNED MESSAGE-----
Gene Czarcinski wrote:
> I am hoping that someone on this mailing list is expert enough to answer my
> Is there any reason that sector 0 on a Logical Volume should not be all zeros?
All depends what you are doing with it. Many file systems and other
block device users avoid using this sector because it may be "shared"
with the firmware on x86 but there's no requirement for it to be
reserved like this. Ext2/3 are fine (they start in the 1st sector) as
would be LVM2 - e.g. if you were using the LV to provide a physical
volume for a virtualised system.
> My problem occurred when I effectively dd'ed a real disk partition on which
> grub is installed to a Logical Volume. When grub in installed into a
> partition, it not only installs it's boot code but also makes sector 0 on
> that partition have a fake "msdos" partition table and the kernel (and other
> software) does not like that at all!!
It is not a "fake" msdos partition table, it's a real one. The
conventions for x86 boot loaders require a partition table since the MBR
(master boot record) consists of a 512 byte sector containing 446 bytes
of executable code followed by the four-entry primary partition table.
You can't install grub without an MBR/partition table so when you
attempt to install it to a device that lacks one grub will lay down a
skeleton MBR on the device.
> My solution was to use dd to zero sector 0 and then everything worked ...
> could mount the Logical Volume, etc.
Shouldn't be a problem for anything that doesn't store data in this
sector. Just be sure to limit the command to only wipe sector 0.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the linux-lvm