<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://alteeve.com/w/index.php?action=history&amp;feed=atom&amp;title=Adding_Space_to_an_LVM</id>
	<title>Adding Space to an LVM - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://alteeve.com/w/index.php?action=history&amp;feed=atom&amp;title=Adding_Space_to_an_LVM"/>
	<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Adding_Space_to_an_LVM&amp;action=history"/>
	<updated>2026-05-01T04:04:12Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Adding_Space_to_an_LVM&amp;diff=1645&amp;oldid=prev</id>
		<title>Digimer at 16:23, 19 May 2010</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Adding_Space_to_an_LVM&amp;diff=1645&amp;oldid=prev"/>
		<updated>2010-05-19T16:23:54Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:23, 19 May 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{howto_header}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{howto_header}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;Note&#039;&#039;&#039;: This is a snippet from another doc and still needs to be cleaned up. Please follow this with caution. It starts after a modification to a Xen domU machine.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;Note&#039;&#039;&#039;: This is a snippet from another doc and still needs to be cleaned up. Please follow this with caution. It starts after a modification to a Xen domU machine &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;called &#039;dev01&#039;&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Adding New Disk in domU to it&amp;#039;s PV =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Adding New Disk in domU to it&amp;#039;s PV =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key an_wiki-mediawiki-:diff:1.41:old-1644:rev-1645:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Digimer</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Adding_Space_to_an_LVM&amp;diff=1644&amp;oldid=prev</id>
		<title>Digimer: Created page with &#039;{{howto_header}}  &#039;&#039;&#039;Note&#039;&#039;&#039;: This is a snippet from another doc and still needs to be cleaned up. Please follow this with caution. It starts after a modification to a Xen domU m…&#039;</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Adding_Space_to_an_LVM&amp;diff=1644&amp;oldid=prev"/>
		<updated>2010-05-19T16:23:06Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;{{howto_header}}  &amp;#039;&amp;#039;&amp;#039;Note&amp;#039;&amp;#039;&amp;#039;: This is a snippet from another doc and still needs to be cleaned up. Please follow this with caution. It starts after a modification to a Xen domU m…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Páàjì titun&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note&amp;#039;&amp;#039;&amp;#039;: This is a snippet from another doc and still needs to be cleaned up. Please follow this with caution. It starts after a modification to a Xen domU machine.&lt;br /&gt;
&lt;br /&gt;
= Adding New Disk in domU to it&amp;#039;s PV =&lt;br /&gt;
&lt;br /&gt;
Once dom0&amp;#039;s LV has been added to domU, you will need to make it available to the domU OS. In this case, we will add it to domU&amp;#039;s existing PV.&lt;br /&gt;
&lt;br /&gt;
Log into the VM; We will use [[dev01]] and it&amp;#039;s new &amp;#039;&amp;#039;&amp;#039;/dev/xvdb&amp;#039;&amp;#039;&amp;#039; disk for our example.&lt;br /&gt;
&lt;br /&gt;
== Preparing the Partition ==&lt;br /&gt;
&lt;br /&gt;
Use &amp;#039;&amp;#039;&amp;#039;fdisk -l&amp;#039;&amp;#039;&amp;#039; and make sure you now see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Disk /dev/xvdb: 53.6 GB, 53687091200 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 6527 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
&lt;br /&gt;
Disk /dev/xvdb doesn&amp;#039;t contain a valid partition table&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enter the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fdisk /dev/xvdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In &amp;#039;&amp;#039;&amp;#039;fdisk&amp;#039;&amp;#039;&amp;#039;, enter the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
n           # New partition&lt;br /&gt;
p           # Primary partition&lt;br /&gt;
1           # Partition number&lt;br /&gt;
&amp;lt;enter&amp;gt;     # First free block&lt;br /&gt;
&amp;lt;enter&amp;gt;     # Last free block&lt;br /&gt;
t           # Change the new partiton&amp;#039;s label&lt;br /&gt;
8e          # To &amp;#039;Linux LVM&amp;#039;&lt;br /&gt;
p           # Print how the new partition will look and confirm that it is right&lt;br /&gt;
w           # Write the changes to disk and exit.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# fdisk /dev/xvdb&lt;br /&gt;
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel&lt;br /&gt;
Building a new DOS disklabel. Changes will remain in memory only,&lt;br /&gt;
until you decide to write them. After that, of course, the previous&lt;br /&gt;
content won&amp;#039;t be recoverable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The number of cylinders for this disk is set to 6527.&lt;br /&gt;
There is nothing wrong with that, but this is larger than 1024,&lt;br /&gt;
and could in certain setups cause problems with:&lt;br /&gt;
1) software that runs at boot time (e.g., old versions of LILO)&lt;br /&gt;
2) booting and partitioning software from other OSs&lt;br /&gt;
   (e.g., DOS FDISK, OS/2 FDISK)&lt;br /&gt;
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)&lt;br /&gt;
&lt;br /&gt;
Command (m for help): n   &lt;br /&gt;
Command action&lt;br /&gt;
   e   extended&lt;br /&gt;
   p   primary partition (1-4)&lt;br /&gt;
p&lt;br /&gt;
Partition number (1-4): 1&lt;br /&gt;
First cylinder (1-6527, default 1): &lt;br /&gt;
Using default value 1&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (1-6527, default 6527): &lt;br /&gt;
Using default value 6527&lt;br /&gt;
&lt;br /&gt;
Command (m for help): t&lt;br /&gt;
Selected partition 1&lt;br /&gt;
Hex code (type L to list codes): 8e&lt;br /&gt;
Changed system type of partition 1 to 8e (Linux LVM)&lt;br /&gt;
&lt;br /&gt;
Command (m for help): p&lt;br /&gt;
&lt;br /&gt;
Disk /dev/xvdb: 53.6 GB, 53687091200 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 6527 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
&lt;br /&gt;
    Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/xvdb1               1        6527    52428096   8e  Linux LVM&lt;br /&gt;
&lt;br /&gt;
Command (m for help): w&lt;br /&gt;
The partition table has been altered!&lt;br /&gt;
&lt;br /&gt;
Calling ioctl() to re-read partition table.&lt;br /&gt;
Syncing disks.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating the new PV ==&lt;br /&gt;
&lt;br /&gt;
We need to turn the new partition into a Physical Volume so that we can then add it to the existing Volume Group. Do this by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvcreate dev01_snap /dev/xvdb1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wait a few seconds for background steps to complete and then check that it is now visible by LVM as a PV by typing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvdisplay&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it worked, you should now see this as the output:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  --- Physical volume ---&lt;br /&gt;
  PV Name               /dev/xvda2&lt;br /&gt;
  VG Name               dev01_vg1&lt;br /&gt;
  PV Size               244.04 GB / not usable 5.90 MB&lt;br /&gt;
  Allocatable           yes (but full)&lt;br /&gt;
  PE Size (KByte)       32768&lt;br /&gt;
  Total PE              7809&lt;br /&gt;
  Free PE               0&lt;br /&gt;
  Allocated PE          7809&lt;br /&gt;
  PV UUID               2bm15Z-vRGI-yKvp-NvGy-w1eC-mnrM-XE0GQe&lt;br /&gt;
   &lt;br /&gt;
  &amp;quot;/dev/xvdb1&amp;quot; is a new physical volume of &amp;quot;50.00 GB&amp;quot;&lt;br /&gt;
  --- NEW Physical volume ---&lt;br /&gt;
  PV Name               /dev/xvdb1&lt;br /&gt;
  VG Name               &lt;br /&gt;
  PV Size               50.00 GB&lt;br /&gt;
  Allocatable           NO&lt;br /&gt;
  PE Size (KByte)       0&lt;br /&gt;
  Total PE              0&lt;br /&gt;
  Free PE               0&lt;br /&gt;
  Allocated PE          0&lt;br /&gt;
  PV UUID               kJaG6L-R31a-NTRZ-NXT4-1ldP-Egnd-0Z4f1E&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding the new PV to the Existing VG ==&lt;br /&gt;
&lt;br /&gt;
Now that we have the second PV, we need to add it to the existing VG. We will continue with this example using the [[dev01]] VM.&lt;br /&gt;
&lt;br /&gt;
To sort out what PV you want to add to which VG, run the following two commands (output shown):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;pvscan&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  PV /dev/xvda2   VG dev01_vg1       lvm2 [244.03 GB / 0    free]&lt;br /&gt;
  PV /dev/xvdb1                      lvm2 [50.00 GB]&lt;br /&gt;
  Total: 2 [294.03 GB] / in use: 1 [244.03 GB] / in no VG: 1 [50.00 GB]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Above, we see the new PV, &amp;#039;&amp;#039;&amp;#039;/dev/xvdb1&amp;#039;&amp;#039;&amp;#039; is not yet assigned to a VG so we know it&amp;#039;s the one we want and that it is ready.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;vgscan&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Reading all physical volumes.  This may take a while...&lt;br /&gt;
  Found volume group &amp;quot;dev01_vg1&amp;quot; using metadata type lvm2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Above, we see that the existing VG is &amp;#039;&amp;#039;&amp;#039;dev01_vg1&amp;#039;&amp;#039;&amp;#039;. This is the VG that the new PV will be added to.&lt;br /&gt;
&lt;br /&gt;
So then, run:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgextend dev01_vg1 /dev/xvdb1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Volume group &amp;quot;dev01_vg1&amp;quot; successfully extended&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you see the above output, then it looks like it worked. Rerun &amp;#039;&amp;#039;&amp;#039;pvscan&amp;#039;&amp;#039;&amp;#039; and it should now look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;pvscan&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  PV /dev/xvda2   VG dev01_vg1   lvm2 [244.03 GB / 0    free]&lt;br /&gt;
  PV /dev/xvdb1   VG dev01_vg1   lvm2 [49.97 GB / 49.97 GB free]&lt;br /&gt;
  Total: 2 [294.00 GB] / in use: 2 [294.00 GB] / in no VG: 0 [0   ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see that both PVs are in the same VG. &lt;br /&gt;
&lt;br /&gt;
Now create the mount point that the new snapshot partition will be mounted:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /mnt/snapshot&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Digimer</name></author>
	</entry>
</feed>