Ad Widget

Collapse

Increasing available diskspace - Zabbix 3.0 appliance in Hyper-V 2008

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ruslannnn
    Junior Member
    • May 2016
    • 1

    #1

    Increasing available diskspace - Zabbix 3.0 appliance in Hyper-V 2008

    Hello, how can I increase available diskspace in Zabbix 3.0 appliance (Hyper-V 2008)?

    I read the manual:

    Start fdisk to change the partition size. As root, execute:
    fdisk /dev/sda

    This will start fdisk on disk sda. Next, switch to sectors by issuing:
    u
    It's ok, I entered "u", and:

    Then delete the existing partition and create a new one with the desired size. In the majority of cases you will accept the available maximum, which will expand the filesystem to whatever size you made available for the virtual disk. To do so, enter the following sequence in fdisk prompt:

    d
    n
    p
    1
    (accept default 63)
    (accept default max)
    I entered "d" to delete partition, it's ok, but when I enter "n", fdisk asks me enter partition number (1-5). What number I should to enter?
    I tried number "5", for example.
    Command (m for help): d
    Partition number (1-5): 5

    Command (m for help): n
    Partition type:
    p primary (1 primary, 1 extended, 2 free)
    l logical (numbered from 5)
    Select (default p): p
    Partition number (1-4, default 3): 1
    Partition 1 is already defined. Delete it before re-adding it.
    So I should delete/create partition number "1", not "5"?
    Then I quit with "q", enter "fdisk /dev/sda" > "u" > "d", then tried number "1".

    Command (m for help): d
    Partition number (1-5): 1

    Command (m for help): n
    Partition type:
    p primary (0 primary, 1 extended, 3 free)
    l logical (numbered from 5)
    Select (default p): p
    Partition number (1-4, default 1): 1
    First cylinder (1-20886, default 1):
    What partition I should increase? What parameters I should enter in fdisk? Thank you.
  • KoenDeMol
    Junior Member
    • Jan 2019
    • 1

    #2
    I know this is a very old thread and I hope you managed te extend your disk drive by now :-p. But since nobody answered and I was running into the same problem just now I wanted to post the solution in case somebody else runs in to it:

    The deletion of the partition is not necessary (I think the Zabbix documentation has not beet updated). What you actually need to do is create a new primary partition on the avaiable disk space, add that partition to the logical volume and extend the filesystem. These are the steps:

    If you have enlarged the disk space of the existing virtual drive
    - start fdisk /dev/sda
    u (don't mind the depricated warning)
    n
    p
    (leave all the questions to default answer)
    w
    REBOOT
    pvcreate /dev/sda3
    vgextend zabbix-vg /dev/sda3
    lvextend -l 100%FREE /dev/mapper/zabbix--vg-root
    resize2fs /dev/mapper/zabbix--vg-root

    If you have added a new disk to the VM
    - start fdisk /dev/sdb
    u (don't mind the depricated warning)
    n
    p
    (leave all the questions to default answer)
    w
    REBOOT
    pvcreate /dev/sdb1
    vgextend zabbix-vg /dev/sdb1
    lvextend -l 100%FREE /dev/mapper/zabbix--vg-root
    resize2fs /dev/mapper/zabbix--vg-root

    Grtz,
    Koen.
    Last edited by KoenDeMol; 07-07-2019, 18:51.

    Comment

    • Zero565
      Junior Member
      • Oct 2019
      • 8

      #3
      Originally posted by KoenDeMol
      I know this is a very old thread and I hope you managed te extend your disk drive by now :-p. But since nobody answered and I was running into the same problem just now I wanted to post the solution in case somebody else runs in to it:

      The deletion of the partition is not necessary (I think the Zabbix documentation has not beet updated). What you actually need to do is create a new primary partition on the avaiable disk space, add that partition to the logical volume and extend the filesystem. These are the steps:

      If you have enlarged the disk space of the existing virtual drive
      - start fdisk /dev/sda
      u (don't mind the depricated warning)
      n
      p
      (leave all the questions to default answer)
      w
      REBOOT
      pvcreate /dev/sda3
      vgextend zabbix-vg /dev/sda3
      lvextend -l 100%FREE /dev/mapper/zabbix--vg-root
      resize2fs /dev/mapper/zabbix--vg-root

      If you have added a new disk to the VM
      - start fdisk /dev/sdb
      u (don't mind the depricated warning)
      n
      p
      (leave all the questions to default answer)
      w
      REBOOT
      pvcreate /dev/sdb1
      vgextend zabbix-vg /dev/sdb1
      lvextend -l 100%FREE /dev/mapper/zabbix--vg-root
      resize2fs /dev/mapper/zabbix--vg-root

      Grtz,
      Koen.
      Absolute legend! I had the same issue with my zabbix server running out of space and this was spot on, thanks mate!

      Comment

      • Rexhi
        Junior Member
        • Nov 2019
        • 1

        #4
        Thank you KoenDeMol
        I was using Ubuntu 16.04 with Zabbix 4.4 Appliance and i had a problem after some days of work with it.
        The problem that I have received after reboot Zabbix was:
        Database error
        Error connecting to database: No such file or directory

        After several days and hours of googling, I found your post which helps me to solve the problem.
        But before this, I found out that dev/mapper/zabbix --vg- root 100% was full.
        and then your post saves my day.

        Thanks again!

        Comment

        • shaun.vye
          Junior Member
          • Nov 2019
          • 2

          #5
          Hi guy, I am really hoping someone can help me with this. I tried extending my boot partition after expanding the disk in hyper-v using the instructions provided by KoenDeMol above but not had any luck.
          Not sure what has happened but running fdisk -l now shows the following:


          Device Boot Start End Sectors Size Id Type
          /dev/sda1 * 2048 999423 997376 487M 83 Linux
          /dev/sda2 1001470 266336255 265334786 126.5G 5 Extended
          /dev/sda3 266336256 524281274 257945019 123G 83 Linux
          /dev/sda5 1001472 266336255 265334784 126.5G 8e Linux LVM

          Partition 2 does not start on physical sector boundary.
          Partition table entries are not in disk order.


          Disk /dev/mapper/zabbix--vg-root: 123 GiB, 132066050048 bytes, 257941504 sectors
          Units: sectors of 1 * 512 = 512 bytes
          Sector size (logical/physical): 512 bytes / 4096 bytes
          I/O size (minimum/optimal): 4096 bytes / 4096 bytes


          Disk /dev/mapper/zabbix--vg-swap_1: 7.9 GiB, 8489271296 bytes, 16580608 sectors
          Units: sectors of 1 * 512 = 512 bytes
          Sector size (logical/physical): 512 bytes / 4096 bytes
          I/O size (minimum/optimal): 4096 bytes / 4096 bytes


          It seems like I now have an extended partition of 126GB but I cant seem to use this to extend the boot partition. I have even tried GParted but no luck. What is worse is when viewin the disks I cant tell what is what. I know that sda1 is the boot partition. Ideally I want to use the 126GB sda2 partition to extend the boot partition by a few GB and use the rest to extend the main zabbix partition. But I have no idea how to do this despite trying to follow a lot of different guides.
          Any help would be greatly appreciated.

          Thanks
          Shaun

          Comment

          • shaun.vye
            Junior Member
            • Nov 2019
            • 2

            #6
            Nevermind, I managed to fix my problem using a the following:


            Thanks anyway

            Comment

            • Eugene2012
              Member
              • Apr 2020
              • 31

              #7
              The deletion of the existing partition is not needed!
              For Zabbix appliance 4.4.6:

              sudo fdisk /dev/sda
              n
              p
              (leave all the questions to default answer)
              w
              REBOOT
              pvcreate /dev/sda3
              vgextend zabbix-vg /dev/sda3
              lvextend -l 100%FREE /dev/mapper/zabbix--vg-root
              resize2fs /dev/mapper/zabbix--vg-root

              Comment

              • provels
                Member
                • Apr 2020
                • 93

                #8
                Originally posted by KoenDeMol
                If you have enlarged the disk space of the existing virtual drive
                - start fdisk /dev/sda
                u (don't mind the depricated warning)
                n
                p
                (leave all the questions to default answer)
                w
                REBOOT
                pvcreate /dev/sda3
                vgextend zabbix-vg /dev/sda3
                lvextend -l 100%FREE /dev/mapper/zabbix--vg-root
                resize2fs /dev/mapper/zabbix--vg-root

                If you have added a new disk to the VM
                - start fdisk /dev/sdb
                u (don't mind the depricated warning)
                n
                p
                (leave all the questions to default answer)
                w
                REBOOT
                pvcreate /dev/sdb1
                vgextend zabbix-vg /dev/sdb1
                lvextend -l 100%FREE /dev/mapper/zabbix--vg-root
                resize2fs /dev/mapper/zabbix--vg-root

                Grtz,
                Koen.
                This worked for me on 2012R2. but I had to change this line by adding a '+'

                lvextend -l +100%FREE /dev/mapper/zabbix--vg-root

                Comment

                Working...