2013-03-07 18:58:33 -05:00
|
|
|
---
|
|
|
|
layout: wiki
|
|
|
|
title: ResizeDiskImage
|
|
|
|
permalink: /wiki/ResizeDiskImage/
|
|
|
|
---
|
|
|
|
|
|
|
|
Resizing Disk Image
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
There are several disk images which can be easily extended.
|
|
|
|
But pay attention to the overall consumed space of your sparse disk images.
|
|
|
|
|
|
|
|
### Private disk image
|
|
|
|
|
2013-11-22 03:30:20 -05:00
|
|
|
1048576 MB is the maximum size which can be assigned to a private storage through qubes-manager.
|
|
|
|
|
|
|
|
To grow the private disk image of a AppVM beyond this limit [qubes-grow-private](/wiki/Dom0Tools/QvmGrowPrivate) can be used:
|
2013-03-07 18:58:33 -05:00
|
|
|
|
|
|
|
``` {.wiki}
|
|
|
|
qvm-grow-private <vm-name> <size>
|
|
|
|
```
|
|
|
|
|
2013-12-21 07:55:18 -05:00
|
|
|
Note: Size is the target size (i.e. 4096MB or 16GB, ...), not the size to add to the existing disk.
|
|
|
|
|
|
|
|
Note2: If once the VM is started, the disk is has not been increased, you can issue in the VM's terminal:
|
|
|
|
|
|
|
|
``` {.wiki}
|
|
|
|
sudo resize2fs /dev/xvdb
|
|
|
|
```
|
|
|
|
|
2013-03-07 18:58:33 -05:00
|
|
|
### HVM disk image
|
|
|
|
|
2013-10-04 06:47:53 -04:00
|
|
|
In this example we will grow the disk image of an HVM to 30GB.
|
|
|
|
|
|
|
|
First, stop/shutdown the HVM.
|
|
|
|
|
|
|
|
Then, from a Dom0 terminal (in KDE: System Tools -\> Terminal Emulator) do the following:
|
2013-03-07 18:58:33 -05:00
|
|
|
|
|
|
|
``` {.wiki}
|
2013-10-04 06:47:53 -04:00
|
|
|
cd /var/lib/qubes/appvms/<yourHVM>/
|
|
|
|
ls -lh root.img (<--verify current size of disk image)
|
|
|
|
truncate -s 30GB root.img
|
|
|
|
ls -lh root.img (<--verify new size of disk image)
|
2013-03-07 18:58:33 -05:00
|
|
|
```
|
|
|
|
|
2013-10-04 06:47:53 -04:00
|
|
|
The partition table and file-system must be adjusted after this change:
|
2013-03-07 18:58:33 -05:00
|
|
|
|
2013-10-04 06:47:53 -04:00
|
|
|
#### Windows 7
|
2013-03-07 18:58:33 -05:00
|
|
|
|
2013-10-04 06:47:53 -04:00
|
|
|
1. Click Start
|
|
|
|
2. type "diskmgmt.msc" - this takes you to Disk Management
|
|
|
|
3. Right-click on your existing volume, select "Extend Volume..."
|
|
|
|
4. Click through the wizard.
|
2013-03-07 18:58:33 -05:00
|
|
|
|
2013-10-04 06:47:53 -04:00
|
|
|
No reboot required.
|
2013-03-07 18:58:33 -05:00
|
|
|
|
|
|
|
#### FreeBSD
|
|
|
|
|
|
|
|
``` {.wiki}
|
|
|
|
gpart recover ada0
|
|
|
|
sysctl kern.geom.debugflags=0x10
|
|
|
|
gpart resize -i index ada0
|
|
|
|
zpool online -e poolname ada0
|
|
|
|
```
|