<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>mdadm &#8211; Johnny Morano&#039;s Tech Articles</title>
	<atom:link href="https://jmorano.moretrix.com/tag/mdadm/feed/" rel="self" type="application/rss+xml" />
	<link>https://jmorano.moretrix.com</link>
	<description>Ramblings of an old-fashioned space cowboy</description>
	<lastBuildDate>Wed, 08 Jun 2022 06:35:06 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>

<image>
	<url>https://jmorano.moretrix.com/wp-content/uploads/2022/04/cropped-jmorano_emblem-32x32.png</url>
	<title>mdadm &#8211; Johnny Morano&#039;s Tech Articles</title>
	<link>https://jmorano.moretrix.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Using multipath together with mdadm on Debian</title>
		<link>https://jmorano.moretrix.com/2022/06/using-multipath-together-with-mdadm-on-debian/</link>
					<comments>https://jmorano.moretrix.com/2022/06/using-multipath-together-with-mdadm-on-debian/#respond</comments>
		
		<dc:creator><![CDATA[Johnny Morano]]></dc:creator>
		<pubDate>Wed, 08 Jun 2022 06:35:04 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Fiber Channel]]></category>
		<category><![CDATA[mdadm]]></category>
		<category><![CDATA[multipath]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<guid isPermaLink="false">https://jmorano.moretrix.com/?p=1533</guid>

					<description><![CDATA[Using multipath together with mdadm on Debian Linux requires some changes to the initrd image, otherwise mdadm might&#8230;]]></description>
										<content:encoded><![CDATA[
<p>Using multipath together with mdadm on Debian Linux requires some changes to the initrd image, otherwise mdadm might start before multipath, leading to only one FC path being used or even failure of starting multipath (no FC paths found at all).</p>



<p>To prevent this issue, three steps are required:</p>



<ul class="wp-block-list"><li>change the order kernel modules get loaded by initrd</li><li>disable the mdadm auto-assembly of disks when initrd is loaded</li><li>generate a new initrd image </li></ul>



<p>The initrd configuration files can be found at <code>/etc/initramfs-tools</code>.</p>



<p>First define the order of module loading during boot (ensure that <code>multipath</code> is loaded before <code>mdadm</code>). Edit the file <code>/etc/initramfs-tools/modules</code> to match:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># List of modules that you want to include in your initramfs.
# They will be loaded at boot time in the order below.
#
# Syntax: module_name [args ...]
#
# You must run update-initramfs(8) to effect this change.
#
# Examples:
#
# raid1
# sd_mod
libfc
megaraid_sas
scsi_dh_alua
scsi_transport_fc
dm_multipath
dm_service_time
multipath
md_mod</pre>



<p>This starts by loading the &#8220;fiber channel libs&#8221; (<code>libfc</code>) first, followed by the MegaRAID modules, SCSI over fiber channel, <code>multipath</code> and <code>mdadm</code>.</p>



<p>Now copy the mdadm initramfs hook to <code>/etc</code> to override the default one:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">cp /usr/share/initramfs-tools/hooks/mdadm /etc/initramfs-tools/hooks/</pre>



<p>Edit the hook file in <code>/etc/initramfs-tools/hooks/mdadm </code>and add an &#8216;<code>exit 0</code>&#8216; (see line 10):</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#!/bin/sh
#
# Copyright © 2006-2008 Martin F. Krafft &lt;madduck@debian.org>,
#
2012 Michael Tokarev &lt;mjt@tls.msk.ru>
# based on the scripts in the initramfs-tools package.
# released under the terms of the Artistic Licence.
#
set -eu
exit 0
PREREQ="udev"
prereqs()
{
echo "$PREREQ"
}</pre>



<p>Disable automatic startup of the <code>mdadm</code> service:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">rm /lib/systemd/system/mdadm.service
systemctl daemon-reload
systemctl disable mdadm.service</pre>



<p>Finally, update the initrd images for all kernel versions installed:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">update-initramfs -u -k all</pre>



<p>Reboot the server to see if modules are now loaded in the correct order, and multipath is loaded and started before mdadm.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jmorano.moretrix.com/2022/06/using-multipath-together-with-mdadm-on-debian/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
