# Read only root filesystem

**URL:** <https://forum.openwrt.org/t/read-only-root-filesystem/111913>\
**Category:** Installing and Using OpenWrt\
**Created:** [November 14, 2021, 3:27pm UTC](https://forum.openwrt.org/t/read-only-root-filesystem/111913 "2021-11-14T15:27:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![w3k4](https://forum.openwrt.org/letter_avatar/w3k4/32/5_5575768a8748004e209b776fc1b2916d.png) [@w3k4](https://forum.openwrt.org/u/w3k4)\
**Post date:** [November 14, 2021, 3:27pm UTC](https://forum.openwrt.org/t/read-only-root-filesystem/111913/1 "2021-11-14T15:27:11Z")

</div>

Mini Router/PC with Raspberry Pi Compute Module 4, Dual Gigabit Ethernet NIC s, 4GB RAM/32GB eMMC, Support OpenWRT

I have recently purchased and booted .. but the root filesystem is read-only, when I remount it, am informed the device it write-protected.

```
BusyBox v1.33.1 (2021-08-25 09:14:02 UTC) built-in shell (ash)

  _______________ __
 | |.-----.-----.-----.| | | |.----.| |_
 | - || _ | -__| || | | || _|| _|
 | _______||__ | _____|__ | __||________ || __| |____ |
          |__| W I R E L E S S F R E E D O M
 -----------------------------------------------------
 OpenWrt 21.02-SNAPSHOT, r16273+15-378769b555
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------

root@OpenWrt:~# passwd
Changing password for root
New password:
Retype password:
passwd: /etc/passwd: Read-only file system
passwd: can't update password file /etc/passwd

root@OpenWrt:~# mount -o remount,rw /
mount: /: cannot remount /dev/mmcblk0p2 read-write, is write-protected.

root@OpenWrt:~# mount
/dev/mmcblk0p2 on / type ext4 (ro,noatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/mmcblk0p1 on /boot type vfat (rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,noatime,mode=700)
nfsd on /proc/fs/nfsd type nfsd (rw,relatime)

root@OpenWrt:~# fsck -f /dev/mmcblk0p2
-ash: fsck: not found

root@OpenWrt:~# uname -a
Linux OpenWrt 5.4.142 #0 SMP Wed Aug 25 09:14:02 2021 aarch64 GNU/Linux

root@OpenWrt:~# cat /etc/os-release
NAME="OpenWrt"
VERSION="21.02-SNAPSHOT"
ID="openwrt"
ID_LIKE="lede openwrt"
PRETTY_NAME="OpenWrt 21.02-SNAPSHOT"
VERSION_ID="21.02-snapshot"
HOME_URL="https://openwrt.org/"
BUG_URL="https://bugs.openwrt.org/"
SUPPORT_URL="https://forum.openwrt.org/"
BUILD_ID="r16273+15-378769b555"
OPENWRT_BOARD="bcm27xx/bcm2711"
OPENWRT_ARCH="aarch64_cortex-a72"
OPENWRT_TAINTS="no-all"
OPENWRT_DEVICE_MANUFACTURER="OpenWrt"
OPENWRT_DEVICE_MANUFACTURER_URL="https://openwrt.org/"
OPENWRT_DEVICE_PRODUCT="Generic"
OPENWRT_DEVICE_REVISION="v0"
OPENWRT_RELEASE="OpenWrt 21.02-SNAPSHOT r16273+15-378769b555"
```

I've got to believe someone else has already worked this out..

---

<div class="post-metadata">

**Author:** ![0x13enny](https://forum.openwrt.org/user_avatar/forum.openwrt.org/0x13enny/32/44546_2.png) [@0x13enny](https://forum.openwrt.org/u/0x13enny)\
**Post date:** [November 26, 2021, 6:56pm UTC](https://forum.openwrt.org/t/read-only-root-filesystem/111913/2 "2021-11-26T18:56:50Z")

</div>

In my case, I ran

```
e2fsck /dev/mmcblk0p2

```

`e2fsck` will fix the corrupted file system

---

<div class="post-metadata">

**Author:** ![w3k4](https://forum.openwrt.org/letter_avatar/w3k4/32/5_5575768a8748004e209b776fc1b2916d.png) [@w3k4](https://forum.openwrt.org/u/w3k4)\
**Post date:** [December 18, 2021, 1:35pm UTC](https://forum.openwrt.org/t/read-only-root-filesystem/111913/4 "2021-12-18T13:35:13Z")

</div>

Thank you very much!!  
I did not get to it until today, but that exact command worked .. I should have just put the -y option on that, but even without it was not too bad.

---

<div class="post-metadata">

**Author:** ![tmomas](https://forum.openwrt.org/letter_avatar/tmomas/32/5_5575768a8748004e209b776fc1b2916d.png) [@tmomas](https://forum.openwrt.org/u/tmomas)\
**Post date:** [December 18, 2021, 5:34pm UTC](https://forum.openwrt.org/t/read-only-root-filesystem/111913/5 "2021-12-18T17:34:17Z")

</div>

If your problem is solved, please consider marking this topic as [Solved]. See [How to mark a topic as [Solved]](https://forum.openwrt.org/t/how-to-mark-a-topic-as-solved/40174) for a short how-to.
