Using Linux Logical Volume Manager with SDD

Using Linux Logical Volume Manager (LVM) with SDD
requires some configuration to ensure the correct behavior. LVM 2 (on 2.6 kernels, that is, SLES 9 and RHEL 4) requires some additional configuration that is discussed at the end of this section.

In order to use SDD with the Linux LVM, the SDD module must be loaded and vpath devices configured before LVM is loaded. This is because LVM has a dependency on SDD vpath devices, and therefore SDD must be loaded prior to LVM startup.

Note: This procedure will describe how to set up SDD to load before LVM using boot up scripts. This procedure might not work if LVM is loaded in the initrd (initial ramdisk). One common reason why LVM would be loaded in the initrd is because the system is booting off of an LVM device for it’s root disk. Supporting this type of environment requires that SDD also be placed

in the initrd, which is a process that is not described here.The procedures and requirements are different for SUSE and Red Hat.



Using LVM on SUSE
 
LVM with SDD on SLES 8 is only supported on LVM version lvm-1.0.5-129 or later. Upgrade your LVM to this version or later using the SUSE maintweb update. Your LVM will not work with SDD vpath devices correctly otherwise.
 
LVM 2 with SDD on SLES 9 will work after following the LVM 2-specific directions at the end of this section.
In order to get SDD to load before LVM, you need to load SDD at boot time using the bootup scripts. Follow the following steps:

1. cd /etc/init.d/
2. cp /opt/IBMsdd/bin/sdd.rcscript boot.sdd
3. Edit the boot.sdd file and add the following line to the beginning of the start function:
   mount -n -o remount,rw / 2> /dev/null

Because the SDD configuration utility (cfgvpath) needs to be able to write certain configuration parameters to the root disk , this line is needed to remount the root filesystem in read/write mode.

4. Add another line at the end of the start function to remount the root filesystem back into read only mode in order to restore the mount state before and after we get into this function. The system will itself remount the filesystem to read write at a later point in the boot process. This is the line to remount in read only mode:

mount -n -o remount,ro / 2> /dev/null (the only change from above is ro)

Your start function start should look like this:

start() {
                 mount -n -o remount,rw / 2> /dev/null # ADDED THIS LINE
                 echo -n "Starting $dev_name driver load: "
                 rm -f ${driver_dir}/${driver}.o
                 ...
                 mount -n -o remount,ro / 2> /dev/null # ADDED THIS LINE
          }


5. cd /etc/init.d/boot.d
6. Create a link named Sxxboot.sdd with xx being a number smaller than the one that is on the LVM boot script link. For example, the LVM on this system is at S04boot.lvm:

# ls -l | grep lvm

 lrwxrwxrwx 1 root root 11 Aug 12 17:35 S04boot.lvm -> ../boot.lvm*

Because LVM is loading up at S04, we need to set SDD to at least S03 in order to avoid this problem. Therefore we create a link to the boot.sdd file that we just modified:

# ln -s ../boot.sdd S03boot.sdd

Here are the results:
# ls -l
...
lrwxrwxrwx 1 root root 11 Mar 11 12:03 S03boot.sdd -> ../boot.sdd*
lrwxrwxrwx 1 root root 11 Aug 12 17:35 S04boot.lvm -> ../boot.lvm*
...

Because SUSE uses the numbering scheme to determine which script will be run first at boot time, we are ensuring that the SDD script will be run before the LVM script is run.

7. If you have SDD starting in the runlevel init scripts, you need to shut off the script. You can do this using the chkconfig command:

chkconfig -s sdd off

8. Configure LVM. Reboot the system and the LVM configuration should come up after reboot using SDD vpath devices.



Using LVM on Red Hat

LVM with SDD on RHEL 3 is only supported on LVM version lvm-1.0.8-14 or later. This is the LVM level that comes packaged with RHEL 3 Update 6. Upgrade your LVM to this version or later using the Red Hat up2date utility. Your LVM will not work with SDD vpath devices correctly otherwise.

LVM 2 with SDD on RHEL 4 will work after following the LVM 2-specific directions at the end of this section.
In order to get SDD to load before LVM, use the following steps to cause SDD to load at boot time.

1. Edit the file /etc/rc.sysinit.
2. Locate the block of commands that start with the following:

# Remount the root filesystem read-write.
update_boot_stage RCmountfs
state=`awk ’/ \/ / && ($3 !~ /rootfs/) { print $4 }’ /proc/mounts`
[ "$state" != "rw" -a "$READONLY" != "yes" ] && \
action $"Remounting root filesystem in read-write mode: " mount -n -o remount,rw /

# LVM initialization
...


3. Append the following to the end of the block of commands, before the # LVM initialization comment, or on RHEL 4, before the # LVM2 initialization comment:

# Starting SDD
/etc/init.d/sdd start

4. The affected section of the rc.sysinit file should look like this:

# Remount the root filesystem read-write.
update_boot_stage RCmountfs
state=`awk ’/ \/ / && ($3 !~ /rootfs/) { print $4 }’ /proc/mounts`
[ "$state" != "rw" -a "$READONLY" != "yes" ] && \
action $"Remounting root filesystem in read-write mode: " mount -n -o remount,rw /

# Starting SDD
/etc/init.d/sdd start

# LVM initialization
...


5. If you have SDD starting in the runlevel init scripts, you need to shut off the script. You can do this using the chkconfig command.

chkconfig sdd off

6. Configure LVM.
7. Reboot the system and the LVM configuration should come up after reboot using SDD vpath devices.



LVM 2 general configuration information

The information in this section only applies to systems running LVM version 2. This means that the system should be running a 2.6 kernel, such as SLES 9 or RHEL 4.

LVM2 refers to a new userspace toolset that provides logical volume management facilities on Linux. In order for LVM2 to work on your machine, you must have the LVM2 rpm installed; look on the OS install CD’s for the LVM2 package.

In order to get LVM2 to run with SDD, several changes must be made to the LVM configuration file /etc/lvm/lvm.conf. In this file, there are several fields that must be modified. As always, back up the file before attempting to modify it. Under the section devices, there are two values that must be modified.

1. Value of filter.
In the file, you might see the default as the following:

# By default we accept every block device except udev names:
filter = [ "r|/dev/.*/by-path/.*|", "r|/dev/.*/by-id/.*|", "a/.*/" ]


This filter is too broad for SDD, because it will recognize both SDD vpath devices as well as the underlying paths (that is, /dev/sdxxx) to that SDD vpath device. We want to narrow this regular expression to just accept vpath devices and not the underlying SCSI disk devices. The easiest way to do this is to modify the regular expression to just accept the name vpath, and to ignore all other types of devices. This is the simplest example. Adjust the example according to your environment.

filter = [ "a/vpath[a-z]*/", "r/.*/" ]

This regular expression will accept all vpath devices and reject all other devices under /dev.


2. Value of types.
In the file, you will see that it is commented out:

# List of pairs of additional acceptable block device types found
# in /proc/devices with maximum (non-zero) number of partitions.
# types = [ "fd", 16 ]


Delete the comment marker, and replace fd with vpath. This allows LVM to add vpath to its list of internally recognized devices. The partition number should stay at 16. For example:

types = [ "vpath", 16 ]

After making these two changes, save the lvm.conf file.

You should be able to run pvcreate on vpath devices (that is, /dev/vpatha) and create volume groups using vgcreate.

+ Recent posts