Bug#280571: initrd-tools: Should initialize only LVM VG needed for root fs, not all
Hello again,
On Mon, Nov 15, 2004 at 12:51:00PM +0900, Horms wrote:
> On Fri, Nov 12, 2004 at 02:43:35PM +0100, Christian Grigis wrote:
> > Hello Horms,
> >
> > On Thu, Nov 11, 2004 at 03:14:55PM +0900, Horms wrote:
> > > thanks for your bug report and patch. The fix looks good to me.
> > > However, not being that familiar with LVM, can you shed some
> > > light on how the other VG are activated on your system with this
> > > patch in place.
> >
> > On my system this is taken care of during system initialization by the
> > /etc/init.d/lvm script (from lvm-common), that includes the following
> > line in the "start" case:
> >
> > /sbin/vgchange -a y $IGNORELOCKINGFAILURES
>
> Thanks, in that case your patch looks good to me.
> I will put it into SVN and it should appear in the next release
> unless someone objects in the mean time.
Actually I might object myself ;-)
Investigating a little more, I noticed that the problem I
encountered happened when I used "ROOT=..." with my real root in
/etc/mkinitrd/mkinitrd.conf .
When using "ROOT=probe", mkinitrd looks for the root partition as
well as the swap partition (as I understand it, to support 'swsusp' in
/sbin/init; should it not do it also when ROOT is specified?), and it
results in only one "vgchange -a y" statement even though they are on
different VG's on my system:
----------------------------------%<----------------------------------------
mdadm -A /devfs/md/2 -R -u 3db50521:79bda182:325e3159:21db9fcb /dev/sda3 /dev/sdb3
mdadm -A /devfs/md/1 -R -u 66bacdea:b29e1df0:5c703c3d:c9770544 /dev/sda2 /dev/sdb2
mkdir /devfs/vgunsafe
mount_tmpfs /var
if [ -f /etc/lvm/lvm.conf ]; then
cat /etc/lvm/lvm.conf > /var/lvm.conf
fi
mount_tmpfs /etc/lvm
if [ -f /var/lvm.conf ]; then
cat /var/lvm.conf > /etc/lvm/lvm.conf
fi
mount -nt devfs devfs /dev
vgchange -a y vgunsafe
umount /dev
umount -n /var
umount -n /etc/lvm
ROOT=/dev/vgsafe/root
mdadm -A /devfs/md/1 -R -u 66bacdea:b29e1df0:5c703c3d:c9770544 /dev/sda2 /dev/sdb2
----------------------------------%<----------------------------------------
[ /dev/sda2 and /dev/sdb2 make up /dev/md1 in raid1, with 'vgsafe' VG on top
/dev/sda3 and /dev/sdb3 make up /dev/md2 in raid0, with 'vgunsafe' VG on top
my root is in /dev/vgsafe/root, my swap is in /dev/vgunsafe/swap ]
Having vgchange setup only vgunsafe is incorrect in this case. It is
however also incorrect to set them all up, because there is only a "mkdir"
for one of them.
This is because lvm() is allowed to run only once.
Allowing lvm() to run more than once results in:
----------------------------------%<----------------------------------------
mdadm -A /devfs/md/2 -R -u 3db50521:79bda182:325e3159:21db9fcb /dev/sda3 /dev/sdb3
mdadm -A /devfs/md/1 -R -u 66bacdea:b29e1df0:5c703c3d:c9770544 /dev/sda2 /dev/sdb2
mkdir /devfs/vgunsafe
mount_tmpfs /var
if [ -f /etc/lvm/lvm.conf ]; then
cat /etc/lvm/lvm.conf > /var/lvm.conf
fi
mount_tmpfs /etc/lvm
if [ -f /var/lvm.conf ]; then
cat /var/lvm.conf > /etc/lvm/lvm.conf
fi
mount -nt devfs devfs /dev
vgchange -a y vgunsafe
umount /dev
umount -n /var
umount -n /etc/lvm
ROOT=/dev/vgsafe/root
mdadm -A /devfs/md/1 -R -u 66bacdea:b29e1df0:5c703c3d:c9770544 /dev/sda2 /dev/sdb2
mkdir /devfs/vgsafe
mount_tmpfs /var
if [ -f /etc/lvm/lvm.conf ]; then
cat /etc/lvm/lvm.conf > /var/lvm.conf
fi
mount_tmpfs /etc/lvm
if [ -f /var/lvm.conf ]; then
cat /var/lvm.conf > /etc/lvm/lvm.conf
fi
mount -nt devfs devfs /dev
vgchange -a y vgsafe
umount /dev
umount -n /var
umount -n /etc/lvm
----------------------------------%<----------------------------------------
Which looks better, but I have yet to test it.
In other words, there are still a few issues...
Best regards,
-Christian
Reply to: