I've had Raspberry Pi running few years Arch Linux ARM 24/7. All the sudden there seems to be inability to write anything, can't create new files nor edit anything, even as root. Same applies to any software, Nginx refuses to start. For example, when opening some file, say with nano there is a following textbox in the bottom:

[ Read 121 lines. (Warning: No write permission) ]

Reboot doesn't help, although it is possible to read the files,has the SD-card given up the ghost?

df -h

Filesystem      Size  Used Avail Use% Mounted on
/dev/root        29G   11G   16G  41% /
devtmpfs        237M     0  237M   0% /dev
tmpfs           241M     0  241M   0% /dev/shm
tmpfs           241M  4.3M  236M   2% /run
tmpfs           241M     0  241M   0% /sys/fs/cgroup
tmpfs           241M     0  241M   0% /tmp
/dev/mmcblk0p5   90M   22M   69M  24% /boot
tmpfs            49M     0   49M   0% /run/user/1000

touch testfile
touch: cannot touch ‘testfile’: Read-only file system

cat /etc/mtab

rootfs / rootfs rw 0 0
/dev/root / ext4 ro,relatime,data=ordered 0 0
devtmpfs /dev devtmpfs rw,relatime,size=241728k,nr_inodes=60432,mode=755 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,nodev,mode=755 0 0
tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0
cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd 0 0
cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0
cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0
cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0
cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
cgroup /sys/fs/cgroup/bfqio cgroup rw,nosuid,nodev,noexec,relatime,bfqio 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=28,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
tmpfs /tmp tmpfs rw 0 0
mqueue /dev/mqueue mqueue rw,relatime 0 0
configfs /sys/kernel/config configfs rw,relatime 0 0
/dev/mmcblk0p5 /boot vfat rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro 0 0
tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=49196k,mode=700,uid=1000,gid=100 0 0
  • can you add the output of df -h to your question. Also what happens if you create a new file with touch testfile, then nano testfile and enter some dummy text? Feb 18 '15 at 18:24
  • The contents of /etc/mtab may also be of interest (i.e. add the result of cat /etc/mtab to your post).
    – joan
    Feb 18 '15 at 18:36
  • 1
    Try sudo mount -f -o remount,rw /dev/mmcblk0p2. I don't think there's anything wrong with the SD card; something else has gotten screwed up somehow. If you are running this headless and logging in remotely, plug in a monitor to watch it boot and see if anything is unusual. You could also look through the logs at the boot process and see if there's any clues/warnings there.
    – goldilocks
    Feb 18 '15 at 19:39
  • A difference between mine and yours is that you have /dev/root / ext4 ro whereas I have /dev/root / ext4 rw. It's as if your system is being mounted read only which happens when a file system fault is detected.
    – joan
    Feb 18 '15 at 20:08

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 possible back the card up entirely and then attempt to write to it (even format it). You may well find that other machines can't write to it.

If that's the case you'll need a new SD card and need to take an image backup and restore it to a new card.

  • The write-protect switch on the SD card holder (activated by the insertion of the card with the WP slider in one postion) is not wired up to anything in the Pi (the absence of such is noted in one of lines that scroll by during boot-up) and - given that virtually all Pis use at least part of the SD card in a write-mode by default - the Designers probably thought it was not sensible to do so. This is different from the Kernel following the /etc/fstab option errors=remount-ro which is what caused the read-only mode encountered.
    – SlySven
    Dec 22 '15 at 4:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.