EROFS: read-only file system,

I am trying to create a file at the specified path, but I get an error.

failed to create file: Error: EROFS: read-only file system, mkdir '/opt/zigbee2mqttD'

link on screen:
OS - Ubunta 20.04
What am I doing wrong?

Your flow worked for me , with the following remarks:

1- Changed directory from /opt/zigbee2mqttD to opt/zigbee2mqtt

2- My Node-RED user (odroid in my case) has permission to read/write in above directory.

odroid@odroid:/opt/zigbee2mqtt/data$ ls -halt
total 32K
drwxr-xr-x 3 odroid odroid 4.0K Aug 6 13:10 .
-rw-r--r-- 1 odroid odroid 14 Aug 6 13:10 test.log
-rw-rw-r-- 1 odroid odroid 874 Aug 6 13:07 state.json
-rw-r--r-- 1 odroid odroid 5.2K Aug 3 15:21 database.db
drwxrwxr-x 9 odroid odroid 4.0K Aug 1 10:37 log
-rw-r--r-- 1 odroid odroid 403 Aug 1 10:36 configuration.yaml
drwxr-xr-x 12 odroid odroid 4.0K Aug 1 00:17 ..

odroid@odroid:/opt/zigbee2mqtt/data$ cat test.log

EROFS stands for Enhanced Read Only File System, so you need to find why the file system is read only.

How did you install node-red and how do you run it?

Thanks for the quick response!
How do you know which user is the Node-red server? or is it the user which I created for login into system (Ubuntu)?

That is determined by how you installed and run it.

i installed it like this!
sudo apt install snap snapd
sudo snap install node-red
sudo apt-get autoremove
And I launch it simply by entering the address in the browser

I don't know about using the snap. The way most (I believe) do it on Ubuntu is to use the pi/ubuntu install script. Whether anyone here will be able to help with a snap install I don't know, but if you were to remove that and run the script instead then there will definitely be help available. Though I don't think normal users have the permissions to create files in /opt so that might be the problem you are encountering.

Ok, thanks! I will delete Node-Rde and will install it according to your links ...

Ok, now I installed Node-Red by the script! There were no errors during installation! I trying to repeat the command again
and get a slightly different error.
failed to create file: Error: EACCES: permission denied, mkdir '/opt/zigbee2mqtt'
What to do now? Can someone help me?


How did you install zigbee2mqtt?

sudo git clone /opt/zigbee2mqtt
sudo chown -R pi:pi /opt/zigbee2mqtt 

In my own small install script I change the owner as soon as I cloned the git repository to the user, which starts also Node-RED (in my case pi)

Thanks, everything is working now! :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.