LVM type raid1 - modules missing from installer kernel?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
LVM type raid1 - modules missing from installer kernel?
Following this recommendation I have been trying to set up LVM raid1 on 64-bit -current in a virtual machine. After creating the "lvraid" volume group, I set about creating the first raid1 logical volume as follows:
Code:
lvcreate --type raid1 -L 12G -n lvroot lvraid
However, I am presented with the following error:
Code:
modprobe: FATAL: Module dm-raid not found in directory /lib/modules/4.4.7
/sbin/modprobe failed: 1
raid1: Required device-mapper target(s) not detected in your kernel.
I tried modprobe dm-raid without success; I'm not sure what module(s) is required. Or does this mean Slackware's LVM in the installer does not yet support raid1 logical volumes?
Edit: man lvcreate shows support in the installer for LVM raid1, so this is a kernel issue. Any chance the kernel config in the -current installer could be adapted to provide for this scenario, or is it more complicated than that?
Last edited by Gerard Lally; 04-23-2016 at 08:52 AM.
Reason: Clarify that the problem is with installer kernel
modprobe: FATAL: Module dm-raid not found in directory /lib/modules/4.4.7
Quote:
Originally Posted by gezley
Edit: man lvcreate shows support in the installer for LVM raid1, so this is a kernel issue. Any chance the kernel config in the -current installer could be adapted to provide for this scenario, or is it more complicated than that?
Yes. I'm not sure what you mean by "installer kernel", and I am making some assumptions here;
- That you had slack 14.1, upgraded to current, and can boot to that system
- That it is looking for the module created by CONFIG_DM_RAID=m set as in the kernel config. I'm a little uncertain on this, because it looks like CONFIG_DM_RAID should already be set to "m" if you're using the stock huge or generic kernel + config.
Display the config for the currently running kernel, showing just the CONFIG_DM_RAID line;
Code:
zcat /proc/config.gz |grep CONFIG_DM_RAID
Note: I'm guessing that this is how you would compile *just* the modules under the <kernelSourceDir>/drivers/md/ directory;
Code:
cd /usr/src/linux-4.4.7
make modules SUBDIRS=drivers/md
make modules_install SUBDIRS=drivers/md
(You might have to "depmod -a" at this point. I'm not certain.)
If you don't have a "/usr/src/linux-4.4.7" directory (or whatever version it is when you read this)... install kernel-source-4.4.7, available from your local friendly -current repo.
Yes. I'm not sure what you mean by "installer kernel" ...
As Mr Cranium suggests, I mean the kernel (and modules) in use when booting from a -current ISO to install the system, not the kernel running on an installed system. It seems to me that raid as implemented by LVM, not by mdadm, is not supported in this kernel. The userspace LVM included in the installer does support it, but without kernel support this is as far as it goes.
It would be useful to have this feature in the installer as it would allow us to install directly on LVM raid1 volumes, bypassing mdadm and indeed bypassing partitioning as well.
Last edited by Gerard Lally; 04-24-2016 at 06:24 AM.
Ahh! Thanks for correcting my bad assumption.
Did you create the iso yourself using something like "mirror-slackware-current.sh"?
Maybe recompile the huge.s kernel but with the config line for CONFIG_DM_RAID set to "y" instead of "m"? Placing the resulting bzImage, System.map.gz and modified config in to the "<dirOfCurrentMirror>/kernels/huge.s", then re-create the iso without syncing.
Ahh! Thanks for correcting my bad assumption.
Did you create the iso yourself using something like "mirror-slackware-current.sh"?
Maybe recompile the huge.s kernel but with the config line for CONFIG_DM_RAID set to "y" instead of "m"? Placing the resulting bzImage, System.map.gz and modified config in to the "<dirOfCurrentMirror>/kernels/huge.s", then re-create the iso without syncing.
Well a custom ISO is certainly one way of doing it, although the CONFIG_DM_RAID option you mention doesn't apply, as far as I know, to LVM raid. The installer does have compiled-in or modular kernel support for mdadm raid, and indeed kernel and userspace support for setting up plain LVM, but kernel support for LVM's own internal raid seems to be missing.
Last edited by Gerard Lally; 04-24-2016 at 06:25 AM.
It seems Debian's installer does not include the dm-raid module either. Here is how Stack Exchange member derobert managed to get it working on Debian; in brief, he ignores the installer kernel and extracts and modprobes the dm-raid module from the kernel to be installed instead.
Step 4 is what we're interested in:
Code:
cd /tmp
dpkg-deb --fsys-tarfile /cdrom/pool/main/l/linux/linux-image-*.deb | tar x
depmod -a -b /tmp
modprobe -d /tmp dm-raid
Would somebody kindly show me how to replicate the above dpkg-deb pipeline on Slackware, so that I can extract the dm-raid module from the kernel that will be installed?
I think you'd just need to explodepkg the package in a directory and then run the other commands. But I'm not too familiar with depmod and modprobe's options, so they might need some adjustment.
Code:
cd /tmp
explodepkg /location/to/slackware64-current/slackware64/a/kernel-huge-4.4.8-x86_64-1.txz
depmod -a -b /tmp
modprobe -d /tmp dm-raid
I think you'd just need to explodepkg the package in a directory and then run the other commands. But I'm not too familiar with depmod and modprobe's options, so they might need some adjustment.
explodepkg not found. depmod not found either.
But I did extract kernel-modules (not kernel-huge) with xz -d and I did then successfully modprobe dm-raid. I was then able to lvcreate --type raid1 the logical volumes; there were some errors but the installer found the volumes and installed to them.
Next problem - lilo is not happy with raid1 logical volumes. But at least progress.
Last edited by Gerard Lally; 05-01-2016 at 12:35 PM.
I'd never use dmraid, mdraid is the correct solution.
Can you elaborate on that?
I only ever use mdadm and/or LVM for the system anyway; data is always kept on a separate drive and backed up to another drive, neither of which is raid or LVM segmented. So no big deal if I have to reinstall the system, but I would like to know why you think dmraid is not the "correct" solution. There were scare stories about LVM perhaps 5 years ago, but I have yet to find contemporary reports on LVM raid that are reliable and not just hearsay.
dmraid is only justified when you need to dual-boot and share the RAID with "other" operating system on a fakeraid controller. It has all the limitations of hardware controller and no benefits of hardware controller.
dmraid is only justified when you need to dual-boot and share the RAID with "other" operating system on a fakeraid controller. It has all the limitations of hardware controller and no benefits of hardware controller.
Again, open-ended assertions short on specifics. The raid I am trying to set up is specific to LVM and has nothing to do with either mdadm or motherboard fakeraid controllers. Nor does it have anything to do with other operating systems or dual-booting. If you know of problems with software raid as it is implemented in LVM I'm all ears but any other raid you care to discuss is irrelevant to this thread.
OK, I guess I lost you. What stops you from setting up LVM with mdraid? BTW, the recommendation you linked to in your initial post talks about mdraid, too.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.