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.
As a preliminary step to this task, increase the virtual machine hard disk space.
Switch to root:
mount | grep /var/log
/var/log will always be a mount point for
Start the parted interactive shell:
The below will have to be executed inside the parted interactive shell.
Show all partitions:
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.
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
At this point, we resized parent extended partition. Thus, we can resize
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
Validate the two partition sizes were extended:
print free # Now you can quit the parted interactive shell. quit
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:
Validate /dev/sda7 actually became bigger in size:
df -h | grep sda7