<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openvz.org/index.php?action=history&amp;feed=atom&amp;title=In-place_VM_disk_expand</id>
	<title>In-place VM disk expand - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openvz.org/index.php?action=history&amp;feed=atom&amp;title=In-place_VM_disk_expand"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=In-place_VM_disk_expand&amp;action=history"/>
	<updated>2026-04-11T12:52:44Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=In-place_VM_disk_expand&amp;diff=18134&amp;oldid=prev</id>
		<title>Sergey Bronnikov: Sergey Bronnikov moved page Prl-disk-tool: in-place VM disk expand to In-place VM disk expand without leaving a redirect</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=In-place_VM_disk_expand&amp;diff=18134&amp;oldid=prev"/>
		<updated>2015-12-21T13:34:06Z</updated>

		<summary type="html">&lt;p&gt;Sergey Bronnikov moved page &lt;a href=&quot;/index.php?title=Prl-disk-tool:_in-place_VM_disk_expand&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Prl-disk-tool: in-place VM disk expand (page does not exist)&quot;&gt;Prl-disk-tool: in-place VM disk expand&lt;/a&gt; to &lt;a href=&quot;/In-place_VM_disk_expand&quot; title=&quot;In-place VM disk expand&quot;&gt;In-place VM disk expand&lt;/a&gt; without leaving a redirect&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 13:34, 21 December 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Sergey Bronnikov</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=In-place_VM_disk_expand&amp;diff=18133&amp;oldid=prev</id>
		<title>Sergey Bronnikov: add TRD for prl_disk_tool</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=In-place_VM_disk_expand&amp;diff=18133&amp;oldid=prev"/>
		<updated>2015-12-21T13:31:28Z</updated>

		<summary type="html">&lt;p&gt;add TRD for prl_disk_tool&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=== Feature ===&lt;br /&gt;
&lt;br /&gt;
prl_disk_tool resize --resize_partition /in-place VM disk expand&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
the prl_disk_tool utility now can expand VM disks in-place.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;prl_disk_tool resize&amp;lt;/code&amp;gt; worked in-place even before&lt;br /&gt;
&amp;lt;code&amp;gt;prl_disk_tool resize --resize_partition&amp;lt;/code&amp;gt; now expands disk, last partition (in case of logical paritition, the extended container as well) and its filesystem.&lt;br /&gt;
&lt;br /&gt;
As before, you will need:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;libguestfs-winsupport&amp;lt;/code&amp;gt; for last ntfs partition&lt;br /&gt;
* &amp;lt;code&amp;gt;libguestfs-xfs&amp;lt;/code&amp;gt; for last xfs partition&lt;br /&gt;
* &amp;lt;code&amp;gt;btrfs-progs&amp;lt;/code&amp;gt; for last btrfs partition&lt;br /&gt;
&lt;br /&gt;
The approximate algorithm is as following (for GPT):&lt;br /&gt;
&lt;br /&gt;
# part-list -&amp;gt; (start, end); blockdev-getsize64 -&amp;gt; diskEnd; store partition attrs&lt;br /&gt;
# create overlay image of size newSize on top of current&lt;br /&gt;
# debug sh 'sgdisk -e /dev/sdaN' (working on libguestfs API)&lt;br /&gt;
# part-del /dev/sda N&lt;br /&gt;
# part-add /dev/sda attrs.type start (blockdev-getsize64 - (diskEnd - end))&lt;br /&gt;
# restore partition attrs&lt;br /&gt;
# stretch filesystem (resize2fs, ntfsresize etc)&lt;br /&gt;
# prl_disk_tool merge --external overlay (qemu-img commit)&lt;br /&gt;
&lt;br /&gt;
For MBR, we avoid step (3) and repeat (4)-(5) for extended partition before resizing logical (if needed).&lt;br /&gt;
&lt;br /&gt;
If something goes wrong before (8), we just remove overlay and nothing will change to original image. Overlay is lightweight: for 1GB full disk it used only 6.3Mb of space (I think it's affordable).&lt;br /&gt;
&lt;br /&gt;
=== Products ===&lt;br /&gt;
&lt;br /&gt;
Virtuozzo 7&lt;br /&gt;
&lt;br /&gt;
Packages&lt;br /&gt;
&lt;br /&gt;
* prl-disk-tool &amp;gt;= 7.0.7&lt;br /&gt;
* libguestfs &amp;gt;= 1.31.7&lt;br /&gt;
* btrfs-progs &amp;gt;= 4.2 (optional)&lt;br /&gt;
* libguestfs-winsupport &amp;gt;= 7.2.1 (optional)&lt;br /&gt;
* libguestfs-xfs (in dependencies)&lt;br /&gt;
* qemu-img &amp;gt;= 1.5.3-86&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
&lt;br /&gt;
Need to test the following cases:&lt;br /&gt;
&lt;br /&gt;
* resize --resize_partition /works for ext2/ext3/ext4/ntfs/btrfs/xfs/swap last partitions&lt;br /&gt;
* it works for GPT partitions, preserving partition attributes&lt;br /&gt;
* it works for MBR partitions (primary/extended/logical), preserving partition attributes.&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
* only listed filesystems are supported&lt;br /&gt;
* LVM is not supported (working on it)&lt;br /&gt;
* GPT disk GUID is not preserved (it may cause specific OSes to fail - need to check which ones)&lt;br /&gt;
* Resizing drops internal snapshots (working on it)&lt;br /&gt;
&lt;br /&gt;
=== Person responsible for the feature ===&lt;br /&gt;
&lt;br /&gt;
Maxim Perevedentsev (mperevedentsev at virtuozzo.com)&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [https://lists.openvz.org/pipermail/users/2015-December/006670.html TRD in users@ mail archive]&lt;br /&gt;
&lt;br /&gt;
[[Category: TRD]]&lt;/div&gt;</summary>
		<author><name>Sergey Bronnikov</name></author>
		
	</entry>
</feed>