<?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>LVM &#8211; Johnny Morano&#039;s Tech Articles</title>
	<atom:link href="https://jmorano.moretrix.com/tag/lvm/feed/" rel="self" type="application/rss+xml" />
	<link>https://jmorano.moretrix.com</link>
	<description>Ramblings of an old-fashioned space cowboy</description>
	<lastBuildDate>Tue, 04 Sep 2012 06:47:26 +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>LVM &#8211; Johnny Morano&#039;s Tech Articles</title>
	<link>https://jmorano.moretrix.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<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 fetchpriority="high" 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 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 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>
