# \[HowTo\]\[Modding\] Investigating Homey’s eMMC wear estimation

**URL:** <https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149>\
**Category:** Questions & Help\
**Tags:** homey-pro-2023, modding, howto\
**Created:** [December 30, 2023, 9:26am UTC](https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149 "2023-12-30T09:26:58Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sharkys](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sharkys/32/54029_2.png) [@Sharkys](https://community.homey.app/u/Sharkys)\
**Post date:** [December 30, 2023, 9:26am UTC](https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149/1 "2023-12-30T09:26:58Z")

</div>

> Discussed with @Sharkys this requires it’s own Topic, Therefore moved.  
> Prerequisite: [[Modding][HowTo] Guide to Jailbreak a Homey Pro 2023](https://community.homey.app/t/howto-modding-guide-to-jailbreak-a-homey-pro-2023/81678)

Those of you having root on your Homey and rather bigger smart home (eg. \>100 devices \>50 apps installed) , can you check your emmc chip wear level ?

```auto
 ̶s̶u̶d̶o̶ ̶a̶p̶t̶ ̶i̶n̶s̶t̶a̶l̶l̶ ̶m̶m̶c̶-̶u̶t̶i̶l̶s̶
sudo mmc extcsd read /dev/mmcblk0 | grep -i life
sudo mmc extcsd read /dev/mmcblk0 | grep EOL

```

In my case :

```auto
eMMC Life Time Estimation A [EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_A]: 0x0b
eMMC Life Time Estimation B [EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_B]: 0x0b
eMMC Pre EOL information [EXT_CSD_PRE_EOL_INFO]: 0x01

```

**Based on ChatGPT interpretation :**  
For many eMMCs, a value of `0x0b` might indicate that the memory has reached 60-70% of its expected lifetime, but this can vary depending on the manufacturer’s specifications.  
The `eMMC Pre EOL information [EXT_CSD_PRE_EOL_INFO]: 0x01` suggests that the eMMC is not yet at its end-of-life stage, but it’s getting closer.

I’m running my Homey since aprox. 1st of May 2023 (replaced CM4).

_I would like to compare your data as mmc-tool might be not 100% reliable estimating life span of each and every MMC._

> Edit

> [@mroek](#):
>
> on the latest stable firmware, and mmc-utils now comes preinstalled, so that step in the howto can be skipped

---

<div class="post-metadata">

**Author:** ![Ranney](https://avatars.discourse-cdn.com/v4/letter/r/848f3c/32.png) [@Ranney](https://community.homey.app/u/Ranney)\
**Post date:** [December 30, 2023, 9:42am UTC](https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149/2 "2023-12-30T09:42:27Z")

</div>

Will do that when I receive my tool to connect my broken CM4 directly to my pc. 👍

---

<div class="post-metadata">

**Author:** ![Sharkys](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sharkys/32/54029_2.png) [@Sharkys](https://community.homey.app/u/Sharkys)\
**Post date:** [January 8, 2024, 3:30pm UTC](https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149/3 "2024-01-08T15:30:23Z")

</div>

FYI, just connected new CM4 to the CM4-IO-BASE-A and run

```auto
sudo apt install mmc-utils
sudo mmc extcsd read /dev/mmcblk0 | grep -i life
sudo mmc extcsd read /dev/mmcblk0 | grep EOL

```

Results :

```auto
eMMC Life Time Estimation A [EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_A]: 0x01
eMMC Life Time Estimation B [EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_B]: 0x01
MMC Pre EOL information [EXT_CSD_PRE_EOL_INFO]: 0x01

```

ChatGPT reads it now as :

```auto
These values represent the estimated lifespan of the eMMC's different types of memory cells (Type A and Type B). They are usually given in hexadecimal format, where:

* `0x01` indicates that the device is in its first lifespan segment. In general, this means the eMMC is in good condition and has not yet reached a significant amount of its write cycle limit.
* As these values increase (e.g., `0x02`, `0x03`, and so on), it indicates that the eMMC has reached further stages of its lifespan. Higher values (like `0x0A` or above) might suggest the device is approaching its end of life.

```

```auto
eMMC Pre EOL information (EXT_CSD_PRE_EOL_INFO): 0x01

This value indicates the pre-end-of-life status of the eMMC. Different values suggest how close the eMMC is to its estimated end of life:

    0x01: Normal - The device is in a healthy state and far from its end of life.
    0x02: Warning - The device is starting to approach its end of life; closer monitoring might be required.
    0x03: Urgent - The device is very close to its end of life, and it's advisable to consider replacing it.

```

So while values of Time estimation seems to be interpreted correctly, now ChatGPT for EXT\_CSD\_PRE\_EOL\_INFO says that 0x01 is OKay, while **0x02** and **0x03** indicate serious issue.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [January 8, 2024, 3:46pm UTC](https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149/4 "2024-01-08T15:46:26Z")

</div>

> [@Sharkys](#):
>
> `Higher values (like `0x0A` or above) might suggest the device is approaching its end of life.`

```auto
$ sudo mmc extcsd read /dev/mmcblk0 | grep 'LIFE\|EOL'
eMMC Life Time Estimation A [EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_A]: 0x0b
eMMC Life Time Estimation B [EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_B]: 0x0b
eMMC Pre EOL information [EXT_CSD_PRE_EOL_INFO]: 0x01

```

My Homey, which is hardly does anything, is showing “a higher value” 😬

Somewhere else I found this:

```auto
4.2.5 Life time estimation
It is possible to get an estimation on the health status of the device by checking the parameters
EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_A and EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_B.
The estimation is given in steps of 10% so a value of 0x01 means that 0% to 10% life time used. 

```

Which would mean 0x0b equals 100 to 110% life time used 😂

---

<div class="post-metadata">

**Author:** ![Sharkys](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sharkys/32/54029_2.png) [@Sharkys](https://community.homey.app/u/Sharkys)\
**Post date:** [January 8, 2024, 3:55pm UTC](https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149/5 "2024-01-08T15:55:00Z")

</div>

> [@robertklep](#):
>
> My Homey, which is hardly does anything

Can you also show, till you are rooted, what shows you `docker container stats` together with uptime, eg. min. 1-2 hours uptime ?  
Also do you have Experiment - Power user enabled ?

> [@robertklep](#):
>
> Which would mean 0x0b equals 100 to 110% life time used

Quite interesting article - [Wear Estimation for Devices with eMMC Flash Memory - CNX Software](https://www.cnx-software.com/2019/08/16/wear-estimation-emmc-flash-memory/)

Btw love this picture…

 ![linuxperm](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/a/faae170b71bb6dec37a1f7a452cc40d9f8a6cc1a.jpeg)

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [January 8, 2024, 3:59pm UTC](https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149/6 "2024-01-08T15:59:19Z")

</div>

> [@Sharkys](#):
>
> Can you also show, till you are rooted, what shows you `docker container stats` together with uptime, eg. min. 1-2 hours uptime ?

```auto
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
4accbd7d571a homey-pro-homekit 3.54% 90.27MiB / 1.855GiB 4.75% 0B / 0B 50.5MB / 106kB 11
f17cbcb4f634 homey-pro-sandbox 0.00% 12.15MiB / 1.855GiB 0.64% 0B / 0B 11.9MB / 279kB 8
507a7464a5a1 homey-pro 13.50% 889.1MiB / 1.855GiB 46.82% 0B / 0B 180MB / 324MB 321

```

Uptime 17 minutes 😉

~~I’ll update this post later tonight, after it’s been running a couple of hours.~~

After about 2 hours:

```auto
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
4accbd7d571a homey-pro-homekit 4.06% 95.85MiB / 1.855GiB 5.05% 0B / 0B 50.5MB / 106kB 11
f17cbcb4f634 homey-pro-sandbox 0.00% 12.15MiB / 1.855GiB 0.64% 0B / 0B 11.9MB / 279kB 8
507a7464a5a1 homey-pro 1.91% 981.1MiB / 1.855GiB 51.66% 0B / 0B 213MB / 2.85GB 321

```

So not a lot of writes at all (although memory usage of the `homey-pro` container is growing nicely).

> [@](#):
>
> Also do you have Experiment - Power user enabled ?

Yes 👍🏻

---

<div class="post-metadata">

**Author:** ![Sharkys](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sharkys/32/54029_2.png) [@Sharkys](https://community.homey.app/u/Sharkys)\
**Post date:** [January 8, 2024, 6:20pm UTC](https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149/7 "2024-01-08T18:20:04Z")

</div>

> [@robertklep](#):
>
> So not a lot of writes at all

You have Block I/O 2.85GB / writes 😉 In two hours ?

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [January 8, 2024, 6:20pm UTC](https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149/8 "2024-01-08T18:20:39Z")

</div>

Surely those are reads, not writes?

**EDIT** : [Docker documentation](https://docs.docker.com/engine/reference/commandline/stats/) seems to suggest it’s “writes / reads”:

_“`BLOCK I/O`: The amount of data the container has written to and read from block devices on the host”_

---

<div class="post-metadata">

**Author:** ![Sharkys](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sharkys/32/54029_2.png) [@Sharkys](https://community.homey.app/u/Sharkys)\
**Post date:** [January 8, 2024, 6:26pm UTC](https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149/9 "2024-01-08T18:26:42Z")

</div>

Surely I’m not expert, but I always verify with Portainer Agent (have Portainer running on my Synology) and those were writes. - actually READs were very low. But it could be that Portainer is wrong as well, in today’s world you never know.

> **[Slack is your productivity platform](https://athomcommunity.slack.com/?redir=%2Farchives%2FC04E9KJAD%2Fp1703921885393019%3Fthread_ts%3D1703778319.022859%26cid%3DC04E9KJAD%26name%3DC04E9KJAD%26perma%3D1703921885393019)**
>
> Slack is a new way to communicate with your team. It’s faster, better organized, and more secure than email.

Also I consulted ChatGPT on your data (and I know AI could be wrong, actually often it is 😉 )

_The Docker container stats for `homey-pro` show the I/O writes as part of the “BLOCK I/O” section. For the `homey-pro` container, the BLOCK I/O is given as `213MB / 2.85GB`._

_Here, the first number (`213MB`) represents the total data read from the block device (like a disk), and the second number (`2.85GB`) represents the total data written to the block device._

_So, the `homey-pro` container has performed approximately 2.85 GB of I/O writes._

But if unsure, try with Portainer or maybe someone can really confirm on that.

---

<div class="post-metadata">

**Author:** ![Sharkys](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sharkys/32/54029_2.png) [@Sharkys](https://community.homey.app/u/Sharkys)\
**Post date:** [January 8, 2024, 6:28pm UTC](https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149/10 "2024-01-08T18:28:33Z")

</div>

Yep, I read that just moments ago as well and indeed, it suggest that - but you can always verify also with others tools , except of portainer, I use also HTOP and adding WBYTES columns…

**funny** while official documentation suggests it’s write/read, all others are using order read/writes 🤣  
But the official docs shall be the most trusted. 🫤

> **[Chap-17: Docker Stats: Monitoring, Optimization, and Troubleshooting](https://medium.com/@maheshwar.ramkrushna/chap-17-docker-stats-monitoring-optimization-and-troubleshooting-afbfe29f4799)**
>
> Docker stats is a command-line tool provided by Docker that allows you to monitor the resource usage of your Docker containers in…

` **BLOCK I/O:** The amount of block I/O (disk I/O) performed by the container, displayed as two values separated by a slash (/). The first value represents the amount of data read, and the second value represents the amount of data written.`

> **[Docker Stats | Understand how to monitor Docker Metrics with docker stats |...](https://signoz.io/blog/docker-stats/)**
>
> Understand how to use Docker stats command to monitor your Docker containers. 1.CPU % Stat 2.MEM Usage/LIMIT Stats 3.MEM% Stat 4.Block I/O Status...

``BLOCK I/O` helps to identify containers that are writing data and shows the total number of bytes read and written to the container file system. Block I/O stats can give you an idea about issues with data persistence.`

etc.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [January 9, 2024, 7:36am UTC](https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149/11 "2024-01-09T07:36:18Z")

</div>

I’m now using this to determine the overall amount of data written to the eMMC:

```auto
grep 'mmcblk0 ' < /proc/diskstats | awk '{ print $3, ($10 * 512)/1024/1024, "M" }'

```

Result:

```auto
mmcblk0 4143.41 M

```

4GB in an hour. TBW for these eMMC’s is 11TB, so it’ll take about 115 days to reach that. Gentlemen, start your backups…

---

<div class="post-metadata">

**Author:** ![Sharkys](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sharkys/32/54029_2.png) [@Sharkys](https://community.homey.app/u/Sharkys)\
**Post date:** [January 9, 2024, 7:50am UTC](https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149/12 "2024-01-09T07:50:59Z")

</div>

I knew you will come up with better approach, thank you for your focus here Robert !

In my case :

```auto
mmcblk0 38130.5 M
**up 11 hours, 43 minutes**

```

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [January 9, 2024, 8:19am UTC](https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149/13 "2024-01-09T08:19:25Z")

</div>

Well. One of the first Homey Pro 2023 running 24/7 with not many devices but used as a development platform.

```bash
$ sudo mmc extcsd read /dev/mmcblk0 | grep 'LIFE\|EOL'
eMMC Life Time Estimation A [EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_A]: 0x0b
eMMC Life Time Estimation B [EXT_CSD_DEVICE_LIFE_TIME_EST_TYP_B]: 0x0b
eMMC Pre EOL information [EXT_CSD_PRE_EOL_INFO]: 0x01

```

```auto
------------------ Main ---------------------
3 Users (1 owner, 1 user(s), 1 guest(s))
29 Apps (0 SDKv2, 29 SDKv3, 1 updateable, 0 disabled/crashed)
7 Zones
250 Notifications
4 Variables (1 boolean (yes/no), 1 number, 2 string)
0 Flows (0 broken, 0 disabled)
23 Advanced flows (0 broken, 2 disabled)

----------------- Devices -------------------
0 Z-Wave nodes (0 router, 0 battery, 0 unreachable)
15 Zigbee nodes (0 router, 0 end device)
4 Virtual devices
0 Infrared (database) devices
28 Other devices
47 Total devices

```

Estimated I/O

```auto
$ uptime
08:16:31 up 6 min, 1 user, load average: 0.09, 0.68, 0.45
$ grep 'mmcblk0 ' < /proc/diskstats | awk '{ print $3, ($10 * 512)/1024/1024, "M" }'
mmcblk0 922.106 M

So 
922.106 M*10 should be 9.221,06 M?

```

So around 9GB an hour? But 6min are not enough for estimate it.

```auto
$ uptime
08:20:22 up 10 min, 1 user, load average: 0.06, 0.34, 0.36
$ sudo docker container stats
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
e70a009cf15d homey-pro 10.14% 1009MiB / 1.855GiB 53.11% 0B / 0B 205MB / 214MB 330

```

Will report back later the day when the homey has been running for a while

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [January 9, 2024, 8:28am UTC](https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149/14 "2024-01-09T08:28:46Z")

</div>

> [@spkesDE](#):
>
> `922.106 M*10 should be 9.221,06 M?`

The 922MB written is the amount written since the last boot, so almost 1GB in only 6 minutes 😬

Of course it might be a burst of writes directly after a reboot, so it would be worthwhile to check how much was written in, say, 24 hours. That should give a good indication of a “normal” I/O load.

**EDIT** : although having said that, I just check my HP2023 again:

- first hour: 4GB written in total
- second hour: 8GB written in total

So it’s keeping with the 4GB/h average…

---

<div class="post-metadata">

**Author:** ![Sharkys](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sharkys/32/54029_2.png) [@Sharkys](https://community.homey.app/u/Sharkys)\
**Post date:** [January 9, 2024, 8:59am UTC](https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149/15 "2024-01-09T08:59:14Z")

</div>

Btw with

```auto
fatrace -fW

```

you can also monitor live what is being written and where.  
(needs to be also installed first)

---

<div class="post-metadata">

**Author:** ![spkesDE](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/spkesde/32/54352_2.png) [@spkesDE](https://community.homey.app/u/spkesDE)\
**Post date:** [January 9, 2024, 9:07am UTC](https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149/16 "2024-01-09T09:07:12Z")

</div>

```auto
$ uptime
 09:06:33 up 60 min, 1 user, load average: 0.84, 0.62, 0.81
$ grep 'mmcblk0 ' < /proc/diskstats | awk '{ print $3, ($10 * 512)/1024/1024, "M" }'
mmcblk0 4861.63 M

```

🤷

---

<div class="post-metadata">

**Author:** ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)\
**Post date:** [January 14, 2024, 6:39pm UTC](https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149/17 "2024-01-14T18:39:01Z")

</div>

FYI: Moved …

> [@Sharkys](#):
>
> Discussed with @Sharkys this requires it’s own Topic, Therefore moved.  
> Prerequisite: [[HowTo][Modding] Guide to Jailbreak a Homey Pro 2023](https://community.homey.app/t/howto-modding-guide-to-jailbreak-a-homey-pro-2023/81678)

---

<div class="post-metadata">

**Author:** ![Sharkys](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sharkys/32/54029_2.png) [@Sharkys](https://community.homey.app/u/Sharkys)\
**Post date:** [January 18, 2024, 2:26pm UTC](https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149/18 "2024-01-18T14:26:37Z")

</div>

Just small comparison (in my case I even did some small optimisations already 🤣)

```auto
mmcblk0 423208 M
up 3 days, 1 hour, 48 minutes
Docker stats : 181GB

```

So “just” 5760 MB / hour.

Without that optimisations, I would estimate it to 8GB/hour.

66 Apps / 283 Total devices

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [January 18, 2024, 2:32pm UTC](https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149/19 "2024-01-18T14:32:57Z")

</div>

Where can we place bets on when the first HP2023’s will start failing with flash errors?

My prediction: somewhere around April.

---

<div class="post-metadata">

**Author:** ![Sharkys](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sharkys/32/54029_2.png) [@Sharkys](https://community.homey.app/u/Sharkys)\
**Post date:** [January 18, 2024, 2:44pm UTC](https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149/20 "2024-01-18T14:44:18Z")

</div>

I believe it will be fixed till then, for sure 😉

[Next page](https://community.homey.app/t/howto-modding-investigating-homey-s-emmc-wear-estimation/101149.md?page=2)
