aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qemu.html
diff options
context:
space:
mode:
authorSilvino Silva <silvino@bk.ru>2018-03-12 14:47:48 +0000
committerSilvino Silva <silvino@bk.ru>2018-03-12 14:47:48 +0000
commit8a7c0b67f53e3d77158d472a577679796d2b957b (patch)
tree8427ead88283d895cd65a062aff7a26b19320a5e /tools/qemu.html
parent77fe64b172a6d1847ec80b6fa34ac06816a4030d (diff)
downloaddoc-8a7c0b67f53e3d77158d472a577679796d2b957b.tar.gz
tools storage, qemu, lvm revision
Diffstat (limited to 'tools/qemu.html')
-rw-r--r--tools/qemu.html65
1 files changed, 63 insertions, 2 deletions
diff --git a/tools/qemu.html b/tools/qemu.html
index 2066a6e..e32d03f 100644
--- a/tools/qemu.html
+++ b/tools/qemu.html
@@ -53,7 +53,7 @@
<pre>
$ sudo modprobe nbd
- $ sudo qemu-nbd -c /dev/nbd0 /crux-img.qcow2
+ $ sudo qemu-nbd -c /dev/nbd0 crux-img.qcow2
</pre>
<p>Information about preparing
@@ -124,6 +124,67 @@
$ sudo qemu-nbd -d /dev/nbd0
</pre>
+ <h3 id="resize">2.2. Resize images</h3>
+
+ <p>Verify disk image information;</p>
+
+ <pre>
+ $ qemu-img info c1-storage.qcow2
+ </pre>
+
+ <pre>
+ image: c1-storage.qcow2
+ file format: qcow2
+ virtual size: 10G (10737418240 bytes)
+ disk size: 7.6G
+ cluster_size: 65536
+ Format specific information:
+ compat: 1.1
+ lazy refcounts: false
+ refcount bits: 16
+ corrupt: false
+ $
+ </pre>
+
+ <p>In this example is added 25G to the image;</p>
+
+ <pre>
+ $ qemu-img resize c1-storage.qcow2 +25G
+ </pre>
+
+ <p>Read <a href="lvm.html#resize">lvm resize</a> if image
+ is using lvm, or use resize2fs. If size is not provided to resize2fs,
+ by default it will grow file system to all partition;</p>
+
+ <pre>
+ $ sudo qemu-nbd -c /dev/nbd0 /srv/qemu/img/c1-server.qcow2
+ </pre>
+
+ <pre>
+ # kpartx -a -s -l -u /dev/nbd0
+ GPT:Primary header thinks Alt. header is not at the end of the disk.
+ GPT:Alternate GPT header not at the end of the disk.
+ GPT: Use GNU Parted to correct GPT errors.
+
+ # parted /dev/nbd0
+ GNU Parted 3.2
+ Using /dev/nbd0
+ Welcome to GNU Parted! Type 'help' to view a list of commands.
+ (parted) print
+ Warning: Not all of the space available to /dev/nbd0 appears to be used, you can
+ fix the GPT to use all of the space (an extra 16777216 blocks) or continue with
+ the current setting?
+ Fix/Ignore? Fix
+
+ (parted) resize 3 100%
+ (parted) quit
+ </pre>
+
+ <pre>
+ # resize2fs /dev/mapper/nbd0p3
+ # e2fsck /dev/mapper/nbd0p3
+ </pre>
+
<h2 id="net">3. Network</h2>
<p>Network configuration;</p>
@@ -164,7 +225,7 @@
ADDR=10.0.0.254
NET=10.0.0.0
- GW=192.168.1.254
+ GW=10.0.0.1
MASK=24
# one tap for each cpu core