VirtualBox

source: vbox/trunk/doc/manual/en_US/man_VBoxManage-modifymedium.xml@ 85670

Last change on this file since 85670 was 82969, checked in by vboxsync, 5 years ago

Copyright year updates - manual ones.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 10.2 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 manpage, user manual, usage: VBoxManage modifymedium
4
5 Copyright (C) 2006-2020 Oracle Corporation
6
7 This file is part of VirtualBox Open Source Edition (OSE), as
8 available from http://www.virtualbox.org. This file is free software;
9 you can redistribute it and/or modify it under the terms of the GNU
10 General Public License (GPL) as published by the Free Software
11 Foundation, in version 2 as it comes in the "COPYING" file of the
12 VirtualBox OSE distribution. VirtualBox OSE is distributed in the
13 hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
14 -->
15<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
16 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"[
17<!ENTITY % all.entities SYSTEM "all-entities.ent">
18%all.entities;
19]>
20<refentry id="vboxmanage-modifymedium" lang="en">
21 <refentryinfo>
22 <pubdate>August 2019</pubdate>
23 <title>VBoxManage modifymedium</title>
24 </refentryinfo>
25
26 <refmeta>
27 <refentrytitle>VBoxManage-modifymedium</refentrytitle>
28 <manvolnum>1</manvolnum>
29 </refmeta>
30
31 <refnamediv>
32 <refname>VBoxManage-modifymedium</refname>
33 <refpurpose>change the characteristics of an existing disk image</refpurpose>
34 <refclass>Oracle VM VirtualBox</refclass>
35 </refnamediv>
36
37 <refsynopsisdiv>
38 <cmdsynopsis id="synopsis-vboxmanage-modifymedium">
39<!-- The 'id' is mandatory and must start with 'synopsis-'. -->
40 <command>VBoxManage modifymedium</command>
41 <group>
42 <arg choice="plain">disk</arg>
43 <arg choice="plain">dvd</arg>
44 <arg choice="plain">floppy</arg>
45 </group>
46 <group choice="req">
47 <arg choice="plain"><replaceable>uuid</replaceable></arg>
48 <arg choice="plain"><replaceable>filename</replaceable></arg>
49 </group>
50 <arg>--autoreset=on | off</arg>
51 <arg>--compact</arg>
52 <arg>--description=<replaceable>description</replaceable></arg>
53 <arg>--move=<replaceable>pathname</replaceable></arg>
54 <arg>--property=<replaceable>name</replaceable>=[<replaceable>value</replaceable>]</arg>
55 <arg>--resize=<replaceable>megabytes</replaceable> | --resizebyte=<replaceable>bytes</replaceable></arg>
56 <arg>--setlocation=<replaceable>pathname</replaceable></arg>
57 <arg>--type=normal | writethrough | immutable | shareable | readonly | multiattach</arg>
58 </cmdsynopsis>
59 </refsynopsisdiv>
60
61 <refsect1>
62 <title>Description</title>
63 <para>
64 The <command>VBoxManage modifymedium</command> command enables you
65 to change the characteristics of an existing disk image.
66 </para>
67 <note>
68 <para>
69 For compatibility with earlier versions of &product-name;, you
70 can use the <command>modifyvdi</command> and
71 <command>modifyhd</command> commands.
72 </para>
73 </note>
74 <variablelist>
75 <varlistentry>
76 <term>disk | dvd | floppy</term>
77 <listitem><para>
78 Specifies the media type of the image.
79 </para></listitem>
80 </varlistentry>
81 <varlistentry>
82 <term><replaceable>filename</replaceable></term>
83 <listitem><para>
84 Specifies the Universally Unique Identifier (UUID) or path
85 name of the disk image on the host file system. You can
86 specify the UUID only if the medium is registered. Use the
87 <command>VBoxManage list hdds</command> command to list the
88 registered images. You can specfy an absolute or relative
89 path to the medium.
90 </para></listitem>
91 </varlistentry>
92 <varlistentry>
93 <term><option>--autoreset=on | off</option></term>
94 <listitem><para>
95 Specifies whether to automatically reset an immutable hard
96 disk on every virtual machine (VM) startup. This option is
97 only for immutable hard disks and the default value is
98 <literal>on</literal>. See <xref linkend="hdimagewrites" />.
99 </para></listitem>
100 </varlistentry>
101 <varlistentry>
102 <term><option>--compact</option></term>
103 <listitem><para>
104 Compresses disk images by removing blocks that contain only
105 zeroes. This option shrinks a dynamically allocated image
106 and reduces the <emphasis>physical</emphasis> size of the
107 image without affecting the logical size of the virtual
108 disk.
109 </para><para>
110 You can use this option for base images and for differencing
111 images that are created as part of a snapshot.
112 </para><note>
113 <para>
114 Before you compress the image, you must use a suitable
115 software tool to zero out free space in the guest system.
116 For example:
117 </para>
118 <itemizedlist>
119 <listitem><para>
120 <emphasis role="bold">Windows guests.</emphasis> Run
121 the <command>sdelete -z</command> command.
122 </para></listitem>
123 <listitem><para>
124 <emphasis role="bold">Linux guests.</emphasis> Use the
125 <command>zerofree</command> utility, which supports
126 <literal>ext2</literal> and <literal>ext3</literal>
127 file systems.
128 </para></listitem>
129 <listitem><para>
130 <emphasis role="bold">Mac OS X guests.</emphasis> Use
131 the <command>diskutil secureErase freespace 0
132 /</command> command.
133 </para></listitem>
134 </itemizedlist>
135 </note><para>
136 Note that you can only use this option to compress VDI
137 images. To compress non-VID images, you can zero out free
138 blocks and then clone the disk to any other dynamically
139 allocated format.
140 </para></listitem>
141 </varlistentry>
142 <varlistentry>
143 <term><option>--description=<replaceable>description</replaceable></option></term>
144 <listitem><para>
145 Specifies a text description of the medium.
146 </para></listitem>
147 </varlistentry>
148 <varlistentry>
149 <term><option>--move=<replaceable>pathname</replaceable></option></term>
150 <listitem><para>
151 Specifies a relative or absolute path to a medium on the
152 host system. Use this option to relocate a medium to a
153 different location on the host system.
154 </para></listitem>
155 </varlistentry>
156 <varlistentry>
157 <term><option>--property=<replaceable>name</replaceable>=<replaceable>value</replaceable></option></term>
158 <listitem><para>
159 Specifies a property name and value for the medium.
160 </para></listitem>
161 </varlistentry>
162 <varlistentry>
163 <term><option>--resize=<replaceable>size</replaceable></option></term>
164 <listitem><para>
165 Specifes the new capacity of an existing image in MB. You
166 can use this option only to expand the capacity of an image.
167 You can cannot shrink the capacity of an image.
168 </para><para>
169 Note that you can resize only dynamically allocated disk
170 images that use the VDI and VHD formats. This option adjusts
171 the <emphasis>logical</emphasis> size of a virtual disk and
172 has only a minor affect on the physical size.
173 </para><para>
174 For example, if your dynamically allocated 10 GB disk is
175 full, you can use the <option>--resize 15360</option> option
176 to increase the capacity of the existing disk to 15 GB
177 (15,360 MB). This operation enables you to avoid having to
178 create a new image and copy all data from within a VM.
179 </para><para>
180 Note that using this option only changes the capacity of the
181 drive. So, you might need to subsequently use a partition
182 management tool in the guest to adjust the main partition to
183 fill the drive.
184 </para></listitem>
185 </varlistentry>
186 <varlistentry>
187 <term><option>--resizebyte=<replaceable>size</replaceable></option></term>
188 <listitem><para>
189 Specifes the new capacity of an existing image in bytes.
190 This option is similar to the <option>--resize</option>
191 option, but you specify the size in bytes instead of
192 megabytes.
193 </para></listitem>
194 </varlistentry>
195 <varlistentry>
196 <term><option>--setlocation=<replaceable>pathname</replaceable></option></term>
197 <listitem><para>
198 Specifies the new location of the medium on the host system
199 after the medium has been moved. The path name can be
200 relative to the current directory or be absolute to the
201 root.
202 </para><para>
203 Note that the <command>VBoxManage modifymedium</command>
204 command does not perform any sanity checks on the path name
205 you specify. Ensure that the path name is valid.
206 </para></listitem>
207 </varlistentry>
208 <varlistentry>
209 <term><option>--type</option></term>
210 <listitem><para>
211 Specifies the new mode type of an existing image. Valid
212 values are <literal>normal</literal>,
213 <literal>immutable</literal>,
214 <literal>writethrough</literal>,
215 <literal>multi-attach</literal>,
216 <literal>shareable</literal>, and
217 <literal>readonly</literal>. For descriptions of these mode
218 types, see <xref linkend="hdimagewrites" />.
219 </para></listitem>
220 </varlistentry>
221 </variablelist>
222 </refsect1>
223
224 <refsect1>
225 <title>Examples</title>
226 <remark role="help-scope" condition="GLOBAL" />
227 <para>
228 The following command modifies the description for the disk image
229 file called <filename>disk01.vdi</filename>.
230 </para>
231<screen>$ VBoxManage modifymedium disk disk01.vdi --description "Oracle Linux 7 image"</screen>
232 <para>
233 The following command modifies the write mode for the disk image
234 file called <filename>disk01.vdi</filename>.
235 </para>
236<screen>$ VBoxManage modifymedium disk disk01.vdi --type writethrough</screen>
237 </refsect1>
238
239 <refsect1>
240 <title>See Also</title>
241 <para>
242 <xref linkend="vboxmanage-list" />
243 </para>
244 </refsect1>
245</refentry>
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette