Introduction

Well recently we had a issue with the data connector which was forwarding our firewall logs to Microsoft Sentinel. The issue was related to the disk space being full at the point nothing could run on the system. Unfortunately, there were no documentation for the way it was configured or the right way of increasing the disk space since in Linux there are multiple of ways to increase disk space. In this article I’ll go through increasing the disk space.

Please keep in mind that it has been some years since I worked with Linux servers…

Increase Disk Space

Our Linux VM which is responsible for forwarding firewall logs uses EXT4 partition so I’ll go through increasing disk space for EXT4 extension.

StepDescriptionCommand
1View disk spacelsblk
2View filesystem typedf -Th /dev/sda1
3Grow partitionsudo growpart /dev/sda <PARTITION>
4Verify partition expansionlsblk /dev/sda
5Apply the growth on paritionsudo resize2fs /dev/sda1
6Verify expansiondf -h /dev/sda1
7Reboot rsyslogsystemctl restart rsyslog
8Reboot Azure Monitor Agentsystemctl restart azuremonitoragent

Once the disk space and the different services were rebooted the data connector started working again.

Decreasing Disk Space

This section of the document goes through decreasing disk space. Its crucial to note that this step requires us to deattach the disk and then resize it with a different VM.

StepDescriptionCommand
1View disk spacelsblk -f
2Check filesysteme2fsck -f /dev/sda2
3View minimum size requiredresize2fs -P /dev/sda2
4Shrink the sizeresize2fs /dev/sda2 60G
5Verify the shrink of partitione2fsck -f /dev/sda2
6View block and block sizetune2fs -l /dev/sda2 | grep -E 'Block (count|size)'
7Shrink the partitionparted /dev/sda
unit s
print
resizepart 2 <End>s

I also decided to include instructions to decrease size since it might help with reducing cost once you have figured out why the Linux VM consumes a-lot of disk space.

Conclusion

I primarily focus on things related to cybersecurity but this situation was unique since none knew the reason the data connector stopped working and there were little to none documentation. Therefore I decided to dive into the issue and resolved it by incresing the disk space. I think this information might be helpful for others who might be experiencing similar issue.