0

I am trying to edit the /boot/config.txt and /boot/cmdline.txt files.

However, anytime I edit or even copy them to the /boot like this:

sudo cp /boot/config.txt /boot/config.txt.orig

when I reboot the changes are vanished.

I tried to sync filesystems, the /boot partition is mounted rw.

/etc/fstab mounts the boot partition to defaults, overlayfs does not seem enable (or I did not manage to see it)

Even when I use the raspi-config tool, it changes the files but when rebooting, changes disappear.

I just don't understand what is happening.

Installation information

Debian version is 10.4

$ cat /etc/os-release 
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Can someone give me a lead to disable that strange behaviour ? What did I miss ?

Edit

Additional information

Here is the output of dmesg after SD card connection:

[300353.948056] sd 1:0:0:0: [sdb] 31291392 512-byte logical blocks: (16.0 GB/14.9 GiB)
[300353.949361] sd 1:0:0:0: [sdb] Write Protect is off
[300353.949386] sd 1:0:0:0: [sdb] Mode Sense: 2f 00 00 00
[300353.957419] sd 1:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[300353.979048]  sdb: sdb1 sdb2
[300353.984830] sd 1:0:0:0: [sdb] Attached SCSI removable disk
2
  • 2
    looks like your SD card has gone into read only mode. That can happen when it's failing. Test by creating a file e.g. in /boot; reboot and see if it's still there
    – Dirk
    Commented Jan 4, 2021 at 22:58
  • Yes that is exactly what I did and it did not work. Actually SD card is in read-only mode but how to fix this ?
    – lauhub
    Commented Jan 5, 2021 at 9:29

1 Answer 1

4

A SD Card has a limited lifetime with writing cycles to it. When this limit is reached it goes into read only mode to be able to backup the data before the card completely fails. So I strongly recommend to use a new SD Card and clone the old one as long as it is possible. I would keep using the old one as little as possible. The first step should be to take an image of it as backup.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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