7

I guess your image is OpenELEC as @Lawrence said that. OpenELEC uses squashfs compressed image filesystem so you can't edit without uncompressing. To uncompress it, convert your sd-card content into image with dd command in another computer which runs linux. dd if=/dev/mmcblk0 of=/tmp/openelec.img Then install squashfs-tools to get compress/uncompress ...


7

Have a look in /var/log/syslog and see if you can find some indication of why. If the filesystem is mounting read-only, the last thing in that file will be whatever happened when it was still read-write, since the system cannot log there otherwise. Which may or may not be helpful... The kernel's own log is in memory, however, and does not require a ...


7

Linux kernel is caching disk operations. That means data is written not in real time, but when it is "time to do it". There could be two reasons of behaviour you described: 1. Your SD card (or disk) is not fast enough to receive all the data you are producing. 2. Once in 30-40 seconds kernel is 'flushing' it's disk buffers, which unluckily freezes all disk ...


3

Turns out it was some sort of OS glitch or incompatibility. I ran the following commands overnight and it fixed the problem sudo umount /dev/sda1 # /dev/sda1 is the name of my external drive partition sudo fsck -Cy /dev/sda1


3

I just installed OpenElec on a Pi 3, and it puts the partition that is normally mounted as /boot on other distributions as /flash. OpenELEC:~ # df | grep p1 /dev/mmcblk0p1 524008 151736 372272 29% /flash As you say, it is mounted by default as read-only. OpenELEC:~ # mount | grep flash /dev/mmcblk0p1 on /flash type vfat (ro,noatime,fmask=...


3

The system will not write to the boot partition unless you ask it to by editing a boot configuration file (config.txt, cmdline.txt) or by updating the firmware.


3

You can do this very easily with a shell script: #!/bin/sh COMMAND=endless.py LOGFILE=restart.txt writelog() { now=`date` echo "$now $*" >> $LOGFILE } writelog "Starting" while true ; do $COMMAND writelog "Exited with status $?" writelog "Restarting" done If you really want to use python: #!/usr/bin/env python import time, subprocess ...


2

This is most likely because something (by the looks of that command it is the BASH shell and SFTP-Server) is/are accessing the root filesystem. During boot nothing is accessing anything in / yet, so it can be set to read-only. However, once boot-up is complete, some software may want a lock on the filesystem or some files are being changed within. Obviously,...


2

If you still can not unmount or remount your device after stopping all services and processes with open files, then there may be a swap file or swap partition keeping your device busy. This will not show up with fuser or lsof. Turn off swapping with: sudo swapoff -a You could check beforehand and show a summary of any swap partitions or swap files with: ...


2

You can emulate a magic sysrq keypress by executing # echo "u" > /proc/sysrq-trigger This causes the kernel to low-level try to remount all filesystems read only, see here.


2

If the pi is working properly, SD card corruption should never happen regardless of whether the card is rw or ro (at least until the card is worn out, which would take quite a long time). The exception would be pulling the plug suddenly on a busy system, in which case a rw filesystem will be more vulnerable. Since you have decided to do that regularly, ...


2

This could be a problem with your SD card. I've had a Scandisk cards suddenly die. When it died it went into read only mode "to protect your data from loss". It's plausible your SD card has done the same. If it's an old RPI (using a regular SD card) then double check the read/write switch on the SD card. Try placing the card into another machine. If ...


2

Thank you @JOAN for clearing things up. need to send 1st byte as command, and then shift out another 8 bits to get my return data. here are two functions that are working for me def readRegister(self,regAddr): address = 0x80 | regAddr resp = self.spi.xfer2([address,0x00]) return resp[1] def writeRegister(self,regAddr,value): self.spi....


2

Assuming you are no longer talking about logs in particular. Have a look at /proc/diskstats. If you cat /proc/diskstats you will see statistics for various devices. Each device has 11 entries as follows. Name units description ---- ----- ----------- read I/Os requests number of read I/Os processed read ...


2

Assuming we're talking about the hardware UART here, although that is not the default behaviour for the Pi 3 where the PL011 UART is connected to the BT module, while the mini UART is used for Linux console output.. see here and here for how to fix that. As for the hardware buffer: a minor problem - no official datasheet is available for the Pi 3's ...


2

Since it seems that your /etc/fstab is missing, you may want to fill it in with the necessary information. You'll need to manually mount the root and boot partitions first: sudo mount -o remount,rw /dev/mmcblk0p1 /boot sudo mount -o remount,rw /dev/mmcblk0p2 / And then create a new /etc/fstab sudo echo -e "proc /proc proc ...


2

I suspect your issue is that you are mounting the vfat filesystem so that it is only accessible to the root user. The vfat filesystem (being a very simple filesystem dating from the ancient days of DOS) has no concept of users and groups, but all files in UNIX systems must have an owner and group. To work around this, the Linux vfat driver defaults to ...


1

I'm pretty sure this is a caching problem. The code f = open("test.txt","w") f.write("abc") opens the text file for writing and sends the data abc to it, but this data is not immediately written to disk. It remains in a cache in RAM until More data is sent to the file, so the cache gets full and is flushed to disk The code explicitly forces to write the ...


1

Your root filesystem on your SDCard partition #2 (/dev/mmcblk0p2 - device 179,2) is in need of a fsck and the system can't run that automatically. You'll need a new SDCard, a copy of plain Raspbian and a USB SDCard reader. Or you'll need a laptop running Ubuntu or Mint that has an SDCard reader. If doing it on a new SDCard, get Raspbian written to the new ...


1

It looks like you have the mount permissions as read/write for root but only read for anyone else. I think you would need to set the permissions on /media/HDD to be writeable for the walter user or the users group. sudo chown -R root:users /media/HDD will set the group permissions to users (I presume this exists?) or sudo chown -R walter:users /media/HDD ...


1

You can mount your root fs read only, and switch between RO and RW. For switching : I have 2 scripts in /usr/local/bin: /usr/local/bin/rw with inside #! /bin/sh mount / -o rw,remount /usr/local/bin/ro with #! /bin/sh mount / -o ro,remount You then make them executable : sudo chmod +x /usr/local/bin/ro /usr/local/bin/rw Then you also ...


1

You can certainly read multiple bytes using read. The comments about FIFO are misleading, even though they are important to ensure high speed troughput, are inaccessable. The kernel drivers almost certainly provide buffering, but again this is inaccessable. (In the 1970s I wrote my own drivers which used a 256 character circular buffer.) The following ...


1

I have also asked this question Why is the green LED (ACT) blinking without SD card activity also at the Raspberry Pi Forum and received this answer: by rpdom » Wed Feb 22, 2017 8:02 pm From what I understand, the Pi sends a "status" request to the card every few seconds to check that it is still there and working. That will cause the LED to flash, ...


1

Yes there are logs, most should be under /var/log. Use the command ls /var/log -lrt to get a reverse time ordered list of files in that directory. You can tune some logging with the file /etc/rsyslog.conf. If you want to disable as much logging as possible add a line with *.* ~ just after the #### RULES #### comment block. Not all logging may be ...


1

Various people have some read/write benchmarks of various SD cards on the pi here. Notice that the read speed maxes out no matter what at around 20 MB/s, and the write speed will not be higher. That's a limitation of the pi's SD card reader. It is worth noting because it means there's no point in very high performance cards; you can get the 20 MB/s read ...


1

In bare metal programming you are in control of the hardware. You decide how you want memory to work and you decide if you want to program the memory management unit(s) to use virtual addresses. Terms like kernel space and user space are meaningless for bare metal programming. The mmap function is only relevant if your program is running in a Linux (or ...


1

I am not a big fan of SD cards. I have had several go bad on me. I have had success using a USB Flash drive instead. You still need an SD card for the boot partition, but you can write protected it and use the USB for your filesystem. Here is a tutorial and another one here. Basicly you need to do the following: Back up your SD card and flash the image ...


1

I was banging the same wall for a long time, until I found this: https://wiki.debian.org/ReadonlyRoot#Find_processes_blocking_the_remount_readonly When lsof and fuser do not show any files opened for writing on / (which seems your case), there could still be processes that have opened files that were deleted since, and they are blocking the remount. The ...


1

On many SD cards, there is a switch prohibiting write access. If it is off, switch it the other way to disable write protection. If the switch is not to blame, I would advise following the advice here for rescuing.


1

Is the file in the same directory as app.py? There are a couple of gotchas about running from a file manager. Consider the following trivial program, living on my desktop: #!/usr/bin/python import os import time print "Working directory: ", os.getcwd() time.sleep(10) If I run it in the terminal like ./pytest.py (after doing cd Desktop), I get: Working ...


Only top voted, non community-wiki answers of a minimum length are eligible