Azure Linux VM: Command to check on which disk a directory is mounted

Rajesh Swarnkar 911 Reputation points
2022-12-02T09:40:36.597+00:00

We have a Oracle Linux VM which has an OS disk and a Data disk. I want to extend the /var directory by 25GB.
However, I dont know on which of two disks the /var is mounted.

  • Is there a command to check?
  • How to extend the disk by specific GB?
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,013 questions
Azure Disk Storage
Azure Disk Storage
A high-performance, durable block storage designed to be used with Azure Virtual Machines and Azure VMware Solution.
668 questions
0 comments No comments
{count} votes

Accepted answer
  1. Prrudram-MSFT 28,201 Reputation points Moderator
    2022-12-02T13:35:48.407+00:00

    Hello @Rajesh Swarnkar ,

    Thank you for reaching out to the Microsoft Q&A platform. Happy to answer your question.

    df -h should be able to show the mount disk. Also, usually /var is just a directory and not a mountpoint. So, wherever the directory / is mounted that is the disk where /var also resides. You just need to expand the volume which contains /

    266619-image.png

    You can also try something like this df -h /var.. But if the /var is not mounted as a mountpoint, then it might not list.

    Expanding of disk size can be done using fdisk commands or LVM commands based on the configuration.

    Ref: https://learn.microsoft.com/en-us/azure/virtual-machines/linux/expand-disks?tabs=azure-cli%2Cubuntu

    Hope this helps.
    Please "Accept as Answer" and Upvote if the answer provided is useful, so that you can help others in the community looking for remediation for similar issues.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.