Cannot boot with root partition as logical volume with "-" in the name

Bug #19631 reported by Loic Pefferkorn on 2005-08-12
22
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
Critical
Jeff Bailey

Bug Description

I cannot boot my system using a logicial volume as root partition. This logical
volume has "-" character in the name.

Error at startup :

[4294672.010000] audit (1123767182.008:0): initialized
/init: 59: cannot open /sys/bus/scsi/devices/*/types: no such file
/dev/cdrom: openfailed: no medium found
/dev/cdrom1: open failed: no medium found
unable to find volume groups "iron-kubuntu-breezy"
alert: /dev/mapper/iron-kubuntu--breezy does not exist - dropping to a shell

Then I have busybox prompt.

fdisk -l :
/dev/hda1 1 4 32098+ 83 Linux
/dev/hda2 5 20023 160802617+ 8e Linux LVM

- /boot : is hda1
- / is a logical volume kubuntu-breezy inside volume group named iron.

$ sudo vgdisplay
Password:
  --- Volume group ---
  VG Name iron
  System ID
  Format lvm2
  Metadata Areas 1
  Metadata Sequence No 23
  VG Access read/write
  VG Status resizable
  MAX LV 0
  Cur LV 5
  Open LV 3
  Max PV 0
  Cur PV 1
  Act PV 1
  VG Size 153,35 GB
  PE Size 4,00 MB
  Total PE 39258
  Alloc PE / Size 25984 / 101,50 GB
  Free PE / Size 13274 / 51,85 GB
  VG UUID zR65U0-Yk4h-VqIt-miMD-VgNh-UsdS-byWCMk

$ sudo lvdisplay
  --- Logical volume ---
  LV Name /dev/iron/kubuntu-breezy
  VG Name iron
  LV UUID 9nDeyI-ST71-AnX1-QFfu-dzrG-GCL8-HJf7Op
  LV Write Access read/write
  LV Status available
  # open 0
  LV Size 10,00 GB
  Current LE 2560
  Segments 1
  Allocation inherit
  Read ahead sectors 0
  Block device 254:4

I have this problem on Breezy since 2005-08-11 upgrade (apt-get dselect-upgrade).
Reproduced with a freshly installed Hoary dist-upgraded to Breezy.

Matt Zimmerman (mdz) wrote :

Other users have confirmed this problem on ubuntu-devel / IRC. Do you know the
cause?

Stephen Shirley (kormat) wrote :

(In reply to comment #1)
> Other users have confirmed this problem on ubuntu-devel / IRC. Do you know the
> cause?

I think i see it. In the initramfs, the /scripts/local-top/lvm script contains this
line:
    vg=$(echo ${ROOT} | sed -e 's#/dev/mapper/\(.*\)-.*#\1#')
and then runs
    vgchange -ay ${vg}
which throws up the error 'Unable to find volume group...etc'

So, the above sed needs to be something more like:
    sed -e 's#/dev/mapper/\(.*[^-]\)-[-]\?[^-]*#\1#'
which should handle vgvgvg-lvlvl, vg-vg-vg-lv, vgvgvg--lvlvlv, etc.

Stephen Shirley (kormat) wrote :

Er. Realised this morning that my proposed solution could do with some work.

I'm taking a guess that the mapping used by /dev/mapper is vgname-lvname,
where any -'s in either vgname or lvname are doubled. For example, on my
system here, /dev/linuxvg/hoary-std becomes /dev/mapper/linuxvg-hoary--std.
If we want to keep that convention for breezy, then the following sed
statement should do the trick:

sed -e 's#/dev/mapper/\(.*\)\([^-]\)-[^-].*#\1\2#'

I've tested it with the following inputs:
/dev/mapper/vgname-lvname
/dev/mapper/vg--name-lvname
/dev/mapper/vg--na--me-lvname
/dev/mapper/vgname-lv--name
/dev/mapper/vgname-lv--na--me
/dev/mapper/vg--name-lv--name
/dev/mapper/vg--na--me-lv--na--me

And i get the following results:
vgname
vg--name
vg--na--me
vgname
vgname
vg--name
vg--na--me

So, i _think_ that should do it. Comments please ,-)

Jeff Bailey (jbailey) wrote :

(In reply to comment #3)
> Er. Realised this morning that my proposed solution could do with some work.

Sweet, thanks. I've put this in initramfs-tools 0.23. Hopefully this fixes the
problem.

I'll leave this bug open for now until I get a success report. I don't have a
volume group or logical volume in this config to test with right now.

Tks,
Jeff Bailey

Jeff Bailey (jbailey) wrote :

I've seen no followup on this bug (No further complaints, no success reports),
but I've applied the proposed fix. Closing this bug for now. Feel free to
reopen if I'm wrong!

Tks,
Jeff Bailey

Loic Pefferkorn (loic) wrote :

Still doesn't works.

Unable to find volume group "hydrus-colony-"
ALERT! /dev/mapper/hydrus-colony--foo does not exists. Dropping to a shell!

vgname: hydrus
lvname colony-foo

menu.lst: root=/dev/mapper/hydrus-colony--foo
fstab: /dev/mapper/hydrus-colony--foo /

Tollef Fog Heen (tfheen) wrote :

I'm now unable to reproduce this bug, even when doing a fresh hoary install and then upgrading.

Jeff Bailey (jbailey) wrote :

(In reply to comment #6)
> Still doesn't works.
>
> Unable to find volume group "hydrus-colony-"
> ALERT! /dev/mapper/hydrus-colony--foo does not exists. Dropping to a shell!

I have a success report as well as this failure report. Just to make sure, did
you make sure to regenerate your initramfs after you upgraded initramfs-tools?

Tks,
Jeff Bailey

Matt Zimmerman (mdz) wrote :

*** Bug 21314 has been marked as a duplicate of this bug. ***

Jeff Bailey (jbailey) wrote :

initramfs currently has no problem with - in the LV, but doesn't cope with it in
the VG. This will be fixed in the next upload (likely today, tomorrow at the
latest)

Jeff Bailey (jbailey) wrote :

Fixed in 0.26

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.