Read-only file system

Just about everything about Red Pitaya
Post Reply
adam.polak
Posts: 37
Joined: Mon Jul 28, 2014 11:32 am

Read-only file system

Post by adam.polak » Sat Dec 12, 2015 9:43 pm

Hi!

What may be the reason (and what may be the best solution) when Redpitaya file system suddenly goes into read-only mode (I'm using latest ecosystem). It happened to me twice already - I can use the RedPitaya without any problems, I switch it off at the end, and the next time I switch it on it's in read-only file system. For the first time it happened few weeks ago when I had UART RX and TX pins connected and for the first time I was trying the UART C code example from PR example page. On that day everything was OK, but next day - read-only file system... I tried to go through some suggestions found online how to change it back to writable, but nothing worked and I end up formatting the card and copying SD card once again. Today it happened for the second time. This time I have LCD display connected to 4 pins: +5V, GRD, and UART RX and TX pins, and I continue studying communication via UART, but after last time system become read-only - cannot modify my C code or compile anything.. I don't know if there is any relation between my studying of UART and this problem - I had these connections before, I was switching RP on and off many times on other days and nothing like this happened. I don't think it's SD card related or RP board related, because these are 2 different cards and 2 different RP boards where this problem occurred. What may be the reason of this behaviour? Is it possible that I'm doing something wrong what triggers RP to protect the data?

cheers
Adam

User avatar
redpitaya
Site Admin
Posts: 907
Joined: Wed Mar 26, 2014 7:04 pm

Re: Read-only file system

Post by redpitaya » Mon Dec 14, 2015 12:22 pm

Hi Adam,

If i understand you correctly you are able
to input
redpitaya> rw
command and set RP to read/write system
but, without any reseting of the board, the system will
go back to read only?

All best, RP

adam.polak
Posts: 37
Joined: Mon Jul 28, 2014 11:32 am

Re: Read-only file system

Post by adam.polak » Mon Dec 14, 2015 2:00 pm

Hi,

Well - I'm not sure really. The first time it happened nothing helped and at some point it asked me if I want to repair file system (or something like this - don't remember exactly) and I agreed - then he (linux?) was modifying a lot of files and at the end informed me that file system was changed from ext3 to ext2 and RP become not responsive and did not boot up after restart - this is when I end up formatting card and copying new image.
This time restarting RP was enough to restore rw rights and subsequently it worked ok, but I submitted this post to ask if it's maybe something common that I may be doing wrong to trigger this read-only behaviour..

If it will happen again I'll post my observations here..
Thank you for your reply!
Adam

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Read-only file system

Post by Nils Roos » Mon Dec 14, 2015 10:05 pm

A corrupted filesystems is usually the consequence of shutting down the power without properly shutting down the OS first. It occurs when the power is lost while the filesystem writes to the medium (either servicing current requests or flushing cached data).
On the next boot, the OS detects this situation and mounts the medium read-only to avoid further damage, before initiating repairs.

If you want to minimize the risk of it happening, do a "shutdown 0" via console before disconnecting the power.

adam.polak
Posts: 37
Joined: Mon Jul 28, 2014 11:32 am

Re: Read-only file system

Post by adam.polak » Mon Dec 14, 2015 11:20 pm

Hi Nils,

Thank you for this explanation! That really makes a lot of sense for me now! Actually I always found if a bit harsh to just power off the RP with system basically still running.. from now on I will be nicer to my RP and will shut it down before powering off :)

Thank you again!
Adam

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 109 guests