<?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>Debian &#8211; Johnny Morano&#039;s Tech Articles</title>
	<atom:link href="https://jmorano.moretrix.com/tag/debian/feed/" rel="self" type="application/rss+xml" />
	<link>https://jmorano.moretrix.com</link>
	<description>Ramblings of an old-fashioned space cowboy</description>
	<lastBuildDate>Thu, 18 Aug 2022 11:04: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>Debian &#8211; Johnny Morano&#039;s Tech Articles</title>
	<link>https://jmorano.moretrix.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Jenkins to manage a libvirt infrastructure with Terraform</title>
		<link>https://jmorano.moretrix.com/2022/08/jenkins-to-manage-azure-infrastructure-with-terraform/</link>
					<comments>https://jmorano.moretrix.com/2022/08/jenkins-to-manage-azure-infrastructure-with-terraform/#respond</comments>
		
		<dc:creator><![CDATA[Johnny Morano]]></dc:creator>
		<pubDate>Thu, 18 Aug 2022 10:53:59 +0000</pubDate>
				<category><![CDATA[Automation]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Terraform]]></category>
		<category><![CDATA[CI/CD]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Jenkins]]></category>
		<category><![CDATA[Libvirt]]></category>
		<guid isPermaLink="false">https://jmorano.moretrix.com/?p=1546</guid>

					<description><![CDATA[Jenkins is an open source automation server which provides hundreds of plugins to build, deploy and automate projects.&#8230;]]></description>
										<content:encoded><![CDATA[
<p><a href="https://www.jenkins.io/" data-type="URL" data-id="https://www.jenkins.io/" target="_blank" rel="noreferrer noopener">Jenkins</a> is an open source automation server which provides hundreds of plugins to build, deploy and automate projects.</p>



<p><a href="https://www.terraform.io/" data-type="URL" data-id="https://www.terraform.io/" target="_blank" rel="noreferrer noopener">Terraform</a> codifies cloud, virtualization and many other APIs into declarative configuration files, allowing to define the infrastructure as code.</p>



<p>The combination of both is an excellent platform to manage resources in the <a rel="noreferrer noopener" href="https://azure.microsoft.com/" data-type="URL" data-id="https://azure.microsoft.com/" target="_blank">Microsoft Azure</a> cloud in an automated or semi-automated way.</p>



<h2 class="wp-block-heading">Installation</h2>



<p>Let&#8217;s start by installing Jenkins and Terraform. The official documentation at <a rel="noreferrer noopener" href="https://www.jenkins.io/doc/book/installing/linux/#debianubuntu" target="_blank">https://www.jenkins.io/doc/book/installing/linux/#debianubuntu</a> describes how to install the Jenkins binaries on a Debian/ Ubuntu system, so we&#8217;ll not go further into details on that.</p>



<p>Once the required packages are installed as described above, go to <a rel="noreferrer noopener" href="http://localhost:8080/" target="_blank">http://localhost:8080/</a> to finalize the Jenkins setup. After installing the essential plugins required to run Jenkins, you should be directed to the following screen:</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="957" height="887" src="https://jmorano.moretrix.com/wp-content/uploads/2022/07/Screenshot-from-2022-07-30-11-52-08.png" alt="" class="wp-image-1552" srcset="https://jmorano.moretrix.com/wp-content/uploads/2022/07/Screenshot-from-2022-07-30-11-52-08.png 957w, https://jmorano.moretrix.com/wp-content/uploads/2022/07/Screenshot-from-2022-07-30-11-52-08-300x278.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2022/07/Screenshot-from-2022-07-30-11-52-08-768x712.png 768w, https://jmorano.moretrix.com/wp-content/uploads/2022/07/Screenshot-from-2022-07-30-11-52-08-380x352.png 380w, https://jmorano.moretrix.com/wp-content/uploads/2022/07/Screenshot-from-2022-07-30-11-52-08-550x510.png 550w, https://jmorano.moretrix.com/wp-content/uploads/2022/07/Screenshot-from-2022-07-30-11-52-08-800x741.png 800w" sizes="(max-width: 957px) 100vw, 957px" /><figcaption>Home screen</figcaption></figure>



<p>Next, install the required plugins.</p>



<p>Go the main dashboard and then click on &#8220;<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-red-color">Manage Jenkins</mark>&#8221; -&gt; &#8220;<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-red-color">Manage Plugins</mark>&#8220;. In the &#8220;<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-red-color">Available</mark>&#8221; tab, search for:</p>



<ul class="wp-block-list"><li>Azure Credentials</li><li>Terraform</li><li>AnsiColor</li><li>Git plugin</li></ul>



<p>Check the checkbox of the required plugins and install them. Jenkins will restart at the end of the installation.</p>



<h2 class="wp-block-heading">Pipeline Setup</h2>



<p>After all plugins have been installed, the next step will be to add a &#8220;<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-red-color">New Item</mark>&#8221; (see the menu on the right side).</p>



<figure class="wp-block-image size-full"><img decoding="async" width="943" height="918" src="https://jmorano.moretrix.com/wp-content/uploads/2022/07/Screenshot-from-2022-07-31-13-01-45.png" alt="" class="wp-image-1555" srcset="https://jmorano.moretrix.com/wp-content/uploads/2022/07/Screenshot-from-2022-07-31-13-01-45.png 943w, https://jmorano.moretrix.com/wp-content/uploads/2022/07/Screenshot-from-2022-07-31-13-01-45-300x292.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2022/07/Screenshot-from-2022-07-31-13-01-45-768x748.png 768w, https://jmorano.moretrix.com/wp-content/uploads/2022/07/Screenshot-from-2022-07-31-13-01-45-380x370.png 380w, https://jmorano.moretrix.com/wp-content/uploads/2022/07/Screenshot-from-2022-07-31-13-01-45-550x535.png 550w, https://jmorano.moretrix.com/wp-content/uploads/2022/07/Screenshot-from-2022-07-31-13-01-45-800x779.png 800w" sizes="(max-width: 943px) 100vw, 943px" /><figcaption>Add a new item</figcaption></figure>



<p>Start by entering a valid name for the job and choose the type &#8220;<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-red-color">Pipeline</mark>&#8220;. Hit &#8220;<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-red-color">OK</mark>&#8221; to continue to the next screen.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="613" src="https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-00-55-1024x613.png" alt="" class="wp-image-1558" srcset="https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-00-55-1024x613.png 1024w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-00-55-300x179.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-00-55-768x459.png 768w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-00-55-380x227.png 380w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-00-55-550x329.png 550w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-00-55-800x479.png 800w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-00-55.png 1110w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Enter a description for the pipeline and scroll down to the &#8220;<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-red-color">Pipeline</mark>&#8221; section and choose in the &#8220;<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-red-color">Definition</mark>&#8221; section the option &#8220;<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-red-color">Pipeline script from SCM</mark>&#8220;. Choose the SCM you want to use and fill in the repository URL of the code repository containing the <mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-red-color">Jenkinsfile pipeline file</mark>.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="790" height="775" src="https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-01-37.png" alt="" class="wp-image-1560" srcset="https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-01-37.png 790w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-01-37-300x294.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-01-37-768x753.png 768w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-01-37-380x373.png 380w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-01-37-550x540.png 550w" sizes="(max-width: 790px) 100vw, 790px" /></figure>



<p>A bit further down it is possible to configure the SCM branch name to work on and the actual filename of the Jenkinsfile, which in most cases will be called just &#8220;<code>Jenkinsfile</code>&#8220;.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="777" height="732" src="https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-02-13.png" alt="" class="wp-image-1559" srcset="https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-02-13.png 777w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-02-13-300x283.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-02-13-768x724.png 768w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-02-13-380x358.png 380w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-02-13-550x518.png 550w" sizes="(max-width: 777px) 100vw, 777px" /></figure>



<p>Once all options have been set, press &#8220;<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-red-color">Save</mark>&#8221; to save the configuration.</p>



<p>Depending on whether the pipeline was created with or without parameters, either click on &#8220;<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-red-color">Build</mark>&#8221; or &#8220;<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-red-color">Build with Parameters</mark>&#8221; to start the pipeline.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="557" src="https://jmorano.moretrix.com/wp-content/uploads/2022/08/rect837-1024x557.png" alt="" class="wp-image-1563" srcset="https://jmorano.moretrix.com/wp-content/uploads/2022/08/rect837-1024x557.png 1024w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/rect837-300x163.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/rect837-768x418.png 768w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/rect837-380x207.png 380w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/rect837-550x299.png 550w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/rect837-800x436.png 800w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/rect837-1160x631.png 1160w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/rect837.png 1453w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Each build will appear in the &#8220;<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-red-color">Build History</mark>&#8221; and contains links to for instance the &#8220;<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-red-color">Console Output</mark>&#8220;, which contains the text output of all stages, steps and plugins executed by the pipeline.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="366" height="268" src="https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-33-57.png" alt="" class="wp-image-1565" srcset="https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-33-57.png 366w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-33-57-300x220.png 300w" sizes="(max-width: 366px) 100vw, 366px" /></figure>



<p>Each build/ run contains information such as:</p>



<ul class="wp-block-list"><li>Who started the pipeline</li><li>The current SCM repository versions (git commit hash)</li><li>An SCM log of the changes since the last build (git commit messages)</li><li>Who approved the pipeline (if applicable)</li><li>The console output of the plugins/ commands executed</li></ul>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="588" src="https://jmorano.moretrix.com/wp-content/uploads/2022/08/rect838-1024x588.png" alt="" class="wp-image-1567" srcset="https://jmorano.moretrix.com/wp-content/uploads/2022/08/rect838-1024x588.png 1024w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/rect838-300x172.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/rect838-768x441.png 768w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/rect838-1536x882.png 1536w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/rect838-2048x1175.png 2048w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/rect838-380x218.png 380w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/rect838-550x316.png 550w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/rect838-800x459.png 800w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/rect838-1160x666.png 1160w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/rect838.png 2084w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>The pipeline dashboard page, contains a stage view of pipeline runs, divided on the stages and their execution status.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="514" src="https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-12-56-1024x514.png" alt="" class="wp-image-1561" srcset="https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-12-56-1024x514.png 1024w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-12-56-300x150.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-12-56-768x385.png 768w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-12-56-380x191.png 380w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-12-56-550x276.png 550w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-12-56-800x401.png 800w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-12-56-1160x582.png 1160w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-12-56.png 1212w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">Pipeline definitions</h2>



<p>Finally, let&#8217;s have a look on how this pipeline file is actually built.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="880" height="606" src="https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-49-39.png" alt="" class="wp-image-1568" srcset="https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-49-39.png 880w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-49-39-300x207.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-49-39-768x529.png 768w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-49-39-380x262.png 380w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-49-39-550x379.png 550w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-49-39-800x551.png 800w" sizes="(max-width: 880px) 100vw, 880px" /><figcaption>Jenkinsfile</figcaption></figure>



<p>The above Jenkinsfile is divided in 4 sections:</p>



<ul class="wp-block-list"><li>the agent section</li><li>the tools section</li><li>the environment section</li><li>the stages section</li></ul>



<p>The first 3 sections basically set some build options like:</p>



<ul class="wp-block-list"><li>on which agent to run the pipeline (in this case, on &#8220;<code>any</code>&#8221; available node)</li><li>which tools are required to be present on the build node</li><li>which environment (shell) parameters should be set</li></ul>



<p>The <code>stages</code> section contains the different stages and steps the pipeline is supposed to run.</p>



<p>Each <code>stage</code>, contains several steps separated per line:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="905" height="387" src="https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-56-24.png" alt="" class="wp-image-1569" srcset="https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-56-24.png 905w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-56-24-300x128.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-56-24-768x328.png 768w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-56-24-380x162.png 380w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-56-24-550x235.png 550w, https://jmorano.moretrix.com/wp-content/uploads/2022/08/Screenshot-from-2022-08-17-09-56-24-800x342.png 800w" sizes="(max-width: 905px) 100vw, 905px" /></figure>



<p>In the above example, all steps are defined between the &#8216;steps { }&#8217; block. Steps can be wrapped (enclosed between curly brackets), like in the above example <mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-red-color">line 15</mark> calls the<code> ansiColor()</code> plugin to display a colorized output of the steps contained by it.</p>



<p>Next, the plugin <code>dir()</code> wraps the rest of the steps, which means that all enclosed steps will be executed in a specific directory.</p>



<p>In that specific directory, 3 plugins will be executed:</p>



<ul class="wp-block-list"><li><code>git</code>: line 17 in the above example will <code>git clone</code> the <code>main</code> branch of the supplied Github URL</li><li><code>echo</code>: line 19 will output some text</li><li><code>sh</code>: line 20 &#8211; 23 defines the shell commands to be executed</li></ul>



<p>A complete example can be found at: <a href="https://github.com/insani4c/jenkins-terraform-datacenter-example/blob/main/JenkinsFile" target="_blank" rel="noreferrer noopener">https://github.com/insani4c/jenkins-terraform-datacenter-example/blob/main/JenkinsFile</a> </p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://jmorano.moretrix.com/2022/08/jenkins-to-manage-azure-infrastructure-with-terraform/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<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>
		<item>
		<title>Libvirt guest startup issue with AppArmor</title>
		<link>https://jmorano.moretrix.com/2022/04/libvirt-guest-startup-issue-with-apparmor/</link>
					<comments>https://jmorano.moretrix.com/2022/04/libvirt-guest-startup-issue-with-apparmor/#respond</comments>
		
		<dc:creator><![CDATA[Johnny Morano]]></dc:creator>
		<pubDate>Sun, 10 Apr 2022 09:37:48 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[AppArmor]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Libvirt]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">https://jmorano.moretrix.com/?p=1487</guid>

					<description><![CDATA[With AppArmor enabled on Debian/ Ubuntu systems, starting up virtual machines with libvirt can cause startup failures if&#8230;]]></description>
										<content:encoded><![CDATA[
<p>With <a href="https://apparmor.net/" data-type="URL" data-id="https://apparmor.net/" target="_blank" rel="noreferrer noopener">AppArmor</a> enabled on Debian/ Ubuntu systems, starting up virtual machines with <a href="https://libvirt.org/" data-type="URL" data-id="https://libvirt.org/" target="_blank" rel="noreferrer noopener">libvirt</a> can cause startup failures if not AppArmor is not properly configured.</p>



<p>AppArmor will write messages to the kernel log (visible with either the <code>dmesg</code> command or in <code>kernel.log</code> if available) regarding its actions.</p>



<p>If your libvirt guests are not starting up or failing, have a look at <code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">dmesg</mark></code>. Example:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="82" src="https://jmorano.moretrix.com/wp-content/uploads/2022/04/Screenshot-from-2022-04-10-11-09-15-1024x82.png" alt="" class="wp-image-1488" srcset="https://jmorano.moretrix.com/wp-content/uploads/2022/04/Screenshot-from-2022-04-10-11-09-15-1024x82.png 1024w, https://jmorano.moretrix.com/wp-content/uploads/2022/04/Screenshot-from-2022-04-10-11-09-15-300x24.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2022/04/Screenshot-from-2022-04-10-11-09-15-768x62.png 768w, https://jmorano.moretrix.com/wp-content/uploads/2022/04/Screenshot-from-2022-04-10-11-09-15-850x68.png 850w, https://jmorano.moretrix.com/wp-content/uploads/2022/04/Screenshot-from-2022-04-10-11-09-15.png 1242w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>In the above example AppArmor has <mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">denied</mark> (<code>apparmor="DENIED"</code>) read access (<code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">requested_mask=r</mark></code>) to the file <code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">/data/vms/cluster_storage/base-os-ubuntu-focal.qcow2</mark></code>. This blocks of course the startup guest machines we have previously created in the article: <a href="https://jmorano.moretrix.com/2022/03/terraform-and-libvirtd-nodes/" data-type="post" data-id="1302">Terraform and libvirtd nodes</a>.</p>



<p>To fix the issue, edit the file: <code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">/etc/apparmor.d/libvirt/TEMPLATE.qemu</mark></code></p>



<p>By default it has the following content:</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="">#
# This profile is for the domain whose UUID matches this file.
#

#include &lt;tunables/global>

profile LIBVIRT_TEMPLATE flags=(attach_disconnected) {
  #include &lt;abstractions/libvirt-qemu>
}
</pre>



<p>In order to allow <code>libvirt</code> to use the guest image files, change the content to (or add a similar line if your file path is different):</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="">#
# This profile is for the domain whose UUID matches this file.
#

#include &lt;tunables/global>

profile LIBVIRT_TEMPLATE flags=(attach_disconnected) {
  #include &lt;abstractions/libvirt-qemu>
  /data/vms/cluster_storage/**.qcow2 rwk,
}
</pre>



<p>The added line (<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">line 9</mark>) will allow read (<code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">r</mark></code>), write (<code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">w</mark></code>) and lock (<code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">k</mark></code>) access to all <code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">qcow2</mark></code> files in the directory <code><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">/data/vms/cluster_storage</mark></code>.</p>



<p>Once added, all libvirt guests will start up again without any (AppArmor) issues.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jmorano.moretrix.com/2022/04/libvirt-guest-startup-issue-with-apparmor/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>A simple TCP server written in Perl</title>
		<link>https://jmorano.moretrix.com/2013/09/simple-tcp-server-written-perl/</link>
					<comments>https://jmorano.moretrix.com/2013/09/simple-tcp-server-written-perl/#comments</comments>
		
		<dc:creator><![CDATA[Johnny Morano]]></dc:creator>
		<pubDate>Tue, 17 Sep 2013 12:47:04 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[client/server]]></category>
		<category><![CDATA[CPAN]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[TCP]]></category>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=997</guid>

					<description><![CDATA[The below example is a very simple TCP server script written in Perl, which uses the AnyEvent module.It&#8230;]]></description>
										<content:encoded><![CDATA[
<p>The below example is a very simple TCP server script written in Perl, which uses the <a href="http://software.schmorp.de/pkg/AnyEvent.html" target="_blank" rel="noopener">AnyEvent</a> module.<br />It will create a separate process for each connections and has the ability to return data to the parent process.<br />The below example allows 15 child processes to be created, which results in 15 simultaneous client connections.</p>



<p>The script itself is pretty straight-forward: it creates a server object using <em>IO::Socket::INET</em> and attaches that socket to an <em>AnyEvent</em> IO eventloop. Furthermore, upon every connection, it will call the subroutine <em>fork_call</em> (which is in the <em>AnyEvent::Util</em> module) to open up a client socket.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""> 
#!/usr/bin/env perl 
use strict;
use warnings;
use utf8;

use IO::Socket::INET;
use AnyEvent;
use AnyEvent::Util;
$AnyEvent::Util::MAX_FORKS = 15;

my $handled = 0;
$|++;

my $server = IO::Socket::INET->new(
    'Proto'     => 'tcp',
    'LocalAddr' => 'localhost',
    'LocalPort' => 1234,
    'Listen'    => SOMAXCONN,
    'Reuse'     => 1,
) or die "can't setup server: $!\n";
print "Listening on localhost:1234\n";

my $cv = AnyEvent->condvar;
my $w; $w = AnyEvent->io(
        fh   => \*{ $server }, 
        poll => 'r', 
        cb   => sub { 
                   $handled++;
                   $cv->begin; 
                   fork_call &amp;handle_connections, 
                             $server->accept, 
                             sub { 
                               my ($client) = @_ ;
                               print " - Client $client closed\n"
                             } 
                    }
);
$cv->recv;

#
# Subroutines
# 
sub handle_connections {
    my ($client) =  @_;

    my $host = $client->peerhost;
    print "[Accepted connection from $host]\n";

    print $client "Hi, you're client #$handled\n";
    chomp ( my $input = &lt;$client> );
    my $output = reverse $input;
    print $client $output, "\n";
    print $client "Bye, bye.\n";

    $cv->end;
    return $host;
}
</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://jmorano.moretrix.com/2013/09/simple-tcp-server-written-perl/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Backup to free Hetzner FTP</title>
		<link>https://jmorano.moretrix.com/2012/08/backup-free-hetzner-ftp/</link>
					<comments>https://jmorano.moretrix.com/2012/08/backup-free-hetzner-ftp/#comments</comments>
		
		<dc:creator><![CDATA[Johnny Morano]]></dc:creator>
		<pubDate>Wed, 29 Aug 2012 13:20:38 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[Hetzner]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=890</guid>

					<description><![CDATA[If you have a hosting account at Hetzner with free backup space, you can not access this backup&#8230;]]></description>
										<content:encoded><![CDATA[<p>If you have a hosting account at <a href="http://www.hetzner.de/en/" target="_blank">Hetzner</a> with free backup space, you can not access this backup volume using <em>rsync</em>.</p>
<p>One way of creating a simple backup, is by using the <em>tar</em> command with the <em>incremental</em> option.</p>
<p>You will also want to encrypt these backup files and one easy to do this, is by using <a href="http://www.gnupg.org/" target="_blank">GPG</a> keys.</p>
<p>The following example assumes you have logged on the FTP server before and that you have created a <em>backup</em> subdirectory.<br />
It also uses the <em>ncftp</em> tool.</p>
<pre class="brush:bash">
#!/bin/bash

DIRS="/etc /root /home /var/cache/bind /var/spool/postfix /var/www"
INCFILE="/root/.backup/inc_file"
CURRENT_DATE=$(date '+%Y%m%d')
DSTFILE="/data/backup/backup-$CURRENT_DATE.gpg"
GPGUSER="gpg@localhost"
HETZNERUSER=ftpuser
HETZNERPASS=secret
HETZNERSERVER=ftpuser.your-backup.de
HETZNERDIR=backup

tar cvzg $INCFILE -f - $DIRS | gpg -r $GPGUSER -e > $DSTFILE
ncftpput -DD -u $HETZNERUSER -p $HETZNERPASS $HETZNERSERVER $HETZNERDIR $DSTFILE

</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://jmorano.moretrix.com/2012/08/backup-free-hetzner-ftp/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Resize a LVM partition in a Debian VMWare VM</title>
		<link>https://jmorano.moretrix.com/2012/03/resize-lvm-partition-debian-vmware-vm/</link>
					<comments>https://jmorano.moretrix.com/2012/03/resize-lvm-partition-debian-vmware-vm/#comments</comments>
		
		<dc:creator><![CDATA[Johnny Morano]]></dc:creator>
		<pubDate>Tue, 13 Mar 2012 07:46:13 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[LVM]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[VMWare]]></category>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=694</guid>

					<description><![CDATA[It can happen that a VMWare virtual machine (VM) runs out of space after a certain amount of&#8230;]]></description>
										<content:encoded><![CDATA[<p>It can happen that a VMWare virtual machine (VM) runs out of space after a certain amount of time. If the installed Debian Linux (actually any kind of Linux) has been set up with LVM, resizing the partition is fairly easy.</p>
<p>This article assumes that the VM has been installed with just one root partition, but it can be applied to expand any kind of partition. If you are resizing a non-root partition, you do not need to reboot with a rescue disc. Unmounting that partition will be enough, but since this is impossible for the root partition, we will need to boot with a rescue disc.</p>
<p><a href="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture01.png"><img loading="lazy" decoding="async" src="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture01-300x188.png" alt="" title="Capture01" width="300" height="188" class="alignnone size-medium wp-image-695" srcset="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture01-300x188.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture01.png 738w" sizes="(max-width: 300px) 100vw, 300px" /></a><br />
The first screenshot shows the actual partition size, in this example the partition is called <code>/dev/mapper/debian-root</code> and is currently 7.3G. <code>/dev/mapper/debian-root</code> is actually just a mapper name (alias), the real LVM partition name is <code>/dev/debian/root</code>.<br />
<span id="more-694"></span><br />
Shutdown the VM using the &#8216;<code>shutdown -r now</code>&#8216; or &#8216;<code>init 0</code>&#8216; command.<br />
Then start your VMWare Player and hit the &#8216;<em>Edit virtual machine settings</em>&#8216; button.<br />
<a href="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture02.png"><img loading="lazy" decoding="async" src="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture02-300x259.png" alt="" title="Capture02" width="300" height="259" class="alignnone size-medium wp-image-696" srcset="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture02-300x259.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture02.png 666w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Choose the &#8216;<em>Hard Disk</em>&#8216; option, then hit the &#8216;<em>Utilities</em>&#8216; button and afterwards &#8216;<em>Expand</em>&#8216;.<br />
<a href="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture03.png"><img loading="lazy" decoding="async" src="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture03-300x167.png" alt="" title="Capture03" width="300" height="167" class="alignnone size-medium wp-image-697" srcset="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture03-300x167.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture03.png 346w" sizes="(max-width: 300px) 100vw, 300px" /></a><br />
Resize the partition, in this example the new partition size is set to 12G (initialy 8G). Then hit the &#8216;<em>Expand</em>&#8216; button. A popup will follow after a succesful resize.</p>
<p>Now go to the &#8216;<em>CD/DVD</em>&#8216; section and choose an ISO to boot from, in this example the original Debian ISO is used.<br />
<a href="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture05.png"><img loading="lazy" decoding="async" src="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture05-300x259.png" alt="" title="Capture05" width="300" height="259" class="alignnone size-medium wp-image-699" srcset="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture05-300x259.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture05.png 666w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Press the &#8216;<em>OK</em>&#8216; button and boot your VM.<br />
During boot, hit the &#8216;ESC&#8217; button to go to the VMWare BIOS boot menu and choose to boot from &#8216;CD-ROM Drive&#8217;.<br />
<a href="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture06.png"><img loading="lazy" decoding="async" src="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture06-300x248.png" alt="" title="Capture06" width="300" height="248" class="alignnone size-medium wp-image-700" srcset="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture06-300x248.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture06.png 658w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>When the Debian boot loader appears, go to &#8216;<em>Advanced Options</em>&#8216; and choose &#8216;<em>Rescue Mode</em>&#8216; and then hit &#8216;<em>Enter</em>&#8216;.<br />
<a href="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture07.png"><img loading="lazy" decoding="async" src="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture07-300x248.png" alt="" title="Capture07" width="300" height="248" class="alignnone size-medium wp-image-701" srcset="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture07-300x248.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture07.png 658w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Go through the questions but at the end (you can answer with default questions, since we won&#8217;t be saving this settings. The only thing that is important is to choose to right kind of keyboard), choose not to use a root filesystem and finally execute a shell.<br />
<a href="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture08.png"><img loading="lazy" decoding="async" src="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture08-300x263.png" alt="" title="Capture08" width="300" height="263" class="alignnone size-medium wp-image-702" srcset="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture08-300x263.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture08.png 818w" sizes="(max-width: 300px) 100vw, 300px" /></a><br />
<a href="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture09.png"><img loading="lazy" decoding="async" src="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture09-300x263.png" alt="" title="Capture09" width="300" height="263" class="alignnone size-medium wp-image-703" srcset="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture09-300x263.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture09.png 818w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>First a new partition needs to be created using the &#8216;<code>fdisk</code>&#8216; command. Since we will be adding a real partition to our LVM setup, we need to execute &#8216;<code>fdisk /dev/sda</code>&#8216;.<br />
<a href="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture10.png"><img loading="lazy" decoding="async" src="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture10-300x243.png" alt="" title="Capture10" width="300" height="243" class="alignnone size-medium wp-image-704" srcset="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture10-300x243.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture10.png 818w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>A reboot is required to enable the new partition table, so you will need to boot the ISO again (hit the &#8216;<em>ESC</em>&#8216; button during boot to get the &#8216;<em>Boot menu</em>&#8216;) and boot into &#8216;<em>Rescue Mode</em>&#8216; mode. Don&#8217;t enable a root filesystem and open a shell.</p>
<p>Once the shell is back, execute &#8216;<code>pvdisplay</code>&#8216; to find out the &#8216;<em>VG Name</em>&#8216;.<br />
Now set up a new PV using the &#8216;<code>pvcreate</code>&#8216; command and extend the VG with the &#8216;<code>vgextend</code>&#8216; command.<br />
<a href="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture12.png"><img loading="lazy" decoding="async" src="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture12-300x243.png" alt="" title="Capture12" width="300" height="243" class="alignnone size-medium wp-image-706" srcset="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture12-300x243.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture12.png 818w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Use the &#8216;<code>pvdisplay</code>&#8216; command again to figure out the added size of the PV and then finally extend the LV.<br />
Once the LV is extended, &#8216;<code>e2fsck</code>&#8216; needs to be run to clean up the filesystem and &#8216;<code>resize2fs</code>&#8216; to expand the filesystem.<br />
<a href="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture14.png"><img loading="lazy" decoding="async" src="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture14-300x243.png" alt="" title="Capture14" width="300" height="243" class="alignnone size-medium wp-image-708" srcset="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture14-300x243.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture14.png 818w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>The resize process is complete. Reboot the VM to see your changes in your Linux OS.<br />
<a href="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture15.png"><img loading="lazy" decoding="async" src="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture15-300x188.png" alt="" title="Capture15" width="300" height="188" class="alignnone size-medium wp-image-709" srcset="https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture15-300x188.png 300w, https://jmorano.moretrix.com/wp-content/uploads/2012/03/Capture15.png 738w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://jmorano.moretrix.com/2012/03/resize-lvm-partition-debian-vmware-vm/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
	</channel>
</rss>
