Azure data disk mounting as dr--r--r--, cannot change or write due to Operation not permitted

Nick 0 Reputation points
2023-06-12T14:37:42.89+00:00

As of yesterday, the data disk on my Linux VM has gone read-only. Nothing shows in the Azure VM or Disk settings about this, nor in dmesg. However, you cannot write to it, and you cannot change that

The disk appears to mount find in read-write mode, no errors from umount /models && mount -o rw /models

However, the permissions after mounting are very strange and read-only
ls -ld /models
dr--r--r-- 11 nick nick 4096 Jun 11 18:02 /models

Even as root, you can't change that, nor write to it
root@vm:/# chmod 775 /models
chmod: changing permissions of '/models': Operation not permitted

root@vm:/# mkdir /models/test
mkdir: cannot create directory ‘/models/test’: Operation not permitted

I know it's the right disk, as it has all my data on it!

Shutting the VM down and starting it up again doesn't help. Shutting the machine down, doing a az vm disk detach then az vm disk attach doesn't make any difference. I've tried all 3 Host caching options, no difference.

It all feels like Azure thinks there's something wrong with the disk, and is marking it as read-only to protect me. However I can't find anything that shows any issues. How do I get Azure to let me write to my Data Disk again?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,041 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
{count} votes

1 answer

Sort by: Most helpful
  1. deherman-MSFT 38,021 Reputation points Microsoft Employee Moderator
    2023-06-13T18:36:12.1766667+00:00

    @Nick

    I'm glad that you were able to resolve your issue! I'll repost your solution in case you'd like to "Accept " the answer.

    Issue:

    You were unable to write or edit permissions for your disk. The disk was showing mounted as read/write, but still root could not make changes.

    Solution:
    The directory was set to immutable. You discovered this by running:

    root@vm:/# lsattr -d /models
    ----i---------e------- /models

    Running chattr -i and chmod you were able to resolve this.


    If you still have questions, please let us know in the "comments" and we would be happy to help you. Comment is the fastest way of notifying the experts.

    If the answer has been helpful, we appreciate hearing from you and would love to help others who may have the same question. Accepting answers helps increase visibility of this question for other members of the Microsoft Q&A community.

    Thank you for helping to improve Microsoft Q&A!

    User's image

    0 comments No comments

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.