Init unable to mount root if it on lvm device, which is over mdadm
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
initramfs-tools (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
This bug appears follows:
Sometimes on linux-image-
Always on linux-image-
Always on linux-image-
I tried to interrupt init by inserting the following code:
/bin/sh
in '/usr/share/
# FIXME This has no error checking
# Mount root
mount ${roflag} ${FSTYPE:+-t ${FSTYPE} }${ROOTFLAGS} ${ROOT} ${rootmnt}
/bin/sh #I added this code here
if [ "$LOOP" ]; then
if [ "$mountroot_status" != 0 ]; then
and of course update initramfs after this.
dmsetup is correctly show logical volumes, by command `dmsetup ls`
sysraid-winxp (252, 5)
sysraid-
sysraid-
sysraid-
sysraid-
sysraid-
sysraid-zeus--home (252, 8)
sysraid-zeus--tmp (252, 2)
sysraid-
sysraid-zeus--swap (252, 1)
sysraid-
sysraid-backups (252, 7)
sysraid-
sysraid-
sysraid-
sysraid-
sysraid-lxc_pdc (252, 16)
But manual mount of root to /root of initram filesystem is break down by error that fs driver cannot find superblock.
I tried to mount all other existing partitions from volume group sysraid, but they also could not be mounted because of `bad superblock`
Then I tried to mount existing (/boot) partition from mdadm device (md0) and it was succesful.
After that i tried to refresh logical volume's by a command `/sbin/lvm vgchange --refresh` and then mount root succefull.
I decided to improve init script by following code in mountroot function in file
`/usr/share/
# Refresh volume group's if prev attempt failed
#
dmsetup -v info $ROOT | grep -q 'UUID: LVM'
if [ "$?" != "1" ] && [ "$mountroot_status" != 0 ] && [ -x /sbin/lvm ]
then
fi
It must be inserted after:
...
# FIXME This has no error checking
# Mount root
mount ${roflag} ${FSTYPE:+-t ${FSTYPE} }${ROOTFLAGS} ${ROOT} ${rootmnt}
#INSERT CODE HERE
if [ "$LOOP" ]; then
if [ "$mountroot_status" != 0 ]; then
...
What do you think about this hook?
Can I rely on the adoption of this patch in upstream?
---
ApportVersion: 2.0.1-0ubuntu17.6
Architecture: amd64
DistroRelease: Ubuntu 12.04
InstallationMedia: Ubuntu-Server 12.04.2 LTS "Precise Pangolin" - Release amd64 (20130214)
MarkForUpload: True
Package: initramfs-tools 0.99ubuntu13.4
PackageArchitec
ProcEnviron:
LANGUAGE=en_US:en
TERM=xterm
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcVersionSign
Tags: precise
Uname: Linux 3.8.0-35-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:
apport information