This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 125405 - Anaconda fails because of hyphen in previous LVM1 root partition name
Anaconda fails because of hyphen in previous LVM1 root partition name
Status: CLOSED DEFERRED
Product: Fedora
Classification: Fedora
Component: anaconda (Show other bugs)
2
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Chris Lumens
Mike McLean
:
: 489428 (view as bug list)
Depends On:
Blocks: 133260
  Show dependency treegraph
 
Reported: 2004-06-06 09:01 EDT by major
Modified: 2009-03-10 11:40 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-03-10 14:27:00 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description major 2004-06-06 09:01:06 EDT
Description of problem:
When updating from Fedora Core 1 to Fedora Core 2, I received a
failure because of a previous logical volume management version 1
(LVM1) installation that used a hyphen in the logical volume name for
the root partition.

Version-Release number of selected component (if applicable):
anaconda on the FC2-i386-disc1.iso CD

How reproducible:
My previous logical volume names were "lv-ROOT", "lv-SWAP", "lv-home",
"lv-tmp", "lv-usr", and "lv-var". The volume group was called "vg0". I
presume that any logical volume root partition with a hyphen in the
name will reproduce the problem. I am unsure if hyphens in the
non-root partition names will also cause problems.

Actual results:
########################################
Traceback (most recent call last):
  File "/usr/lib/anaconda/gui.py", line 1048, in handleRenderCallback
    self.currentWindow.renderCallback()
  File "/usr/lib/anaconda/iw/progress_gui.py", line 242, in renderCallback
    self.intf.icw.nextClicked()
  File "/usr/lib/anaconda/gui.py", line 763, in nextClicked
    self.dispatch.gotoNext()
  File "/usr/lib/anaconda/dispatch.py", line 169, in gotoNext
    self.moveStep()
  File "/usr/lib/anaconda/dispatch.py", line 237, in moveStep
    rc = apply(func, self.bindArgs(args))
  File "/usr/lib/anaconda/packages.py", line 521, in doMigrateFilesystems
    thefsset.makeLVMNodes(instPath, trylvm1 = 1)
  File "/usr/lib/anaconda/fsset.py", line 1500, in makeLVMNodes
    iutil.copyDeviceNode(dmdev, instPath + dmdev)
  File "/usr/lib/anaconda/iutil.py", line 403, in copyDeviceNode
    filestat = os.lstat(src)
OSError: [Errno 2] No such file or directory: '/dev/mapper/vg0-lv-ROOT'
 
Local variables in innermost frame:
dest: /mnt/sysimage/dev/mapper/vg0-lv-ROOT
src: /dev/mapper/vg0-lv-ROOT
######################################## 

Expected results:
I expected a correct update of LVM1 without the device mapper to LVM2
with the device mapper.

Additional info:
The "copyDeviceNode" function eventually calls LVM2 activation code,
the source code of which can be found in the "dev_manager.c" file of
"LVM2/lib/activate" in the LVM2 source tree. When making the device
mapper node entries, if any hyphens are found in the logical volume
names, then those are "quoted" by replacing each with two hyphens. The
"/dev/mapper/vg0-lv-ROOT" entry would be created as
"/dev/mapper/vg0-lv--ROOT". One hyphen would be expected by the
calling script, not two.

As a work-around, I used the "lvrename" command to change the hyphens
into underscores (e. g., "lv-ROOT" to "lv_ROOT"), then changed
"/etc/fstab", the GRUB boot line, and the initial ramdisk image to
correspond. When trying with underscores instead of hyphens, I
encountered no problems.

Since LVM2 activation code regards hyphens in logical volume names as
special, I recommend using anaconda to replace those hyphens as I did.
Comment 1 Mark Wilkinson 2004-06-23 16:03:08 EDT
I've experienced the same problem, although for me it was because my
volume group names contain hyphens (/dev/vg-main). I get the same
traceback trying to open /dev/mapper/vg-main-root. From the shell I
can see that /dev/mapper/vg--main-root exists.
Comment 2 Chris Lumens 2005-03-10 14:27:00 EST
Unfortunately, solving this problem is rather complicated as you explained. 
It's not just a simple matter of changing the name of the logical volume - the
bootloader configs need to be updated, the fstab needs changing, and so forth. 
What's unfortunate is that the dash gained some special significance, making
moving to the newer version more difficult.
Comment 3 Chris Lumens 2009-03-10 11:40:02 EDT
*** Bug 489428 has been marked as a duplicate of this bug. ***

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