We decided to build a very small box to serve up an iSCSI target using LVM for the storage device. We used the root filesystem from here, which means that we are starting from a very basic system. We are using version 2.4.32 of the Linux kernel. Do consider Openfiler if you have more sophisticated needs. On the other hand, keeping things small, tight, and as independent as possible.
Anyway, we have upgraded the LVM on Red Hat systems before here, and many of the steps of the same; however, there are some differences since LVM didn’t exist before we started installing. Two components are needed: device mapper, and the LVM software. Grab device-mapper.1.02.07 from here.
Patch the kernel source tree:
sv-1# tar -xzf device-mapper.1.02.07.tgz sv-1# patch -p1 < /usr/src/device-mapper.1.02.07/patches/linux-2.4.28-pre4-devmapper-ioctl.patch patching file Documentation/Configure.help Hunk #1 succeeded at 1965 (offset -6 lines). patching file MAINTAINERS Hunk #1 succeeded at 581 (offset -4 lines). patching file arch/mips64/kernel/ioctl32.c . . . patching file mm/mempool.c patching file mm/vmalloc.c sv-1# |
Device mapper support will now show up:
sv-1# make menuconfig Linux Kernel v2.4.32 Configuration Multi-device support (RAID and LVM) [*] Multiple devices driver support (RAID and LVM) RAID support * Logical volume manager (LVM) support * Device-mapper support (NEW) Mirror (RAID-1) support |
Rebuild the kernel:
make dep clean bzImage |
Configure your boot loader and reboot for grins. Compile and install the device-mapper software:
sv-1# cd device-mapper.1.02.07 sv-1# ./configure checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu checking for gawk... gawk . . . config.status: creating kernel/Makefile config.status: creating man/Makefile config.status: creating po/Makefile config.status: creating include/configure.h sv-1# make make -C include make[1]: Entering directory `/usr/src/device-mapper.1.02.07/include' find . -maxdepth 2 -type l -exec rm -f \{\} \; for i in `cat .symlinks`; do ln -s $i ; done touch .symlinks_created ln -s ../../kernel/ioctl/dm-ioctl.h linux . . . ted-externs -Winline -O2 dmsetup.c -o dmsetup.o gcc -o dmsetup dmsetup.o -L../lib/ioctl \ -L../lib/ioctl -L/lib -ldevmapper make[1]: Leaving directory `/usr/src/device-mapper.1.02.07/dmsetup' sv-1# sv-1# make install make -C include make[1]: Entering directory `/usr/src/device-mapper.1.02.07/include' make[1]: Nothing to be done for `all'. . . . /usr/bin/install -c -D -o root -g root -m 555 dmsetup /sbin/dmsetup make[1]: Leaving directory `/usr/src/device-mapper.1.02.07/dmsetup' sv-1# ls /lib/libdev* /lib/libdevmapper.so /lib/libdevmapper.so.1.02 sv-1# |
See Compiling and Configuring LVM for the rest of the LVM installation.