We have upgraded the community system as part of the upgrade a password reset is required for all users before login in.

Onion Memory structure



  • Hi Community,

    I'm looking more in detail into the onion disk storage layout. And I must admit....I'm really confused....

    First: I'm working with on onion omega 2S+ which is given with 32MB of flash storage. If I run a df -h command, I get this:
    8fb2204b-df9c-4185-ae9f-afb23d48961c-image.png

    I do not understand where I can see the total available disk space of 32MB.

    Second: running a du -h -d 1 / command, will output this:
    f982ffec-0f9b-434b-9b33-e7b262a4f51a-image.png

    I really don't get the link between both as the df command indicates a usage of 11.6MB in /overlay and the du command indicates a size of 20.7MB for overlay

    Third (and this is where it get's really difficult for me to understand): If I just dump a 2967KB text file into /root (via ssh) I get this if I run the du command:
    a11ffe66-05b2-459b-be63-29f457a4c1e6-image.png

    I do not see where the additionnal 2967KB went...Moreover, the du command shows:
    544e339d-e0cd-4511-87e6-73f60bc70ea4-image.png

    According to this, adding this 2,967MB file used about 5,8MB on disk...

    Any explanation for this? I'm just making these trials in order to make sure my application will not run out of storage. However, I'm not able to understand this.

    Thanks in advance,

    MK



  • @MK If your application needs sufficient reliable storage, then is it a possibility for you to use the SD Card interface? That might be a better option.

    Does your app write frequently to the storage? Does it over write frequently?
    I don't know how much wear and tear the built in flash chip can take.



  • @MK

    @MK Take a look at this link that explains how file systems work on OpenWrt and pay particular attention to how the overlay partition works.

    https://openwrt.org/docs/techref/flash.layout#explanations



  • @SpiderKenny
    Thanks for your reply.
    My app will write quite a lot. The device is intended to collect external data (every minute or so) and transfer the data to an MQTT broker. However, the device will always keep an internal Database (sqlite) in order to backup the sent data. Database will be about 2MB at it's maximum size.
    Not sure the internal flash really is an issue with frequent writings. I always understood sd cards are more prone to errors over time. My device has a built in sd card slot if needed. If really really necessary I could therefore switch to the sd card. However, if possible, I'd like to avoid this.

    @crispyoz
    Thanks for the link. This is exactly what I was looking for. I'll dive into this content.



Looks like your connection to Community was lost, please wait while we try to reconnect.