All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Bryn M. Reeves" <bmr@redhat.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] sector zero on a Logical Volume
Date: Mon, 14 Jul 2008 11:34:08 +0100	[thread overview]
Message-ID: <487B2BA0.8010501@redhat.com> (raw)
In-Reply-To: <200807131751.57651.gene@czarc.net>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Gene Czarcinski wrote:
> I am hoping that someone on this mailing list is expert enough to answer my 
> question:
> 
> 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.

Regards,
Bryn.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFIeyug6YSQoMYUY94RAurDAJ4keJuVilimG/ftZbFLt18PP6btEQCfUrSL
cSAZeVbaOwxI+uySMI8qzWQ=
=hDCA
-----END PGP SIGNATURE-----

  reply	other threads:[~2008-07-14 10:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-13 21:51 [linux-lvm] sector zero on a Logical Volume Gene Czarcinski
2008-07-14 10:34 ` Bryn M. Reeves [this message]
2008-07-14 21:14   ` Gene Czarcinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=487B2BA0.8010501@redhat.com \
    --to=bmr@redhat.com \
    --cc=linux-lvm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.