about summary refs log tree commit diff stats
path: root/tools
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
parent77fe64b172a6d1847ec80b6fa34ac06816a4030d (diff)
downloaddoc-8a7c0b67f53e3d77158d472a577679796d2b957b.tar.gz
tools storage, qemu, lvm revision
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.
='#n499'>499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928