Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SD Card read only
13-10-2014, 02:36 PM, (This post was last modified: 13-10-2014, 03:03 PM by Rastlin.)
SD Card read only
Hello friends,

I have one question:
We are using Raspberry Pi's with the RPi-TC Distro as Thin Clients in our company.
Unfortunately are are many of our employees not albe to shutdown the Linux System before they power off the system.
Now the problem occurred that the filesystem on the SD Card is damaged because the Pi was powered off while the system was writing on the SD Card.
The question is, it is possible to set the SD Card as read only?
The Pi is only used to connect to a MS Terminalserverfarm with Connection Broker.

I found this tutorial: (in german)

But when I try to diable the swapfile with:

# dphys-swapfile swapoff

I get the erroer that thy system cant find the command.

Is there another way to configure the system as read only?

Thanks a lot in advance!!

13-10-2014, 06:22 PM,
RE: SD Card read only

have you tried to just switch the "lock" switch on the SD Card to the "lock" position?
So the SDCard is hardware side write protected.

Regards DaWast
-= Feel Free to use the Search function in the upper right corner =-
14-10-2014, 07:08 AM,
RE: SD Card read only

thanks for the fast reply!

But the "Hardware-Write-Lock" is just a pin that can be scanned by the system.
But the Pi does not scan the status of the pin and also isn't able to.

Is there another idea?

Thanks in advance!

16-10-2014, 10:08 PM, (This post was last modified: 16-10-2014, 10:11 PM by Sand Brow.)
RE: SD Card read only
there're commands swapoff/swapon to disable/enable swaps, but I don't think this will reduce risk of FS corruption since swap is always in same place on filesystem (using same blocks) - aborted write to it can't corrupt FS. But aborted logs rotation can. Seems its impossible to turn off ALL logs, but it possible to reduce them (for example compile kernel with disabled logging) and put remained on tmpfs like described here:
17-10-2014, 10:34 AM,
RE: SD Card read only
In RPi-TC ext4 journal is off. To avoid most of the "power off" error i suggest to enable journal on ext4 partition (from a linux os: tune4fs -O has_journal /dev/sdxxxx, where /dev/sdxxxx is your ext4 rpitc sdcard partition)

Forum Jump:

Users browsing this thread: 1 Guest(s)