1virt-resize(1)              Virtualization Support              virt-resize(1)
2
3
4

NAME

6       virt-resize - Resize a virtual machine disk
7

SYNOPSIS

9        virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]
10          [--expand /dev/sdaN] [--shrink /dev/sdaN]
11          [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk
12

DESCRIPTION

14       Virt-resize is a tool which can resize a virtual machine disk, making
15       it larger or smaller overall, and resizing or deleting any partitions
16       contained within.
17
18       Virt-resize cannot resize disk images in-place.  Virt-resize should not
19       be used on live virtual machines - for consistent results, shut the
20       virtual machine down before resizing it.
21
22       If you are not familiar with the associated tools: virt-filesystems(1)
23       and virt-df(1), we recommend you go and read those manual pages first.
24

EXAMPLES

26       1.  This example takes "olddisk" and resizes it into "newdisk",
27           extending one of the guest’s partitions to fill the extra 5GB of
28           space:
29
30            virt-filesystems --long -h --all -a olddisk
31
32            truncate -r olddisk newdisk
33            truncate -s +5G newdisk
34
35            # Note "/dev/sda2" is a partition inside the "olddisk" file.
36            virt-resize --expand /dev/sda2 olddisk newdisk
37
38       2.  As above, but make the /boot partition 200MB bigger, while giving
39           the remaining space to /dev/sda2:
40
41            virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \
42              olddisk newdisk
43
44       3.  As in the first example, but expand a logical volume as the final
45           step.  This is what you would typically use for Linux guests that
46           use LVM:
47
48            virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \
49              olddisk newdisk
50
51       4.  As in the first example, but the output format will be qcow2
52           instead of a raw disk:
53
54            qemu-img create -f qcow2 -o preallocation=metadata newdisk.qcow2 15G
55            virt-resize --expand /dev/sda2 olddisk newdisk.qcow2
56

DETAILED USAGE

58   EXPANDING A VIRTUAL MACHINE DISK
59       1. Shut down the virtual machine
60       2. Locate input disk image
61           Locate the input disk image (ie. the file or device on the host
62           containing the guest’s disk).  If the guest is managed by libvirt,
63           you can use "virsh dumpxml" like this to find the disk image name:
64
65            # virsh dumpxml guestname | xpath /domain/devices/disk/source
66            Found 1 nodes:
67            -- NODE --
68            <source dev="/dev/vg/lv_guest" />
69
70       3. Look at current sizing
71           Use virt-filesystems(1) to display the current partitions and
72           sizes:
73
74            # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest
75            Name       Type       Size  Parent
76            /dev/sda1  partition  101M  /dev/sda
77            /dev/sda2  partition  7.9G  /dev/sda
78            /dev/sda   device     8.0G  -
79
80           (This example is a virtual machine with an 8 GB disk which we would
81           like to expand up to 10 GB).
82
83       4. Create output disk
84           Virt-resize cannot do in-place disk modifications.  You have to
85           have space to store the resized output disk.
86
87           To store the resized disk image in a file, create a file of a
88           suitable size:
89
90            # rm -f outdisk
91            # truncate -s 10G outdisk
92
93           Or use lvcreate(1) to create a logical volume:
94
95            # lvcreate -L 10G -n lv_name vg_name
96
97           Or use virsh(1) vol-create-as to create a libvirt storage volume:
98
99            # virsh pool-list
100            # virsh vol-create-as poolname newvol 10G
101
102       5. Resize
103           virt-resize takes two mandatory parameters, the input disk and the
104           output disk (both can be e.g. a device, a file, or a URI to a
105           remote disk).  The output disk is the one created in the previous
106           step.
107
108            # virt-resize indisk outdisk
109
110           This command just copies disk image "indisk" to disk image
111           "outdisk" without resizing or changing any existing partitions.  If
112           "outdisk" is larger, then an extra, empty partition is created at
113           the end of the disk covering the extra space.  If "outdisk" is
114           smaller, then it will give an error.
115
116           More realistically you'd want to expand existing partitions in the
117           disk image by passing extra options (for the full list see the
118           "OPTIONS" section below).
119
120           "--expand" is the most useful option.  It expands the named
121           partition within the disk to fill any extra space:
122
123            # virt-resize --expand /dev/sda2 indisk outdisk
124
125           (In this case, an extra partition is not created at the end of the
126           disk, because there will be no unused space).
127
128           "--resize" is the other commonly used option.  The following would
129           increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to
130           fill the rest of the available space:
131
132            # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \
133                indisk outdisk
134
135           If the expanded partition in the image contains a filesystem or LVM
136           PV, then if virt-resize knows how, it will resize the contents, the
137           equivalent of calling a command such as pvresize(8), resize2fs(8),
138           ntfsresize(8), btrfs(8), xfs_growfs(8), or resize.f2fs(8).  However
139           virt-resize does not know how to resize some filesystems, so you
140           would have to online resize them after booting the guest.
141
142            # virt-resize --expand /dev/sda2 nbd://example.com outdisk
143
144           The input disk can be a URI, in order to use a remote disk as the
145           source.  The URI format is compatible with guestfish.  See "ADDING
146           REMOTE STORAGE" in guestfish(1).
147
148           Other options are covered below.
149
150       6. Test
151           Thoroughly test the new disk image before discarding the old one.
152
153           If you are using libvirt, edit the XML to point at the new disk:
154
155            # virsh edit guestname
156
157           Change <source ...>, see
158           http://libvirt.org/formatdomain.html#elementsDisks
159
160           Then start up the domain with the new, resized disk:
161
162            # virsh start guestname
163
164           and check that it still works.  See also the "NOTES" section below
165           for additional information.
166
167       7. Resize LVs etc inside the guest
168           (This can also be done offline using guestfish(1))
169
170           Once the guest has booted you should see the new space available,
171           at least for filesystems that virt-resize knows how to resize, and
172           for PVs.  The user may need to resize LVs inside PVs, and also
173           resize filesystem types that virt-resize does not know how to
174           expand.
175
176   SHRINKING A VIRTUAL MACHINE DISK
177       Shrinking is somewhat more complex than expanding, and only an overview
178       is given here.
179
180       Firstly virt-resize will not attempt to shrink any partition content
181       (PVs, filesystems).  The user has to shrink content before passing the
182       disk image to virt-resize, and virt-resize will check that the content
183       has been shrunk properly.
184
185       (Shrinking can also be done offline using guestfish(1))
186
187       After shrinking PVs and filesystems, shut down the guest, and proceed
188       with steps 3 and 4 above to allocate a new disk image.
189
190       Then run virt-resize with any of the --shrink and/or --resize options.
191
192   IGNORING OR DELETING PARTITIONS
193       virt-resize also gives a convenient way to ignore or delete partitions
194       when copying from the input disk to the output disk.  Ignoring a
195       partition speeds up the copy where you don't care about the existing
196       contents of a partition.  Deleting a partition removes it completely,
197       but note that it also renumbers any partitions after the one which is
198       deleted, which can leave some guests unbootable.
199
200   QCOW2 AND NON-SPARSE RAW FORMATS
201       If the input disk is in qcow2 format, then you may prefer that the
202       output is in qcow2 format as well.  Alternately, virt-resize can
203       convert the format on the fly.  The output format is simply determined
204       by the format of the empty output container that you provide.  Thus to
205       create qcow2 output, use:
206
207        qemu-img create -f qcow2 -o preallocation=metadata outdisk [size]
208
209       instead of the truncate command.
210
211       Similarly, to get non-sparse raw output use:
212
213        fallocate -l size outdisk
214
215       (on older systems that don’t have the fallocate(1) command use "dd
216       if=/dev/zero of=outdisk bs=1M count=..")
217
218   LOGICAL PARTITIONS
219       Logical partitions (a.k.a. /dev/sda5+ on disks using DOS partition
220       tables) cannot be resized.
221
222       To understand what is going on, firstly one of the four partitions
223       /dev/sda1-4 will have MBR partition type 05 or "0f".  This is called
224       the extended partition.  Use virt-filesystems(1) to see the MBR
225       partition type.
226
227       Logical partitions live inside the extended partition.
228
229       The extended partition can be expanded, but not shrunk (unless you
230       force it, which is not advisable).  When the extended partition is
231       copied across, all the logical partitions contained inside are copied
232       over implicitly.  Virt-resize does not look inside the extended
233       partition, so it copies the logical partitions blindly.
234
235       You cannot specify a logical partition (/dev/sda5+) at all on the
236       command line.  Doing so will give an error.
237

OPTIONS

239       --help
240           Display help.
241
242       --align-first auto
243       --align-first never
244       --align-first always
245           Align the first partition for improved performance (see also the
246           --alignment option).
247
248           The default is --align-first auto which only aligns the first
249           partition if it is safe to do so.  That is, only when we know how
250           to fix the bootloader automatically, and at the moment that can
251           only be done for Windows guests.
252
253           --align-first never means we never move the first partition.  This
254           is the safest option.  Try this if the guest does not boot after
255           resizing.
256
257           --align-first always means we always align the first partition (if
258           it needs to be aligned).  For some guests this will break the
259           bootloader, making the guest unbootable.
260
261       --alignment N
262           Set the alignment of partitions to "N" sectors.  The default in
263           virt-resize < 1.13.19 was 64 sectors, and after that is 128
264           sectors.
265
266           Assuming 512 byte sector size inside the guest, here are some
267           suitable values for this:
268
269           --alignment 1 (512 bytes)
270               The partitions would be packed together as closely as possible,
271               but would be completely unaligned.  In some cases this can
272               cause very poor performance.  See virt-alignment-scan(1) for
273               further details.
274
275           --alignment 8 (4K)
276               This would be the minimum acceptable alignment for reasonable
277               performance on modern hosts.
278
279           --alignment 128 (64K)
280               This alignment provides good performance when the host is using
281               high end network storage.
282
283           --alignment 2048 (1M)
284               This is the standard alignment used by all newly installed
285               guests since around 2008.
286
287       --colors
288       --colours
289           Use ANSI colour sequences to colourize messages.  This is the
290           default when the output is a tty.  If the output of the program is
291           redirected to a file, ANSI colour sequences are disabled unless you
292           use this option.
293
294       -d
295       --debug
296           (Deprecated: use -v option instead)
297
298           Enable debugging messages.
299
300       --delete PART
301           Delete the named partition.  It would be more accurate to describe
302           this as "don't copy it over", since virt-resize doesn't do in-place
303           changes and the original disk image is left intact.
304
305           Note that when you delete a partition, then anything contained in
306           the partition is also deleted.  Furthermore, this causes any
307           partitions that come after to be renumbered, which can easily make
308           your guest unbootable.
309
310           You can give this option multiple times.
311
312       --expand PART
313           Expand the named partition so it uses up all extra space (space
314           left over after any other resize changes that you request have been
315           done).
316
317           If virt-resize knows how, it will expand the direct content of the
318           partition.  For example, if the partition is an LVM PV, it will
319           expand the PV to fit (like calling pvresize(8)).  Virt-resize
320           leaves any other content it doesn't know about alone.
321
322           Currently virt-resize can resize:
323
324           •   ext2, ext3 and ext4 filesystems.
325
326           •   NTFS filesystems, if libguestfs was compiled with support for
327               NTFS.
328
329               The filesystem must have been shut down consistently last time
330               it was used.  Additionally, ntfsresize(8) marks the resized
331               filesystem as requiring a consistency check, so at the first
332               boot after resizing Windows will check the disk.
333
334           •   LVM PVs (physical volumes).  virt-resize does not usually
335               resize anything inside the PV, but see the --LV-expand option.
336               The user could also resize LVs as desired after boot.
337
338           •   Btrfs filesystems, if libguestfs was compiled with support for
339               btrfs.
340
341           •   XFS filesystems, if libguestfs was compiled with support for
342               XFS.
343
344           •   Linux swap partitions.
345
346               Please note that libguestfs destroys the existing swap content
347               by recreating it with "mkswap", so this should not be used when
348               the guest is suspended.
349
350           •   f2fs filesystems, if libguestfs was compiled with support for
351               f2fs.
352
353           Note that you cannot use --expand and --shrink together.
354
355       --format raw
356           Specify the format of the input disk image.  If this flag is not
357           given then it is auto-detected from the image itself.
358
359           If working with untrusted raw-format guest disk images, you should
360           ensure the format is always specified.
361
362           Note that this option does not affect the output format.  See
363           "QCOW2 AND NON-SPARSE RAW FORMATS".
364
365       --ignore PART
366           Ignore the named partition.  Effectively this means the partition
367           is allocated on the destination disk, but the content is not copied
368           across from the source disk.  The content of the partition will be
369           blank (all zero bytes).
370
371           You can give this option multiple times.
372
373       --LV-expand LOGVOL
374           This takes the logical volume and, as a final step, expands it to
375           fill all the space available in its volume group.  A typical usage,
376           assuming a Linux guest with a single PV /dev/sda2 and a root device
377           called /dev/vg_guest/lv_root would be:
378
379            virt-resize indisk outdisk \
380              --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root
381
382           This would first expand the partition (and PV), and then expand the
383           root device to fill the extra space in the PV.
384
385           The contents of the LV are also resized if virt-resize knows how to
386           do that.  You can stop virt-resize from trying to expand the
387           content by using the option --no-expand-content.
388
389           Use virt-filesystems(1) to list the filesystems in the guest.
390
391           You can give this option multiple times, but it doesn't make sense
392           to do this unless the logical volumes you specify are all in
393           different volume groups.
394
395       --machine-readable
396       --machine-readable=format
397           This option is used to make the output more machine friendly when
398           being parsed by other programs.  See "MACHINE READABLE OUTPUT"
399           below.
400
401       -n
402       --dry-run
403           Print a summary of what would be done, but don’t do anything.
404
405       --no-copy-boot-loader
406           By default, virt-resize copies over some sectors at the start of
407           the disk (up to the beginning of the first partition).  Commonly
408           these sectors contain the Master Boot Record (MBR) and the boot
409           loader, and are required in order for the guest to boot correctly.
410
411           If you specify this flag, then this initial copy is not done.  You
412           may need to reinstall the boot loader in this case.
413
414       --no-extra-partition
415           By default, virt-resize creates an extra partition if there is any
416           extra, unused space after all resizing has happened.  Use this
417           option to prevent the extra partition from being created.  If you
418           do this then the extra space will be inaccessible until you run
419           fdisk, parted, or some other partitioning tool in the guest.
420
421           Note that if the surplus space is smaller than 10 MB, no extra
422           partition will be created.
423
424       --no-expand-content
425           By default, virt-resize will try to expand the direct contents of
426           partitions, if it knows how (see --expand option above).
427
428           If you give the --no-expand-content option then virt-resize will
429           not attempt this.
430
431       --no-sparse
432           Turn off sparse copying.  See "SPARSE COPYING" below.
433
434       --ntfsresize-force
435           Pass the --force option to ntfsresize(8), allowing resizing even if
436           the NTFS disk is marked as needing a consistency check.  You have
437           to use this option if you want to resize a Windows guest multiple
438           times without booting into Windows between each resize.
439
440       --output-format raw
441           Specify the format of the output disk image.  If this flag is not
442           given then it is auto-detected from the image itself.
443
444           If working with untrusted raw-format guest disk images, you should
445           ensure the format is always specified.
446
447           Note that this option does not create the output format.  This
448           option just tells libguestfs what it is so it doesn't try to guess
449           it.  You still need to create the output disk with the right
450           format.  See "QCOW2 AND NON-SPARSE RAW FORMATS".
451
452       -q
453       --quiet
454           Don’t print the summary.
455
456       --resize PART=SIZE
457           Resize the named partition (expanding or shrinking it) so that it
458           has the given size.
459
460           "SIZE" can be expressed as an absolute number followed by b/K/M/G
461           to mean bytes, Kilobytes, Megabytes, or Gigabytes; or as a
462           percentage of the current size; or as a relative number or
463           percentage.  For example:
464
465            --resize /dev/sda2=10G
466
467            --resize /dev/sda4=90%
468
469            --resize /dev/sda2=+1G
470
471            --resize /dev/sda2=-200M
472
473            --resize /dev/sda1=+128K
474
475            --resize /dev/sda1=+10%
476
477            --resize /dev/sda1=-10%
478
479           You can increase the size of any partition.  Virt-resize will
480           expand the direct content of the partition if it knows how (see
481           --expand above).
482
483           You can only decrease the size of partitions that contain
484           filesystems or PVs which have already been shrunk.  Virt-resize
485           will check this has been done before proceeding, or else will print
486           an error (see also --resize-force).
487
488           You can give this option multiple times.
489
490       --resize-force PART=SIZE
491           This is the same as --resize except that it will let you decrease
492           the size of any partition.  Generally this means you will lose any
493           data which was at the end of the partition you shrink, but you may
494           not care about that (eg. if shrinking an unused partition, or if
495           you can easily recreate it such as a swap partition).
496
497           See also the --ignore option.
498
499       --shrink PART
500           Shrink the named partition until the overall disk image fits in the
501           destination.  The named partition must contain a filesystem or PV
502           which has already been shrunk using another tool (eg. guestfish(1)
503           or other online tools).  Virt-resize will check this and give an
504           error if it has not been done.
505
506           The amount by which the overall disk must be shrunk (after carrying
507           out all other operations requested by the user) is called the
508           "deficit".  For example, a straight copy (assume no other
509           operations) from a 5GB disk image to a 4GB disk image results in a
510           1GB deficit.  In this case, virt-resize would give an error unless
511           the user specified a partition to shrink and that partition had
512           more than a gigabyte of free space.
513
514           Note that you cannot use --expand and --shrink together.
515
516       --unknown-filesystems ignore
517       --unknown-filesystems warn
518       --unknown-filesystems error
519           Configure the behaviour of virt-resize when asking to expand a
520           filesystem, and neither libguestfs has the support it, nor virt-
521           resize knows how to expand the content of the filesystem.
522
523           --unknown-filesystems ignore will cause virt-resize to silently
524           ignore such filesystems, and nothing is printed about them.
525
526           --unknown-filesystems warn (the default behaviour) will cause virt-
527           resize to warn for each of the filesystem that cannot be expanded,
528           but still continuing to resize the disk.
529
530           --unknown-filesystems error will cause virt-resize to error out at
531           the first filesystem that cannot be expanded.
532
533           See also "unknown/unavailable method for expanding the TYPE
534           filesystem on DEVICE/LV".
535
536       -v
537       --verbose
538           Enable debugging messages.
539
540       -V
541       --version
542           Display version number and exit.
543
544       --wrap
545           Wrap error, warning, and informative messages.  This is the default
546           when the output is a tty.  If the output of the program is
547           redirected to a file, wrapping is disabled unless you use this
548           option.
549
550       -x  Enable tracing of libguestfs API calls.
551

MACHINE READABLE OUTPUT

553       The --machine-readable option can be used to make the output more
554       machine friendly, which is useful when calling virt-resize from other
555       programs, GUIs etc.
556
557       There are two ways to use this option.
558
559       Firstly use the option on its own to query the capabilities of the
560       virt-resize binary.  Typical output looks like this:
561
562        $ virt-resize --machine-readable
563        virt-resize
564        ntfsresize-force
565        32bitok
566        ntfs
567        btrfs
568
569       A list of features is printed, one per line, and the program exits with
570       status 0.
571
572       Secondly use the option in conjunction with other options to make the
573       regular program output more machine friendly.
574
575       At the moment this means:
576
577       1.  Progress bar messages can be parsed from stdout by looking for this
578           regular expression:
579
580            ^[0-9]+/[0-9]+$
581
582       2.  The calling program should treat messages sent to stdout (except
583           for progress bar messages) as status messages.  They can be logged
584           and/or displayed to the user.
585
586       3.  The calling program should treat messages sent to stderr as error
587           messages.  In addition, virt-resize exits with a non-zero status
588           code if there was a fatal error.
589
590       Versions of the program prior to 1.13.9 did not support the
591       --machine-readable option and will return an error.
592
593       It is possible to specify a format string for controlling the output;
594       see "ADVANCED MACHINE READABLE OUTPUT" in guestfs(3).
595

NOTES

597   "Partition 1 does not end on cylinder boundary."
598       Virt-resize aligns partitions to multiples of 128 sectors (see the
599       --alignment parameter).  Usually this means the partitions will not be
600       aligned to the ancient CHS geometry.  However CHS geometry is
601       meaningless for disks manufactured since the early 1990s, and doubly so
602       for virtual hard drives.  Alignment of partitions to cylinders is not
603       required by any modern operating system.
604
605   GUEST BOOT STUCK AT "GRUB"
606       If a Linux guest does not boot after resizing, and the boot is stuck
607       after printing "GRUB" on the console, try reinstalling grub.
608
609        guestfish -i -a newdisk
610        ><fs> cat /boot/grub/device.map
611        # check the contents of this file are sensible or
612        # edit the file if necessary
613        ><fs> grub-install / /dev/vda
614        ><fs> exit
615
616       For more flexible guest reconfiguration, including if you need to
617       specify other parameters to grub-install, use virt-rescue(1).
618
619   RESIZING WINDOWS BOOT PARTITIONS
620       In Windows Vista and later versions, Microsoft switched to using a
621       separate boot partition.  In these VMs, typically /dev/sda1 is the boot
622       partition and /dev/sda2 is the main (C:) drive.  Resizing the first
623       (boot) partition causes the bootloader to fail with 0xC0000225 error.
624       Resizing the second partition (ie. C: drive) should work.
625
626   WINDOWS CHKDSK
627       Windows disks which use NTFS must be consistent before virt-resize can
628       be used.  If the ntfsresize operation fails, try booting the original
629       VM and running "chkdsk /f" on all NTFS partitions, then shut down the
630       VM cleanly.  For further information see:
631       https://bugzilla.redhat.com/show_bug.cgi?id=975753
632
633       After resize Windows may initiate a lengthy "chkdsk" on first boot if
634       NTFS partitions have been expanded.  This is just a safety check and
635       (unless it find errors) is nothing to worry about.
636
637   WINDOWS UNMOUNTABLE_BOOT_VOLUME BSOD
638       After sysprepping a Windows guest and then resizing it with virt-
639       resize, you may see the guest fail to boot with an
640       "UNMOUNTABLE_BOOT_VOLUME" BSOD.  This error is caused by having
641       "ExtendOemPartition=1" in the sysprep.inf file.  Removing this line
642       before sysprepping should fix the problem.
643
644   WINDOWS 8
645       Windows 8 "fast startup" can prevent virt-resize from resizing NTFS
646       partitions.  See "WINDOWS HIBERNATION AND WINDOWS 8 FAST STARTUP" in
647       guestfs(3).
648
649   SPARSE COPYING
650       You should create a fresh, zeroed target disk image for virt-resize to
651       use.
652
653       Virt-resize by default performs sparse copying.  This means that it
654       does not copy blocks from the source disk which are all zeroes.  This
655       improves speed and efficiency, but will produce incorrect results if
656       the target disk image contains unzeroed data.
657
658       The main time this can be a problem is if the target is a host
659       partition (eg. "virt-resize source.img /dev/sda4") because the usual
660       partitioning tools tend to leave whatever data happened to be on the
661       disk before.
662
663       If you have to reuse a target which contains data already, you should
664       use the --no-sparse option.  Note this can be much slower.
665
666   "unknown/unavailable method for expanding the TYPE filesystem on DEVICE/LV"
667       Virt-resize was asked to expand a partition or a logical volume
668       containing a filesystem with the type "TYPE", but there is no available
669       nor known expanding method for that filesystem.
670
671       This may be due to either of the following:
672
673       1.  There corresponding filesystem is not available in libguestfs,
674           because there is no proper package in the host with utilities for
675           it.  This is usually the case for "btrfs", "ntfs", "xfs", and
676           "f2fs" filesystems.
677
678           Check the results of:
679
680            virt-resize --machine-readable
681            guestfish -a /dev/null run : available
682            guestfish -a /dev/null run : filesystem_available TYPE
683
684           In this case, it is enough to install the proper packages adding
685           support for them.  For example, "libguestfs-xfs" on Red Hat
686           Enterprise Linux, CentOS, Debian, Ubuntu, and distributions derived
687           from them, for supporting the "xfs" filesystem.
688
689       2.  Virt-resize has no support for expanding that type of filesystem.
690
691           In this case, there’s nothing that can be done to let virt-resize
692           expand that type of filesystem.
693
694       In both cases, virt-resize will not expand the mentioned filesystem;
695       the result (unless --unknown-filesystems error is specified) is that
696       the partitions containing such filesystems will be actually bigger as
697       requested, but the filesystems will still be usable at their older
698       sizes.
699

ALTERNATIVE TOOLS

701       There are several proprietary tools for resizing partitions.  We won't
702       mention any here.
703
704       parted(8) and its graphical shell gparted can do some types of resizing
705       operations on disk images.  They can resize and move partitions, but I
706       don't think they can do anything with the contents, and they certainly
707       don't understand LVM.
708
709       guestfish(1) can do everything that virt-resize can do and a lot more,
710       but at a much lower level.  You will probably end up hand-calculating
711       sector offsets, which is something that virt-resize was designed to
712       avoid.  If you want to see the guestfish-equivalent commands that virt-
713       resize runs, use the --debug flag.
714
715       dracut(8) includes a module called "dracut-modules-growroot" which can
716       be used to grow the root partition when the guest first boots up.
717       There is documentation for this module in an associated README file.
718

EXIT STATUS

720       This program returns 0 if successful, or non-zero if there was an
721       error.
722

SEE ALSO

724       virt-filesystems(1), virt-df(1), guestfs(3), guestfish(1), lvm(8),
725       pvresize(8), lvresize(8), resize2fs(8), ntfsresize(8), btrfs(8),
726       xfs_growfs(8), resize.f2fs(8), virsh(1), parted(8), truncate(1),
727       fallocate(1), grub(8), grub-install(8), virt-rescue(1),
728       virt-sparsify(1), virt-alignment-scan(1), http://libguestfs.org/.
729

AUTHOR

731       Richard W.M. Jones http://people.redhat.com/~rjones/
732
734       Copyright (C) 2010-2012 Red Hat Inc.
735

LICENSE

737       This program is free software; you can redistribute it and/or modify it
738       under the terms of the GNU General Public License as published by the
739       Free Software Foundation; either version 2 of the License, or (at your
740       option) any later version.
741
742       This program is distributed in the hope that it will be useful, but
743       WITHOUT ANY WARRANTY; without even the implied warranty of
744       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
745       General Public License for more details.
746
747       You should have received a copy of the GNU General Public License along
748       with this program; if not, write to the Free Software Foundation, Inc.,
749       51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
750

BUGS

752       To get a list of bugs against libguestfs, use this link:
753       https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools
754
755       To report a new bug against libguestfs, use this link:
756       https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
757
758       When reporting a bug, please supply:
759
760       •   The version of libguestfs.
761
762       •   Where you got libguestfs (eg. which Linux distro, compiled from
763           source, etc)
764
765       •   Describe the bug accurately and give a way to reproduce it.
766
767       •   Run libguestfs-test-tool(1) and paste the complete, unedited output
768           into the bug report.
769
770
771
772guestfs-tools-1.49.7              2022-12-10                    virt-resize(1)
Impressum