Fix line breaks and misc spelling

This commit is contained in:
awokd 2018-02-05 15:55:34 +00:00 committed by GitHub
parent 4f4c397352
commit e36fc0ec3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,7 +11,8 @@ redirect_from:
Resize Private Disk Image Resize Private 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. See also additional information and caveats about [resizing the root disk image](/doc/resize-root-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.
See also additional information and caveats about [resizing the root disk image](/doc/resize-root-disk-image/).
### Private disk image (R4.0) ### Private disk image (R4.0)
@ -46,7 +47,8 @@ Note: Size is the target size (i.e. 4096MB or 16GB, ...), not the size to add to
### Shrinking private disk image (Linux VM, R3.2) ### Shrinking private disk image (Linux VM, R3.2)
**This operation is dangerous and this is why it isn't available in standard Qubes tools. If you have enough disk space, it is safer to create a new VM with a smaller disk and move the data.** **This operation is dangerous and this is why it isn't available in standard Qubes tools.
If you have enough disk space, it is safer to create a new VM with a smaller disk and move the data.**
The basic idea is to: The basic idea is to:
@ -55,15 +57,16 @@ The basic idea is to:
Ext4 does not support online shrinking, so it can't be done as conveniently as growing the image. Ext4 does not support online shrinking, so it can't be done as conveniently as growing the image.
Note that we don't want to touch the VM filesystem directly in dom0 for security reasons. Note that we don't want to touch the VM filesystem directly in dom0 for security reasons.
First you need to start VM without `/rw` mounted. One possibility is to interrupt its normal startup First you need to start VM without `/rw` mounted.
by adding the `rd.break` kernel option: One possibility is to interrupt its normal startup by adding the `rd.break` kernel option:
~~~ ~~~
qvm-prefs -s <vm-name> kernelopts rd.break qvm-prefs -s <vm-name> kernelopts rd.break
qvm-start --no-guid <vm-name> qvm-start --no-guid <vm-name>
~~~ ~~~
And wait for qrexec connect timeout (or simply press Ctrl-C). Then you can connect to VM console and shrink the filesystem: And wait for qrexec connect timeout (or simply press Ctrl-C).
Then you can connect to VM console and shrink the filesystem:
~~~ ~~~
sudo xl console <vm-name> sudo xl console <vm-name>
@ -85,7 +88,9 @@ Now you can resize the image:
truncate -s <new-desired-size> /var/lib/qubes/appvms/<vm-name>/private.img truncate -s <new-desired-size> /var/lib/qubes/appvms/<vm-name>/private.img
~~~ ~~~
**It is critical to use the same (or bigger for some safety margin) size in truncate call compared to resize2fs call. Otherwise you will loose your data!** Then reset kernel options back to default: **It is critical to use the same (or bigger for some safety margin) size in truncate call compared to resize2fs call.
Otherwise you will lose your data!**
Then reset kernel options back to default:
~~~ ~~~
qvm-prefs -s <vm-name> kernelopts default qvm-prefs -s <vm-name> kernelopts default
@ -93,17 +98,18 @@ qvm-prefs -s <vm-name> kernelopts default
Done. Done.
>In order to avoid error, you might want to first reduce the filesystem to a smaller size than desired (say 3G), then truncate the image to the target size (for example 4G), and lastly grow the filesystem to the target size. In order to do this, after the `truncate` step, start the vm again in maintenance mode and use the following command to extend the filesystem to the correct size : `resize2fs /dev/xvdb`. >In order to avoid error, you might want to first reduce the filesystem to a smaller size than desired (say 3G), then truncate the image to the target size (for example 4G), and lastly grow the filesystem to the target size.
>In order to do this, after the `truncate` step, start the vm again in maintenance mode and use the following command to extend the filesystem to the correct size : `resize2fs /dev/xvdb`.
> >
>With no argument, resize2fs grows the filesystem to match the underlying block device (the .img file you just shrunk) >With no argument, resize2fs grows the filesystem to match the underlying block device (the .img file you just shrunk).
OS Specific Follow-up Instructions OS Specific Follow-up Instructions
----------------- -----------------
After resizing volumes, the partition table and file-system may need to be adjusted. After resizing volumes, the partition table and file-system may need to be adjusted.
Use tools appropriate to the OS in your qube. Brief instructions for Windows 7, Use tools appropriate to the OS in your qube.
FreeBSD, and Linux are provided below. Brief instructions for Windows 7, FreeBSD, and Linux are provided below.
#### Windows 7 #### Windows 7