"Could not change permissions" error while using Azure Files
This article discusses how to troubleshoot a "could not change permissions" error when you use Microsoft Azure Files with your Azure Kubernetes Service (AKS) cluster.
When you run PostgreSQL on the Azure Files plug-in, you receive an error that resembles the following output:
initdb: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted
fixing permissions on existing directory /var/lib/postgresql/data
The Azure Files plug-in uses the Common Internet File System (CIFS) protocol, which is a dialect of the Server Message Block (SMB) protocol. When this protocol is in use, the file and directory permissions can't be changed after the files and directories are mounted.
Use the Azure Disk plug-in instead, and use the subPath property.
For the ext3 or ext4 disk type, there's a lost+found directory after the disk is formatted.
Third-party information disclaimer
The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, about the performance or reliability of these products.