Bug#249330: lvm root
tags 249330 + patch
thanks
Martin Michlmayr wrote:
lilo-installer's postinst contains the following:
prefix=$(echo "$bootfs_devfs" | sed 's/\(\/dev\/[a-z]\+\).*/\1/')
disc_offered_devfs=$(find $prefix -name disc | head -n 1)
disc_offered=$(mapdevfs "$disc_offered_devfs")
I created root on /dev/vg00/root. So:
prefix=/dev/vg
other assigments will fail.
Thanks. Maybe you can come up with a patch.
Attached patch fixes this problem, I hope.
--
Eugeniy Meshcheryakov
Kyiv National Taras Shevchenko University
Information and Computing Centre
http://icc.univ.kiev.ua
Index: postinst
===================================================================
--- postinst (revision 15554)
+++ postinst (working copy)
@@ -20,11 +20,24 @@
df /target$1 | sed '1d;s/ .*//'
}
+lvm_vg () {
+ lvdisplay -c "$1"| sed 's/^[^:]*:\([^:]*\):.*$/\1/'
+}
+
+first_pv () {
+ pvdisplay -c|grep "^[^:]*:$1:" | sed 's/^ *\([^:]*\):.*$/\1/' | head -n 1
+}
+
# detect the partitions /target and /target/boot
rootfs_devfs=$(findfs /)
bootfs_devfs=$(findfs /boot)
rootfs=$(mapdevfs $rootfs_devfs)
+
+bootvg=$(lvm_vg $bootfs_devfs)
+if [ "$bootvg" ]; then
+ bootfs_devfs=$(first_pv $bootvg)
+fi
bootfs=$(mapdevfs $bootfs_devfs)
prefix=$(echo "$bootfs_devfs" | sed 's/\(\/dev\/[a-z]\+\).*/\1/')
Reply to: