Ad Widget

Collapse

Zabbix server extend disk size

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • musc1
    Junior Member
    • Jul 2021
    • 7

    #1

    Zabbix server extend disk size

    Hi all,

    I have disk memory problem in zabbix server as it is almost 90% used. Can you help me by guiding me on how to extend the disk size of zabbix host? I have the partitions showed in the figures.
    Attached Files
  • Answer selected by markfree at 04-07-2024, 19:50.
    joostdeheer
    Junior Member
    • Feb 2022
    • 7

    Since you're using LVM this can be done online

    The procedure is:
    1 Add a new physical volume. or extend the current physical volume
    2 Add the new physical volume to the volume group
    3 Add the new free space to the logical volume
    4 Extend the filesystem on the logical volume

    Some information that I gathered from your screenshot:
    * The logical volume that needs to be extended is the one that's mounted on /var
    * The logical volume name is 'var'
    * This logical volume resides on volume group 'vg01'

    The following information is missing: What type of filesystem is on the disk? XFS? Ext4? Btrfs?

    The easiest way is to add a new disk as a new physical volume. You can extend the current physical volume on the existing disk as well, but that can be a bit trickier.

    Step 0, before you do anything, or before you even start thinking about doing anything: Make sure you have a current backup, and that you've tested the restore procedure!

    1. Add a new physical volume
    Add a new disk to the server
    Snapshot the machine
    Log in
    Rescan the SCSI-bus (most distro's have 'rescan-scsi-bus.sh' or something similar, if you don't have it check https://www.debuntu.org/how-to-resca...out-rebooting/ for the manual procedure)
    fdisk -l should now show the new disk, let's say it's /dev/sdb.
    pvcreate /dev/sdb
    2. Add the new physical volume to the volume group
    vgextend vg01 /dev/sdb
    3. Add the new free space to the logical volume
    lvextend /dev/vg01/var -l+100%FREE
    4. Extend the filesystem on the logical volume
    If you use XFS: xfs_growfs /dev/mapper/vg01-var
    If you use ext4: resize2fs /dev/mapper/vg01-var
    If you use btrfs: btrfs filesystem resize max /var

    If you really want to extend the current partition and you can have downtime: Try gparted (https://gparted.org), it's a bootable ISO with a graphical interface so you can resize the partitions and volumes graphically, and all the fiddling with partition tables will be done in the background for you.
    Last edited by joostdeheer; 24-02-2022, 17:30.

    Comment

    • joostdeheer
      Junior Member
      • Feb 2022
      • 7

      #2
      Since you're using LVM this can be done online

      The procedure is:
      1 Add a new physical volume. or extend the current physical volume
      2 Add the new physical volume to the volume group
      3 Add the new free space to the logical volume
      4 Extend the filesystem on the logical volume

      Some information that I gathered from your screenshot:
      * The logical volume that needs to be extended is the one that's mounted on /var
      * The logical volume name is 'var'
      * This logical volume resides on volume group 'vg01'

      The following information is missing: What type of filesystem is on the disk? XFS? Ext4? Btrfs?

      The easiest way is to add a new disk as a new physical volume. You can extend the current physical volume on the existing disk as well, but that can be a bit trickier.

      Step 0, before you do anything, or before you even start thinking about doing anything: Make sure you have a current backup, and that you've tested the restore procedure!

      1. Add a new physical volume
      Add a new disk to the server
      Snapshot the machine
      Log in
      Rescan the SCSI-bus (most distro's have 'rescan-scsi-bus.sh' or something similar, if you don't have it check https://www.debuntu.org/how-to-resca...out-rebooting/ for the manual procedure)
      fdisk -l should now show the new disk, let's say it's /dev/sdb.
      pvcreate /dev/sdb
      2. Add the new physical volume to the volume group
      vgextend vg01 /dev/sdb
      3. Add the new free space to the logical volume
      lvextend /dev/vg01/var -l+100%FREE
      4. Extend the filesystem on the logical volume
      If you use XFS: xfs_growfs /dev/mapper/vg01-var
      If you use ext4: resize2fs /dev/mapper/vg01-var
      If you use btrfs: btrfs filesystem resize max /var

      If you really want to extend the current partition and you can have downtime: Try gparted (https://gparted.org), it's a bootable ISO with a graphical interface so you can resize the partitions and volumes graphically, and all the fiddling with partition tables will be done in the background for you.
      Last edited by joostdeheer; 24-02-2022, 17:30.

      Comment

      • musc1
        Junior Member
        • Jul 2021
        • 7

        #3
        Thank you very much joostdeheer for the details guide. I managed to extend the disk following your suggestions without downtime.

        Comment

        • sciensys
          Junior Member
          • Feb 2020
          • 20

          #4
          if you used Zabbix iso appliance on ESXi, to extend /var/lib/mysql try to use https://gparted.org
          gparted GUI allows you to extend your disk in some clicks, takes some seconds.
          Attached Files

          Comment

          Working...