# '/home/root' user partition became 'read-only' suddenly

**URL:** <https://forum.sierrawireless.com/t/home-root-user-partition-became-read-only-suddenly/22888>\
**Category:** WP Series\
**Created:** [February 17, 2021, 4:34pm UTC](https://forum.sierrawireless.com/t/home-root-user-partition-became-read-only-suddenly/22888 "2021-02-17T16:34:29Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![tachyon](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@tachyon](https://forum.sierrawireless.com/u/tachyon)\
**Post date:** [February 17, 2021, 4:34pm UTC](https://forum.sierrawireless.com/t/home-root-user-partition-became-read-only-suddenly/22888/1 "2021-02-17T16:34:29Z")

</div>

We found one of the failure unit during some stress test showed a weird issue behavior – ‘/home/root/’ partition became ‘read-only’, NOT ‘read/write’.  
Due to this, the application keeps getting crashed because the logger object can’t be instantiated and rerun by monitoring thread repeatedly.  
We’ve never seen this behavior before and the only possible way to recover seems reprogramming or reflashing FW – but not yet checked this recovery method.  
My questions regarding this issue are,

1. What can make ‘/home/root/’ partition ‘read-only’? What’s the possible scenarios about the root cause of this issue?
2. What’s the way to recover when this issue is encountered? Reflashing FW is the only way? Or what else?

Thanks!

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [February 18, 2021, 12:37am UTC](https://forum.sierrawireless.com/t/home-root-user-partition-became-read-only-suddenly/22888/2 "2021-02-18T00:37:06Z")

</div>

never seen this before, but you can try download to FW R11 and try swiflash to recover the module ( assume you are using WP7 module):

> [@Swiflash -r broken with release 12 on wp77xx?](https://forum.sierrawireless.com/t/swiflash-r-broken-with-release-12-on-wp77xx/20957):
>
> Hey, After a board issue (see topic [https://forum.mangoh.io/t/cannot-access-mangoh-yellow-wp7702/4848/27](https://forum.mangoh.io/t/cannot-access-mangoh-yellow-wp7702/4848/27)) I think there is a problem with the swiflash command and its -r option for recovery mode. With fw R12, this tool doesn’t work, I had to downgrade to R11 to be able to use it. Thanks wink

---

<div class="post-metadata">

**Author:** ![tachyon](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@tachyon](https://forum.sierrawireless.com/u/tachyon)\
**Post date:** [February 19, 2021, 9:22pm UTC](https://forum.sierrawireless.com/t/home-root-user-partition-became-read-only-suddenly/22888/3 "2021-02-19T21:22:13Z")

</div>

I need the answer about the question below rather than recovery method suggestion

1. What can make ‘/home/root/’ partition ‘read-only’? What’s the possible scenarios about the root cause of this issue?

---

<div class="post-metadata">

**Author:** ![tachyon](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@tachyon](https://forum.sierrawireless.com/u/tachyon)\
**Post date:** [February 19, 2021, 9:49pm UTC](https://forum.sierrawireless.com/t/home-root-user-partition-became-read-only-suddenly/22888/4 "2021-02-19T21:49:28Z")

</div>

What I need are

1. What can make ‘/home/root/’ partition ‘read-only’? What’s the possible scenarios about the root cause of this issue?
2. About recovery method, I want to confirm if there is any other way than reflashing FW, i.e. in running kernel.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [February 19, 2021, 10:00pm UTC](https://forum.sierrawireless.com/t/home-root-user-partition-became-read-only-suddenly/22888/5 "2021-02-19T22:00:56Z")

</div>

Have you compared the boot message with a working module and see which line becomes different?

I believe the partition mounting is done by /etc/init.d/mount\_early, not sure if you can compare this file

---

<div class="post-metadata">

**Author:** ![tachyon](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@tachyon](https://forum.sierrawireless.com/u/tachyon)\
**Post date:** [February 22, 2021, 2:03pm UTC](https://forum.sierrawireless.com/t/home-root-user-partition-became-read-only-suddenly/22888/6 "2021-02-22T14:03:16Z")

</div>

Unfortunately I don’t have the failure device in my hand. It’s in testing 3rd party in India.  
Can you kindly provide the detailed step they can follow easily? The testers have bare knowledge on the technical background…

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [February 22, 2021, 2:12pm UTC](https://forum.sierrawireless.com/t/home-root-user-partition-became-read-only-suddenly/22888/7 "2021-02-22T14:12:21Z")

</div>

The boot message is in uart! You can capture it during boot up

---

<div class="post-metadata">

**Author:** ![tachyon](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@tachyon](https://forum.sierrawireless.com/u/tachyon)\
**Post date:** [February 22, 2021, 4:05pm UTC](https://forum.sierrawireless.com/t/home-root-user-partition-became-read-only-suddenly/22888/8 "2021-02-22T16:05:08Z")

</div>

I asked 3rd Party test to share the kernel log(’/home/kernel.log’ from the failure unit. Once I get it, I will share it for your analysis.  
By the way, 3rd party reported the recovery command failed as follows. FW version is R9. Can you think what the issue is?

 ![Base Station Upgrade](https://us1.discourse-cdn.com/flex025/uploads/sierrawireless/original/2X/a/a55cbe750c3b87992ec30743e129850e7926ab21.png)

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [February 22, 2021, 11:10pm UTC](https://forum.sierrawireless.com/t/home-root-user-partition-became-read-only-suddenly/22888/9 "2021-02-22T23:10:02Z")

</div>

It cannot go into download mode, is it keeping on reset?

---

<div class="post-metadata">

**Author:** ![tachyon](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@tachyon](https://forum.sierrawireless.com/u/tachyon)\
**Post date:** [February 22, 2021, 11:22pm UTC](https://forum.sierrawireless.com/t/home-root-user-partition-became-read-only-suddenly/22888/10 "2021-02-22T23:22:02Z")

</div>

That’s what I know directly from the message too. Any else? It keeps failing!

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [February 23, 2021, 12:03am UTC](https://forum.sierrawireless.com/t/home-root-user-partition-became-read-only-suddenly/22888/11 "2021-02-23T00:03:15Z")

</div>

Then can you read the message directly and knowing if it is resetting?  
Have you compared the boot message with a working module and see which line becomes different?

---

<div class="post-metadata">

**Author:** ![tachyon](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@tachyon](https://forum.sierrawireless.com/u/tachyon)\
**Post date:** [March 4, 2021, 10:23pm UTC](https://forum.sierrawireless.com/t/home-root-user-partition-became-read-only-suddenly/22888/12 "2021-03-04T22:23:29Z")

</div>

Here is the snippet about why UBIFS suddenly became read-only from Linux MTD forum and how to check.

* * *

## UBIFS suddenly became read-only - what is this?

Read-write UBIFS file-system may suddenly become read-only because of an error. This is how UBIFS reacts on unexpected errors which it cannot properly handle - it immediately switches to read-only mode in order to protect the data from any possible further corruption.

If this happened, you should look at UBIFS-related `dmesg` messages. UBIFS usually prints error messages before switching to read-only mode. The messages may shed some light on what happened. Feel free to ask for help from the [MTD mailing list](http://www.linux-mtd.infradead.org/mail.html). If you think this is an UBIFS bug, please, send a [bug report](http://www.linux-mtd.infradead.org/faq/ubifs.html#L_how_send_bugreport).

## How do I detect if UBIFS became read-only?

If you use up-to-date UBIFS which includes commit `2fde99cb55fb9d9b88180512a5e8a5d939d27fec` ( `UBIFS: mark VFS SB RO too` ), then you should be able to find this out from `/proc/mounts` . You should also be able to use something like `inotify` to catch events when UBIFS becomes R/O (e.g., due to some errors).

Still this answer from forum doesn’t locate the exact code location in UBIFS driver that make UBIFS read-only when it faces any non-recoverable error and even doesn’t tell what non-recoverable errors are there.  
Looking into kernel sources, I could locate the UBIFS kernel codes related with the non-recoverable errors that set UBIFS read-only mode as follows.

1. If the read-only happened following any base station reboot or manual power cycle reboot, then it might be related mostly with Journaling, I/O related errors.
2. Otherwise i.e. it happened following the progressively happening file-system full, it might be related with commit errors or possibly I/O, journaling too.

**[Commit related]**

1. error in **do\_commit() – logical block to physical block commit**

ubifs\_err(c, “commit failed, error %d”, err)

1. error in **ubifs\_bg\_thread()**

err = ubifs\_bg\_wbufs\_sync©;

\*ubifs\_bg\_wbufs\_sync - synchronize write-buffers.

**[IO related]**

1. error in **ubifs\_leb\_write()**

ubifs\_err(c, “writing %d bytes to LEB %d:%d failed, error %d”,len, lnum, offs, err);

1. error in **ubifs\_leb\_change()**

ubifs\_err(c, “changing %d bytes in LEB %d failed, error %d”, len, lnum, err);

1. error in **ubifs\_leb\_unmap()**

ubifs\_err(c, “unmap LEB %d failed, error %d”, lnum, err);

1. error in **ubifs\_leb\_map()**

ubifs\_err(c, “mapping LEB %d failed, error %d”, lnum, err);

1. error in **next\_sqnum()**

- next\_sqnum - get next sequence number

ubifs\_err(c, “sequence number overflow %llu, end of life”, sqnum);

1. error in **ubifs\_bg\_wbufs\_sync()**

- ubifs\_bg\_wbufs\_sync - synchronize write-buffers

ubifs\_err(c, “cannot sync write-buffer, error %d”, err);

1. error in **ubifs\_sync\_wbufs\_by\_inode()**

- ubifs\_sync\_wbufs\_by\_inode - synchronize write-buffers for an inode

err = ubifs\_wbuf\_sync\_nolock()

\*ubifs\_wbuf\_sync\_nolock - synchronize write-buffer.

**[Journaling related]**

1. error in **ubifs\_jnl\_update()**

- ubifs\_jnl\_update - update inode

1. error in **ubifs\_jnl\_write\_data()**

\*ubifs\_jnl\_write\_data - write a data node to the journal

1. error in **ubifs\_jnl\_write\_inode()**

- ubifs\_jnl\_write\_inode - flush inode to the journal

1. error in **ubifs\_jnl\_delete\_inode()**

\*ubifs\_jnl\_delete\_inode - delete an inode

1. error in **ubifs\_jnl\_rename()**

- ubifs\_jnl\_rename - rename a directory entry

1. error in **ubifs\_jnl\_truncate()**

- ubifs\_jnl\_truncate - update the journal for a truncation

1. error in **ubifs\_jnl\_delete\_xattr()**

- ubifs\_jnl\_delete\_xattr - delete an extended attribute

1. error in **ubifs\_jnl\_change\_xattr()**

- ubifs\_jnl\_change\_xattr - change an extended attribute
