# How can I transfer read/write directories in separate partition to set rootfs readonly?

**URL:** <https://forums.digi.com/t/how-can-i-transfer-read-write-directories-in-separate-partition-to-set-rootfs-readonly/21003>\
**Category:** Linux\
**Tags:** yocto, read-only-rootfs\
**Created:** [December 23, 2019, 10:23am UTC](https://forums.digi.com/t/how-can-i-transfer-read-write-directories-in-separate-partition-to-set-rootfs-readonly/21003 "2019-12-23T10:23:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hellsmoke](https://avatars.discourse-cdn.com/v4/letter/h/919ad9/32.png) [@hellsmoke](https://forums.digi.com/u/hellsmoke)\
**Post date:** [December 23, 2019, 10:23am UTC](https://forums.digi.com/t/how-can-i-transfer-read-write-directories-in-separate-partition-to-set-rootfs-readonly/21003/1 "2019-12-23T10:23:41Z")

</div>

Hi

I want to set the rootfs readonly with the Yocto flag “read-only-rootfs”.  
If I use this flag some errors from some packages appear:

Package hostapd  
Package u-boot-fw-utils  
Package base-files  
Package init-ifupdown

How can I set the file access from these packages to a writable partition outside rootfs?

Regards  
Michael

---

<div class="post-metadata">

**Author:** ![LeonidM](https://avatars.discourse-cdn.com/v4/letter/l/d26b3c/32.png) [@LeonidM](https://forums.digi.com/u/LeonidM)\
**Post date:** [December 24, 2019, 7:26am UTC](https://forums.digi.com/t/how-can-i-transfer-read-write-directories-in-separate-partition-to-set-rootfs-readonly/21003/2 "2019-12-24T07:26:24Z")

</div>

Have you followed this document?  
[https://www.yoctoproject.org/docs/2.6/dev-manual/dev-manual.html#creating-a-read-only-root-filesystem](https://www.yoctoproject.org/docs/2.6/dev-manual/dev-manual.html#creating-a-read-only-root-filesystem)

---

<div class="post-metadata">

**Author:** ![hellsmoke](https://avatars.discourse-cdn.com/v4/letter/h/919ad9/32.png) [@hellsmoke](https://forums.digi.com/u/hellsmoke)\
**Post date:** [January 6, 2020, 7:56am UTC](https://forums.digi.com/t/how-can-i-transfer-read-write-directories-in-separate-partition-to-set-rootfs-readonly/21003/3 "2020-01-06T07:56:27Z")

</div>

Hi

Thank you for your answer.

Yes, but this document is very general. I understand that every (YOCTO-)part which wants to write must write elsewhere outside the Readonly-Rootfs.

But for my concrete case is must know:

- What and where do these packages write their data?
- Where and when (startup script?) do I have to set the links to a writeable partition?
- What is the needed FLASH space for these data?
- Do you have a small concrete example?

Regards  
Michael

---

<div class="post-metadata">

**Author:** ![hellsmoke](https://avatars.discourse-cdn.com/v4/letter/h/919ad9/32.png) [@hellsmoke](https://forums.digi.com/u/hellsmoke)\
**Post date:** [January 7, 2020, 10:08am UTC](https://forums.digi.com/t/how-can-i-transfer-read-write-directories-in-separate-partition-to-set-rootfs-readonly/21003/4 "2020-01-07T10:08:03Z")

</div>

Hi

I found out that these errors above came from using the “pkg\_postinst\_ontarget\_${PN}()” functions together with a set “read-only-rootfs”.

There is a lot of code in all these functions used by DIGI bbappend recipes.

How can I realize a readonly Rootfs with these functions?

Regards  
Michael
