Page 1 of 1

Files going 'read only'

Posted: Tue Aug 20, 2019 11:14 pm
by Mince_67
Look for some help, I have a simple loop recording setup that deletes and old video file and records a new one.
It works fine but randomly a video file becomes read-only and locks up the system when it tries to delete the file. I have also found other files like the python script also can become read-only.
I have tried storing on the SD card and usb stick.
I have tried using Raspian, Raspian lite and Ubuntu mate and all are doing the same.

Any advice

Re: Files going 'read only'

Posted: Wed Aug 21, 2019 1:35 am
by bjtheone
Could you provide the script that does the "loop"? Files don't just randomly change permissions. Permission are very fundamental to Unix/Linux, have worked the same way for a really long time and don't just randomly change. Either something in your setup/config/environment is incorrect such that you create files with read only or you are changing permissions from r/w to r-o.

Depending on how you are running a script file and what user you are running it as, it may get a different environment and behave differently, but it is not going to behave randomly.

Re: Files going 'read only'

Posted: Wed Aug 21, 2019 7:42 am
by tpylkko
Perhaps the device is mounting read only at times and you think that it is the files. You might see an error message in dmesg about this. You can list and change read only flag with hdparm.

It might be a sign that the drive is going bad, they tend to do this when they are showing hardware issues