linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Milan Broz <mbroz@redhat.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Cc: xake@rymdraket.net
Subject: Re: [linux-lvm] lvm, config and commandline
Date: Thu, 27 Jan 2011 17:24:39 +0100	[thread overview]
Message-ID: <4D419C47.202@redhat.com> (raw)
In-Reply-To: <061e0b45500b99a3f38b4bfa88a9a591.squirrel@webmail.rymdraket.net>

On 01/27/2011 10:37 AM, xake@rymdraket.net wrote:
> I have a system with a script at bootup currently running something like
> "lvm pvscan && lvm vgscan && lvm vgchange -ay" all with the option
> "--config 'global { locking_dir = "/dev/.lvm" }'" since when the script
> runs /var/lock is not in a writeable state. --ignorelockingfailures is
> fine, but gives a message on stderr I do not want, but I still want to get
> other error messages so "2>/dev/null" is not an option.

Use --sysinit instead of --ignorelockingfailure, no need to set that
locking dir at all in this phase.

If you have some strange messages paste them here, --sysinit is exactly
here to handle read-only device boot problem.
(seems it is just poorly documented...)

Moreover, pvscan and vgscan are NOOP here, because it updates
lvm cache, not possible on read-only system.

All you want is probably:
/sbin/lvm vgchange -a y --sysinit


> I realized however that if I run this as a script using lvm as interpreter
> (running lvm once and the commands inside of lvm) I cut the time for this
> script in half.
> 
> But with that I have the following problem:
> 
> # echo "pvscan --config 'global { locking_dir = "/dev/.lvm" }'" | lvm

Do not do this. if there is lock dir set inlvm.conf to another directory,
it is just recipe for data corruption.

Do not use --config at all, there are only very special cases when it is needed
system init is not one of them.

> Also, would it not also make sens to have --config an option working
> directly on lvm (something like "lvm --config "something" <command>)?

it works this way for one command: lvm <command> --config "something"
but not for the script mode.

Milan

  reply	other threads:[~2011-01-27 16:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-27  9:37 [linux-lvm] lvm, config and commandline xake
2011-01-27 16:24 ` Milan Broz [this message]
2011-01-27 17:55   ` xake
2011-01-27 21:34     ` Milan Broz
2011-01-28  8:53       ` Peter Hjalmarsson

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=4D419C47.202@redhat.com \
    --to=mbroz@redhat.com \
    --cc=linux-lvm@redhat.com \
    --cc=xake@rymdraket.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).