Bug 425764 - lvm tools missing from rescue mode
lvm tools missing from rescue mode
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: lvm2 (Show other bugs)
5.3
All Linux
low Severity high
: ---
: ---
Assigned To: Milan Broz
Corey Marthaler
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-12-15 00:59 EST by Chris Pepper
Modified: 2013-02-28 23:06 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-01-04 07:44:59 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Chris Pepper 2007-12-15 00:59:22 EST
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 04:47:41 EST
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 08:26:02 EST
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 07:44:59 EST
"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 11:06:15 EST
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 11:15:35 EST
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 11:17:46 EST
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 13:12:09 EST
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 13:24:30 EST
The ref to lvm(8) is missing in the SEE ALSO section there.  Will fix.
Comment 9 Alasdair Kergon 2008-01-04 13:31:42 EST
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 13:32:58 EST
Or "This man page should be read in conjunction with lvm (8)."
Comment 11 Chris Pepper 2008-01-04 14:19:39 EST
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.