Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question on Patching the Unix kernel to support LVM 1.0.1-rc4

Status
Not open for further replies.

pham

Technical User
Aug 10, 2001
16
US
Hi,

If anyone has ever installed the Linux LVM (by sistina) on a red hat linux (v7.1), kernel version 2.4.2-2, please shed some light on how I can "patch the kernel". My problem is after untarring the lvm_1.0.1-rc4.tar file, and trying to run ./configure, the system came back with an error message: "linuxver - /usr/src/linux/Makefile does not exists". I manually create the directory /usr/src/linux and run the command again (this time with the option --with-kernel_dir). I then get the error message: "linuxver: Unable to determine version of linux kernel in /usr/src/linux. ***Unable o determine version of linux to build patches for ***". What am I missing here? How can I get over this stage?

Thanks in advance.

Steve
 
Hi,













In case its not obvious, a patch of this kind is a source code patch. You would need to have the kernel source code unpacked in the usual place (/usr/src/linux) or point at where else it might be with the --with-kernel_dir option. When you run the patch it will do things like place new source somewhere in the source tree, possibly amend existing program source, and amend the configuration files so that you have the option available when you come to do 'make xconfig' etc.













What the ./configure (etc.) does is create a kernel patch for that specific kernel version (. Note that it says at the end of the configure instructions - "You should now have a patch called lvm-1.0.1-rc4-${KERNELVERSION}.patch in the patches directory." Its not too clear if you're unfamiliar with patches but you would then have to apply the patch against the kernel source and build a customised kernel.













In fact, kernels from 2.4.10 onwards have had lvm already merged into the source tree so you might just want to get the latest kernel source and build that. (in the xconfig its 'Multi Device Support (RAID and LVM)'













Just download this to /usr/src :






ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-2.4.13.tar.bz2













Then do :













tar jxvf linux-2.4.13.tar.bz2






mv linux linux-2.4.13






ln -s linux-2.4.13 linux






cd linux






make oldconfig






make xconfig (or make menuconfig) - choose all relevant options






make dep






make clean






make bzImage






make modules






make modules_install






cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.13






cp System.map /boot/System.map-2.4.13






/sbin/mkinitrd /boot/initrd-2.4.13.img 2.4.13 (If required due to scsi etc)













Then add another image block to /etc/lilo.conf - something like this













image=/boot/vmlinuz-2.4.13






label=linuxlvm






root=/dev/hdb5 (Change to correct /dev/xxx as per existing image block)






initrd=/boot/initrd-2.4.13.img (if needed - see existing)






read-only













Also copy any 'append' lines.....













Then update boot record itself :













/sbin/lilo -v













Reboot and choose new kernel













Hope this helps
 
Hi,

Thanks for a great wonderful tip. I have actually download the new kernel (linux-2.4.13.tar.bz2), extracted it and try to build the kernel following your instruction. Every thing seems to run ok until I run the command "/sbin/mkinitrd /boot/initrd_2.4.13.ima 2.4.13". This command failed with error message "No module cpqarray found for kernel 2.4.13". There's no /boot/initrd_2.4.13.ima file available. What's missing here?

Also, thought I should bring it up here that this Linux server I am staging is running on a Compaq 6000 server. This server came with a hardware array (a dedicated controller card for RAID array) controller. I click on the "Help" page for "Multi-device support (RAID and LVM) during "make xconfig" and it said that if a "Hardware RAID" is used, there's no need to say 'Y' to have the "Multi-device support (RAID and LVM) install. Should I go ahead and install it anyway just because I need to have the LVM portion of it? If not, then how can I just get LVM installed on the server?

Thanks again for taking the time to response to my question.

Steve
 
Hi,





That means you forgot to specify to compile that cpqarray module. Just re-do the whole thing starting at 'make xconfig' but in the config go into 'block devices' , scroll down a bit and select 'compaq smart 2 support'. You can either compile as a module or built-in to the kernel.





Depending on exact hardware, you <might> need another kernel patch as well - see --> .





Incidentally, if you run mkinitrd and it complains then it thinks you need those missing drivers for the init read-disk. Whats on that initrd image (.img not .ima normally, by the way) are drivers needed to access the root partition and read config files, etc., from disk to boot the system. Its a catch 22 if there's no driver in memory to allow the kernel to access the disks and the only driver is on those same disks. The only time you wouldn't normally need a initrd is if you are booting from ide disks as its all done with the onboard bios.





Regards
 
OK. I tried again (a few time) and here is where I am at:

1) Successfully re-run $make xconfig and select 'compaq smart 2 support'and 'Initial RAM disk (initrd)support'. (I have also checked the link you provided and verified that all compaq array are supported on Linux 7.1).

2) Run
make dep
make clean
make bzImage
make modules
make modules_install
cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.13
cp System.map /boot/System.map-2.4.13

3) Run &quot;/sbin/mkinitrd /boot/initrd-2.4.13.img 2.4.13&quot; and it still fails with the error message &quot;No module cpqarray found for kernel 2.4.13&quot;.

Now, without being able to run /sbin/mkinitrd to create the initrd-2.4.13.img file, is there anyway I can modify the lilo.conf so that it will allow me to boot up with this new kernel version (2.4.13)? If not, then is there anyway to work around that? I have also rebuild the kernel with the xfs patch (to support largefile file system) and would like to see whether that's working also.

Sorry if I sound confusing or saying stupid things in here. I am a novice when it comes to dealing with kernel.

Thanks again for taking the time to help out.

Steve
 
Hi,





It sounds like that module was not compiled and thats why mkinitrd can't find it. Maybe you selected it as built-in to the kernel. You can try to boot that kernel but I don't think it will work. Clearly, mkinitrd thinks you need the module in an initrd and it shouldn't think that if something's compiled in. If you want to try booting that kernel anyway, just add another image block to /etc/lilo.conf - something like this :










image=/boot/vmlinuz-2.4.13







       label=linuxlvm







       root=/dev/hdb5           (Change to correct /dev/xxx as per existing image block)      







       initrd=/boot/initrd-2.4.13.img         read-only





If mkinitrd did not create an initrd image at all (ls -l /boot) then just leave out the initrd= line :





image=/boot/vmlinuz-2.4.13







       label=linuxlvm







       root=/dev/hdb5           (Change to correct /dev/xxx as per existing image block)      







       read-only





Also copy any 'append' lines.....







Then update boot record itself :







/sbin/lilo -v


. When you reboot there should be another item on the boot menu - i.e. the new kernel.







If that doesn't work then check if you have the cpqarray module :





find /lib/modules -name 'cpqarray*'





you should get lines(s) like this :





/lib/modules/2.4.13/kernel/drivers/block/cpqarray.o





If not, I can only suggest you go back to the kernel compile and make sure you select 'm' for module in the 'make xconfig'. In fact, after that do :





cat /usr/src/linux/.config | grep CPQ_DA





You should get the second line output below:





# CONFIG_BLK_CPQ_DA is not set


CONFIG_BLK_CPQ_DA=m





If you get the 'is not set' then there is some problem at the 'make xconfig' stage. If in doubt edit the /usr/src/linux/.config file before proceeding to do 'make dep' etc.





Regards





 
Well, I manually copy the cpqarray.o and other drivers module over and able to run mkinitrd. I am able to move forward to create and reload the new lilo.conf file. (Note: I have re-link /boot/vmlinuz, /boot/System.map to point to the 2.4.13 version).

I reboot the server and select the new boot image (linux-2.4.13). The kernel panic with the following error messages:

request-module[block-major-72]:Root fs not mounted
JFS: Cannot open root device &quot;4808&quot; or 48:08
Please append a correct &quot;root=&quot; boot option
Kernel panic: VFS: Unable to mont root fs on 48:08.

I went back and 'strings' the /boot/map file and it has:
ro root=4808 BOOT_FILE=/boot/vmlinuz-2.4.13
ro root=4808 BOOT_FILE=/boot/vmlinuz-2.4.2-2

What am I missing? &quot;root=4808&quot; was a legacy from the old kernel vmlinuz-2.4.2-2.

My current lilo.conf now contains:
boot=/dev/ida/c0d0
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
message=/boot/message
linear
default=linux-2.4.13

image=/boot/vmlinuz-2.4.13
label=linux-2.4.13
initrd=/boot/initrd-2.4.13.img
read-only
root=/dev/ida/c0d0p8

image=/boot/vmlinuz-2.4.2-2
label=linux-2.4.2smp
initrd=/boot/initrd-2.4.2-2.img
read-only
root=/dev/ida/c0d0p8

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top