about summary refs log tree commit diff stats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/index.html5
-rw-r--r--tools/lvm.html13
-rw-r--r--tools/qemu.html65
-rw-r--r--tools/storage.html17
4 files changed, 87 insertions, 13 deletions
diff --git a/tools/index.html b/tools/index.html
index 2f84114..1c4eb00 100644
--- a/tools/index.html
+++ b/tools/index.html
@@ -78,8 +78,9 @@
             </li>
             <li><a href="storage.html">Storage</a>
                 <ul>
-                    <li><a href="storage.html#maint">1. Maintenance</a></li>
+                    <li><a href="storage.html#fsck">1. Maintenance</a></li>
                     <li><a href="storage.html#mv">2. Moving data</a></li>
+                    <li><a href="storage.html#resize">2. Resize</a></li>
                 </ul>
             </li>
             <li><a href="lvm.html">LVM</a>
@@ -88,7 +89,7 @@
                     <li><a href="lvm.html#pv">2. Create physical volume</a></li>
                     <li><a href="lvm.html#vg">3. Create volume group</a></li>
                     <li><a href="lvm.html#lv">4. Create logical volume</a></li>
-                    <li><a href="lvm.html#maint">5. Maintenance</a></li>
+                    <li><a href="lvm.html#fsck">5. Maintenance</a></li>
                 </ul>
             </li>
             <li><a href="syslog-ng.html">Syslog-ng</a>
diff --git a/tools/lvm.html b/tools/lvm.html
index ed0f3c1..b6c7678 100644
--- a/tools/lvm.html
+++ b/tools/lvm.html
@@ -16,11 +16,6 @@
         <a href="https://wiki.archlinux.org/index.php/Software_RAID_and_LVM">Arch Wiki</a>
         article about Sofware RAID and LVM.</p>
 
-        <p>Basic idea behind RAID is to deal with independent disks
-        as an array of drives. Raid 0 uses two or more disks as one,
-        with performance gains without fault-tolerance. From raid 1
-        to 6 they offer diferent fault tolerance mechanisms.</p>
-
         <p>LVM or Logic Volume Manager bring one more layer, read
         <a href="http://www.tuxradar.com/content/lvm-made-easy">Lvm made easy</a>.
         Partitions under lvm are easy to be resized, moved and there is
@@ -28,6 +23,12 @@
         disk names exp; production, development, backups...</p>
 
 
+        <p>Basic idea behind RAID is to deal with independent disks
+        as an array of drives. Raid 0 uses two or more disks as one,
+        with performance gains without fault-tolerance. From raid 1
+        to 6 they offer diferent fault tolerance mechanisms.</p>
+
+
         <p>Until now "from install" there is only one partition,
         it is good idea to have a system with diferent partitions for each
         propos. If is a "fresh install";</p>
@@ -127,7 +128,7 @@
         #
         </pre>
 
-        <h2 id="maint">5. Maintenance</h2>
+        <h2 id="fsck">5. Maintenance</h2>
 
         <h3 id="resize">Resize</h3>
 
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
diff --git a/tools/storage.html b/tools/storage.html
index 109c6fa..2fc95d4 100644
--- a/tools/storage.html
+++ b/tools/storage.html
@@ -9,7 +9,7 @@
 
         <h1>Storage</h1>
 
-        <h2 id="maint">1. Maintenance</h2>
+        <h2 id="fsck">1. Maintenance</h2>
 
         <p>SMART provides statistics of disk firmware, this system
         handle errors has their occur. Badblocks detect bad blocks
@@ -30,14 +30,14 @@
 
         <h2 id="mv">2. Moving data</h2>
 
-        <p>Temp partition with 20M-50M;</dd>
+        <p>Temp partition with 20M-50M;</p>
 
         <pre>
         (parted) mkpart primary ext4 4000MiB 4050MiB
         </pre>
 
         <p>Ports partition with 120G allows to host sources, package
-        backups and ports;</dd>
+        backups and ports;</p>
 
         <pre>
         (parted) mkpart primary ext4 192000MiB 312000MiB
@@ -78,6 +78,17 @@
 
         <p>Reboot in normal mode.</p>
 
+        <h2 id="resize">2. Resize filesystem</h2>
+
+        <p>If partition is using lvm read
+        <a href="lvm.html#resize">lvm resize</a>, if you are using qemu
+        images read <a href="qemu.html#resize">resize images</a></p>
+
+        <pre>
+        # resize2fs /dev/sda3
+        # e2fsck /dev/sda3
+        </pre>
+
         <a href="index.html">Tools Index</a>
         <p>
         This is part of the c9-doc Manual.