From 8a7c0b67f53e3d77158d472a577679796d2b957b Mon Sep 17 00:00:00 2001 From: Silvino Silva Date: Mon, 12 Mar 2018 14:47:48 +0000 Subject: tools storage, qemu, lvm revision --- tools/index.html | 5 +++-- tools/lvm.html | 13 ++++++----- tools/qemu.html | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- tools/storage.html | 17 +++++++++++--- 4 files changed, 87 insertions(+), 13 deletions(-) (limited to 'tools') 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 @@
  • Storage
  • LVM @@ -88,7 +89,7 @@
  • 2. Create physical volume
  • 3. Create volume group
  • 4. Create logical volume
  • -
  • 5. Maintenance
  • +
  • 5. Maintenance
  • Syslog-ng 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 @@ Arch Wiki article about Sofware RAID and LVM.

    -

    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.

    -

    LVM or Logic Volume Manager bring one more layer, read Lvm made easy. Partitions under lvm are easy to be resized, moved and there is @@ -28,6 +23,12 @@ disk names exp; production, development, backups...

    +

    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.

    + +

    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";

    @@ -127,7 +128,7 @@ # -

    5. Maintenance

    +

    5. Maintenance

    Resize

    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 @@
             $ sudo modprobe nbd
    -        $ sudo qemu-nbd -c /dev/nbd0 /crux-img.qcow2
    +        $ sudo qemu-nbd -c /dev/nbd0 crux-img.qcow2
             

    Information about preparing @@ -124,6 +124,67 @@ $ sudo qemu-nbd -d /dev/nbd0 +

    2.2. Resize images

    + +

    Verify disk image information;

    + +
    +        $ qemu-img info c1-storage.qcow2
    +        
    + +
    +	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
    +	$
    +	
    + +

    In this example is added 25G to the image;

    + +
    +	$ qemu-img resize c1-storage.qcow2 +25G
    +	
    + +

    Read lvm resize 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;

    + +
    +        $ sudo qemu-nbd -c /dev/nbd0 /srv/qemu/img/c1-server.qcow2
    +        
    + +
    +        # 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
    +        
    + +
    +        # resize2fs /dev/mapper/nbd0p3
    +        # e2fsck /dev/mapper/nbd0p3
    +        
    +

    3. Network

    Network configuration;

    @@ -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 @@

    Storage

    -

    1. Maintenance

    +

    1. Maintenance

    SMART provides statistics of disk firmware, this system handle errors has their occur. Badblocks detect bad blocks @@ -30,14 +30,14 @@

    2. Moving data

    -

    Temp partition with 20M-50M; +

    Temp partition with 20M-50M;

             (parted) mkpart primary ext4 4000MiB 4050MiB
             

    Ports partition with 120G allows to host sources, package - backups and ports; + backups and ports;

             (parted) mkpart primary ext4 192000MiB 312000MiB
    @@ -78,6 +78,17 @@
     
             

    Reboot in normal mode.

    +

    2. Resize filesystem

    + +

    If partition is using lvm read + lvm resize, if you are using qemu + images read resize images

    + +
    +        # resize2fs /dev/sda3
    +        # e2fsck /dev/sda3
    +        
    + Tools Index

    This is part of the c9-doc Manual. -- cgit 1.4.1-2-gfad0