2015-09-18 17:46:58 -04:00
---
layout: doc
2015-10-13 23:31:03 -04:00
title: Resize Root Disk Image
2015-10-28 18:14:40 -04:00
permalink: /doc/resize-root-disk-image/
2015-10-11 03:04:59 -04:00
redirect_from:
2015-10-28 18:14:40 -04:00
- /en/doc/resize-root-disk-image/
2015-10-11 03:04:59 -04:00
- /doc/ResizeRootDiskImage/
- /wiki/ResizeRootDiskImage/
2015-09-18 17:46:58 -04:00
---
2015-11-19 18:57:10 -05:00
Resize Root Disk Image
----------------------
2015-09-18 17:46:58 -04:00
2017-05-11 04:48:59 -04:00
The safest way to increase the size of `root.img` is to turn your TemplateVM into a StandaloneVM. Doing this means it will have its own root filesystem *(StandaloneVMs use a copy of template, instead of smart sharing)* . To do this run `qvm-create --standalone` from `dom0` Konsole.
2015-09-18 17:46:58 -04:00
2015-11-19 18:57:10 -05:00
### Resize a StandaloneVM Root Image
2015-10-21 00:28:45 -04:00
2015-11-19 18:57:10 -05:00
In `dom0` Konsole run the following command (replace the size and path):
~~~
truncate -s 20G /var/lib/qubes/appvms/standalonevm/root.img
~~~
2015-09-18 17:46:58 -04:00
2015-11-19 18:57:10 -05:00
Then start Terminal for this StandaloneVM and run:
2015-10-21 00:28:45 -04:00
2015-11-19 18:57:10 -05:00
~~~
2015-09-18 17:46:58 -04:00
sudo resize2fs /dev/mapper/dmroot
2015-11-19 18:57:10 -05:00
~~~
2017-05-11 04:48:59 -04:00
Shutdown the StandaloneVM and you will have extended the size of its `root.img`
2015-11-19 18:57:10 -05:00
### Resize a TemplateVM Root Image
2015-09-18 17:46:58 -04:00
2016-03-03 09:28:01 -05:00
Shut down the TemplateVM, as well as all VMs based on that template (since they
share `root.img` ).
In `dom0` Konsole run the following command (replace the size and path):
*Make sure changes in the TemplateVM between reboots didn't exceed 10G.*
2015-11-19 18:57:10 -05:00
~~~
truncate -s 20G /var/lib/qubes/vm-templates/fedora-21/root.img
~~~
2016-03-03 09:28:01 -05:00
Then start only the TemplateVM and run the following. Note that if you are
resizing the TemplateVM used by, e.g., your NetVM, you may need to disable
networking so when the TemplateVM is started, it does not autostart other VMs
based on the same `root.img` . Otherwise you will get an error message `Nothing
to do!`.
2015-11-19 18:57:10 -05:00
~~~
sudo resize2fs /dev/mapper/dmroot
~~~
2015-09-18 17:46:58 -04:00
2017-05-11 04:48:59 -04:00
Shutdown the TemplateVM and you will have extended the size of its `root.img` .