[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: 2.6 kernel



On Tue, Dec 16, 2003 at 07:02:18PM +0100, Matthias Saou wrote:
> Speaking of device-mapper : With a FC1 system w/ Arjan's 2.6 kernel and
> related packages, I managed to not have the main /dev/mapper/control node
> to get device mapper working (where or when is it created?) nor did the
> dm_mod kernel module get automatically loaded when I started trying to set
> up the lvm2 volumes.
 
The device number is dynamic, so it ought to be recreated on each boot.
See initscripts-7.43-1, file /etc/rc.d/rc.sysinit, lines 344-353:

# LVM2 initialization
if [ -d /etc/lvm/ -a -x /sbin/lvm ]; then
    if ! LC_ALL=C fgrep -q "device-mapper" /proc/devices 2>/dev/null ; then
        modprobe dm-mod >/dev/null 2>&1
    fi
    /bin/rm -f /dev/mapper/control
    echo "mkdmnod" | /sbin/nash --quiet >/dev/null 2>&1
    if [ -e /dev/mapper/control -a -x /sbin/lvm ]; then
        action $"Setting up Logical Volume Management:" /sbin/lvm vgscan --mknodes && /sbin/lvm vgchange -a 
y
    fi
fi

You need to install initscripts-7.43-1, mkinitrd-3.5.15.1,
device-mapper-1.00.07-1, and lvm2-2.00.08-1, and then create /etc/lvm.
(initscripts-7.43-1 has an implicit dependence on the nash mkdmnod command.
 Also, the lvm2 manpages conflict with the lvm manpages; repackage as necessary).

Once you've done that, dm-mod will be loaded and /dev/mapper/control created
on next reboot.

Note that if you are using root-on-LVM with 2.4/LVM1 -> 2.6/DM/LVM2, then
you need to install mkinitrd-3.5.15.1 and hack up /sbin/mkinitrd, 
something like:

--- /sbin/mkinitrd      2003-12-05 21:25:12.000000000 -0500
+++ /var/tmp/mkinitrd   2003-12-09 14:36:53.000000000 -0500
@@ -373,12 +373,6 @@
 
 # If we use LVM, include lvm-mod
 if [ -z "$nolvm" ]; then
-    if [ -f /proc/lvm/global  ]; then
-        if  grep -q '^VG:' /proc/lvm/global ; then
-           findmodule -lvm-mod
-        fi
-    fi
-
     if [ -x /sbin/dmsetup ]; then
        dmout=$(/sbin/dmsetup ls)
        if [ "$dmout" != "No devices found" ]; then
@@ -446,8 +440,7 @@
 elif ! echo $rootdev | cut -c1-6 |grep -q "LABEL=" ; then
     rootdev=$(echo "readlink $rootdev" | /sbin/nash --quiet)
     major=`ls -l $rootdev | sed -e "s/.* \\([0-9]\+\\), *[0-9]\+.*/\\1/"`
-    [ "$major" != "58" ] || root_lvm=1
-    if echo $rootdev |grep -q /dev/mapper 2>/dev/null ; then root_lvm2=1 ; fi
+    root_lvm2=1
 fi
 
 rootfs=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $3; }}' $fstab)
@@ -456,9 +449,6 @@
 # in case the root filesystem is modular
 findmodule -${rootfs}
 
-if [ -n "$root_lvm" ]; then
-    findmodule -lvm-mod
-fi
 if [ -n "$root_lvm2" ]; then
     findmodule -dm-mod
 fi

Then you can

   mount --bind /var/tmp/mkinitrd /sbin/mkinitrd
   rpm -ivh kernel-2.6.0-0.test11.1.102.i686.rpm
   umount /sbin/mkinitrd

or simply install the kernel and run:

   rm -f /boot/vmlinuz-2.6.0-0.test11.1.102.img     
   /var/tmp/mkinitrd -v /boot/vmlinuz-2.6.0-0.test11.1.102.img 2.6.0-0.test11.1.102

You will still have the problem that the LVM2 tools will not overwrite
real files in, e.g., the /dev/vg0/ directory; it will only overwrite symlinks.  One
possibility is to move these files elsewhere, e.g., /dev/lvm1/vg0/,
and create symlinks,

   mkdir /dev/lvm1
   cp -a /dev/vg0 /dev/lvm1
   cd /dev/vg0 && ln -sf ../../lvm1/vg0/* /dev/vg0

before rebooting from 2.4 into 2.6.

Regards,

	Bill Rugolsky




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]