Online increase of the log partition's disk space

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

This article only applies to Hipchat Server .ova deployments. It doesn't apply to AWS deployment since the disk layout and the partition table are totally different.

目的

Depending on the size of your Hipchat Server deployment, the default 4GB size of the /var/log partition is not quite enough to handle growing log files. Please have a look at Increasing disk capacity for steps that apply to the log and root partitions and should be run from the GParted GUI. This article will explain how to run the same steps from the backend and online —without the need to unmout it or boot to a live CD.  

ソリューション

Be sure to run an entire system backup before running the steps below. If you hit any Hipchat Server issues right after the change, revert to the backup taken.


  1. As a preliminary step to this task, increase the virtual machine hard disk space.

  2. Switch to root:

    sudo dont-blame-hipchat 
  3. Find the /var/log partition device:

    mount | grep /var/log

    /var/log will always be a mount point for /dev/sda7.

  4. Start the parted interactive shell:

     parted

    The below will have to be executed inside the parted interactive shell.

  5. Show all partitions:

    print free

    A sample output: 

    Number  Start   End     Size    Type      File system     Flags
            32.3kB  1049kB  1016kB            Free Space
     1      1049kB  1000MB  999MB   primary   ext3            boot
            1000MB  1001MB  1048kB            Free Space
     2      1001MB  42.9GB  41.9GB  extended
     5      1001MB  9000MB  7999MB  logical   linux-swap(v1)
     6      9001MB  31.0GB  22.0GB  logical   ext3
            31.0GB  31.0GB  979kB             Free Space
     7      31.0GB  42.9GB  11.9GB  logical   ext3
            42.9GB  48.3GB  5370MB            Free Space 

    Note that partition 2's type is extended and has the same start as partition 5 and the same end as partition 7, which means that 5, 6 and 7 are under 2. In this case, we need to extend the size of partition 2 first.

  6. Resize partition 2:

    resizepart 2
    # > Warning: Partition /dev/sda2 is being used. Are you sure you want to continue?
    Yes
    # > End?  [42.9GB]? Here, you should use the end of your free space that's in my case 48.3GB but that's just an example.
    48.3GB 
  7. At this point, we resized parent extended partition. Thus, we can resize /dev/sda7:

    resizepart 7
    # > Warning: Partition /dev/sda7 is being used. Are you sure you want to continue?
    Yes
    # > End?  [42.9GB]? Here, you should use the end of your free space that's in my case 48.3GB but that's just an example.
    48.3GB 


  8. Validate the two partition sizes were extended:

    print free
    # Now you can quit the parted interactive shell.
    quit

      

  9. At this point, the disk partitions became actually bigger but the file system didn't. So we also need to resize the file system to match the partition size:

    resize2fs /dev/sda7 

     

  10. Validate /dev/sda7 actually became bigger in size:

    df -h | grep sda7 


     

最終更新日 2018 年 11 月 2 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.