Bug 425764 - lvm tools missing from rescue mode
Summary: lvm tools missing from rescue mode
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: lvm2
Version: 5.3
Hardware: All
OS: Linux
low
high
Target Milestone: ---
: ---
Assignee: Milan Broz
QA Contact: Corey Marthaler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-12-15 05:59 UTC by Chris Pepper
Modified: 2013-03-01 04:06 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-01-04 12:44:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Chris Pepper 2007-12-15 05:59:22 UTC
Description of problem:
I am trying to repair a system using LVM and software RAID. I booted from the 5.1 CD in rescue mode, 
but the LVM tools are largely missing.

Version-Release number of selected component (if applicable):


How reproducible:
Always.

Steps to Reproduce:
1. Boot from 5.1 disc1.
2. linux rescue
3. pvs, lvdisplay

4. lvm dumpconfig, lvm.static dumpconfig

Actual results:
3. Commands not found.

4. No output.

Expected results:
LVM tools should be available, so I can find my PVs, VGs, and LVs. Right now I can't even tell which 
subpartition contains /.

Additional info:

Comment 1 Alasdair Kergon 2007-12-15 09:47:41 UTC
Prefix every command with 'lvm' or 'lvm.static' to run it, like 'lvm.static pvs'.

'lvm dumpconfig' produces no output if it does not find a configuration file.

(Can set environment variable LVM_SYSTEM_DIR to provide alternative location for
the '/etc/lvm' directory.)


Comment 2 Chris Pepper 2007-12-15 13:26:02 UTC
Thanks; I thought I tried "lvm pvs", but perhaps I didn't try with lvm.static. Why doesn't lvm.static by itself 
give me an LVM shell, as the manual page says it should?

The various manual pages (pvs, lvdisplay, etc.) should have notes explaining how to use them as suffixes.

Comment 3 Milan Broz 2008-01-04 12:44:59 UTC
"lvm pvs" works as expected from RHEL 5.1 rescue mode (rescue boot CD).

lvm binaries are static (lvm is symlink to lvm.static) and are compiled without
subshell support.

Anyway, you can run "lvm help" to show available commands, command agruments are
exactly the same like if using directly 
(IOW: "lvm pvs <args>" = "pvs <Args>" etc. Try u.e. "lvm pvs --help")



Comment 4 Chris Pepper 2008-01-04 16:06:15 UTC
But the documentation tells people to use 'pvs', etc., and this doesn't work in rescue mode. Either the 
manual pages should have a NOTE or BUGS, telling people the alternate invocation in rescue mode, or the 
thinks like 'pvs' should at least produce a message telling people to preced with 'lvm ', or the 
documentation should describe the 'lvm ' prefix so the documented commands are usable in all 
environments.

Comment 5 Alasdair Kergon 2008-01-04 16:15:35 UTC
Which documentation for rescue mode doesn't mention this?  Raise an 
enhancement request against whichever package supplies that.

The lvm(8) man page does cover this:
   SYNOPSIS
      lvm [command | file]
then goes on to explain the shortcut if you have links to it with different 
command names.


Comment 6 Alasdair Kergon 2008-01-04 16:17:46 UTC
Regarding lvm.static, that is deprecated and should disappear from 
fedora/RHEL6 as soon as the right people find time to update 
mkinitrd/initscripts etc. not to use it any more.

Comment 7 Chris Pepper 2008-01-04 18:12:09 UTC
If I knew the required command invocation syntax was different in rescue mode, I wouldn't have needed the manual page! ;)

The lvm subcommand manual pages under RHEL5, such as pvs(8), do not mention the "lvm " prefix.

[root@hinfo ~]# man pvs|cat
PVS(8)                                                                  PVS(8)



NAME
       pvs - report information about physical volumes

SYNOPSIS
       pvs  [--aligned]  [-d/--debug]  [-h/-?/--help] [--ignorelockingfailure]
       [--noheadings] [--nosuffix] [-o/--options [+]Field[,Field]]  [-O/--sort
       [+/-]Key1[,[+/-]Key2[,...]]]   [--separator  Separator]  [--unbuffered]
       [--units  hsbkmgtHKMGT]  [-v/--verbose]   [--version]   [PhysicalVolume
       [PhysicalVolume...]]

DESCRIPTION
       pvs produces formatted output about physical volumes.

OPTIONS
       See lvm for common options.

       --aligned
              Use with --separator to align the output columns.

       --noheadings
              Suppress  the  headings  line that is normally the first line of
              output.  Useful if grepping the output.

       --nosuffix
              Suppress the suffix on output sizes.  Use with --units (except h
              and H) if processing the output.

       -o, --options
              Comma-separated  ordered list of columns.  Precede the list with
              ’+’ to append to the default selection of columns.  Column names
              are:  pv_fmt,  pv_uuid,  pv_size,  dev_size,  pv_free,  pv_used,
              pv_name, pv_attr, pv_pe_count, pv_pe_alloc_count, pv_tags.   The
              "pv_" prefix is optional.  Columns mentioned in vgs (8) can also
              be chosen. The pv_attr bits are: (a)llocatable and e(x)ported.

       -O, --sort
              Comma-separated ordered list of columns to  sort  by.   Replaces
              the  default  selection. Precede any column with - for a reverse
              sort on that column.

       --separator Separator
              String to use to separate each column.  Useful if  grepping  the
              output.

       --unbuffered
              Produce  output  immediately  without  sorting  or  aligning the
              columns properly.

       --units hsbkmgtHKMGT
              All  sizes  are  output  in   these   units:   (h)uman-readable,
              (s)ectors,   (b)ytes,   (k)ilobytes,  (m)egabytes,  (g)igabytes,
              (t)erabytes.  Capitalise to use multiples of 1000 (S.I.) instead
              of 1024.  Can also specify custom (u)nits e.g.  --units 3M

SEE ALSO
       pvdisplay(8), lvs(8), vgs(8)



Sistina Software UK                LVM TOOLS                            PVS(8)


Comment 8 Alasdair Kergon 2008-01-04 18:24:30 UTC
The ref to lvm(8) is missing in the SEE ALSO section there.  Will fix.

Comment 9 Alasdair Kergon 2008-01-04 18:31:42 UTC
So "See lvm for common options" isn't enough, and the man pages should also 
say something like "This man page include information that is specific to the 
pvs command.  For general information about the LVM2 toolset see lvm (8)." ?

Comment 10 Alasdair Kergon 2008-01-04 18:32:58 UTC
Or "This man page should be read in conjunction with lvm (8)."

Comment 11 Chris Pepper 2008-01-04 19:19:39 UTC
A SEE ALSO reference and "This man page should be read in conjunction with lvm(8)." would be good. 
Even better if you say something in pvs(8) (and all the other subcommand pages) to tip off readers that 
"pvs" == "lvm pvs", but not absolutely necessary.



Note You need to log in before you can comment on or make changes to this bug.