Re: lvm, config and commandline

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/


[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux