# Flash Usage on failed updates

**URL:** <https://forum.legato.io/t/flash-usage-on-failed-updates/6920>\
**Category:** Legato Application Framework\
**Created:** [May 7, 2025, 1:42pm UTC](https://forum.legato.io/t/flash-usage-on-failed-updates/6920 "2025-05-07T13:42:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![upsampled](https://avatars.discourse-cdn.com/v4/letter/u/bc8723/32.png) [@upsampled](https://forum.legato.io/u/upsampled)\
**Post date:** [May 7, 2025, 1:42pm UTC](https://forum.legato.io/t/flash-usage-on-failed-updates/6920/1 "2025-05-07T13:42:15Z")

</div>

I am having an issue with the update command filling up the flash unnecessarily on failed updates. How can remove any files associated with a failed update?

Prior to an update attempt the flash was at 90% usage

```auto
root@p0xx-119-nosn:~# df | grep flash
df: /dev/mqueue: No such file or directory
df: /dev/mqueue: No such file or directory
/dev/ubi3_0 107036 90952 11248 89% /mnt/flash

```

The update failes and i no longer have any flash space:

```auto
root@p0xx-119-nosn:~/wpupdate-0-0-9893-dockerbld# ./WP77XX.sh
Unpacking package: 100% ++++++++++++++++++++++++++++++++++++++++++++++++++
***Error: Internal error during update. See log for details.

FAILED
root@p0xx-119-nosn:~/wpupdate-0-0-9893-dockerbld# df | grep flash
df: /dev/mqueue: No such file or directory
df: /dev/mqueue: No such file or directory
/dev/ubi3_0 107036 107028 0 100% /mnt/flash

```

I need to audit the flash/overlay in general to figure out where i can get more space; however, as a failed update eats up 10% of the flash, I need to know how to free that memory.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [May 7, 2025, 1:49pm UTC](https://forum.legato.io/t/flash-usage-on-failed-updates/6920/2 "2025-05-07T13:49:55Z")

</div>

how about erasing the userapp partition?

> **[Swiflash -r broken with release 12 on wp77xx?](https://forum.sierrawireless.com/t/swiflash-r-broken-with-release-12-on-wp77xx/20957/2)**
>
> According to the release note of fw r12, QTI9X07-2870 is to fix userapp partition being erased which is security hole. You might also try the following without downgrading to older version: (Be careful of the mtd number, different FW might have...

---

<div class="post-metadata">

**Author:** ![upsampled](https://avatars.discourse-cdn.com/v4/letter/u/bc8723/32.png) [@upsampled](https://forum.legato.io/u/upsampled)\
**Post date:** [May 7, 2025, 2:15pm UTC](https://forum.legato.io/t/flash-usage-on-failed-updates/6920/3 "2025-05-07T14:15:09Z")

</div>

Can’t do that as there are other files i need to keep. So let’s try to scope this to figuring out how the update command works and see if its behavior can be modified.

Right now the issue is that there are basically 3 versions of my app on the device at any time. The app is currently 50MB uncompressed so the combined 150MB is primary reason the flash is filling up. Is there any way to delete the old version of the app (in the case below it would be `1.0.0.9891.dockerbld`) to free up flash?

```auto
root@p0xx-119-nosn:~/wpupdate-0-0-9893-dockerbld# cat /mnt/flash/legato/apps/f575dd67a793f2e5ff176a0d672ded39/info.properties
app.name=pawp77xx
app.md5=f575dd67a793f2e5ff176a0d672ded39
app.version=1.0.0.9892.dockerbld
legato.version=21.05.0
root@p0xx-119-nosn:~/wpupdate-0-0-9893-dockerbld# cat /mnt/flash/legato/apps/591db520c025e609609549a1670beb94/info.properties
app.name=pawp77xx
app.md5=591db520c025e609609549a1670beb94
app.version=1.0.0.9891.dockerbld
legato.version=21.05.0
root@p0xx-119-nosn:~/wpupdate-0-0-9893-dockerbld# cat /mnt/flash/legato/apps/unpack/info.properties
app.name=pawp77xx
app.md5=74baec72572702bcb66f3af224897b5a
app.version=1.0.0.9893.dockerbld
legato.version=21.05.0

```

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [May 7, 2025, 2:20pm UTC](https://forum.legato.io/t/flash-usage-on-failed-updates/6920/4 "2025-05-07T14:20:48Z")

</div>

not quite sure why there are three version of the app at the same time…

How about “app remove” your app and then install the new .update file?

---

<div class="post-metadata">

**Author:** ![upsampled](https://avatars.discourse-cdn.com/v4/letter/u/bc8723/32.png) [@upsampled](https://forum.legato.io/u/upsampled)\
**Post date:** [May 7, 2025, 2:34pm UTC](https://forum.legato.io/t/flash-usage-on-failed-updates/6920/5 "2025-05-07T14:34:35Z")

</div>

using app remove, the app is no longer listed in `app list`; however, the files are still in flash (except unpack may have been cleaned up).

```auto
root@p0xx-119-nosn:~/wpupdate-0-0-9893-dockerbld# app list | grep pawp
pawp77xx
root@p0xx-119-nosn:~/wpupdate-0-0-9893-dockerbld# app remove pawp77xx
Removing app 'pawp77xx'...
root@p0xx-119-nosn:~/wpupdate-0-0-9893-dockerbld# app list | grep pawp
root@p0xx-119-nosn:~/wpupdate-0-0-9893-dockerbld# cat /mnt/flash/legato/apps/591db520c025e609609549a1670beb94/info.properties
app.name=pawp77xx
app.md5=591db520c025e609609549a1670beb94
app.version=1.0.0.9891.dockerbld
legato.version=21.05.0
root@p0xx-119-nosn:~/wpupdate-0-0-9893-dockerbld# cat /mnt/flash/legato/apps/f575dd67a793f2e5ff176a0d672ded39/info.properties
app.name=pawp77xx
app.md5=f575dd67a793f2e5ff176a0d672ded39
app.version=1.0.0.9892.dockerbld
legato.version=21.05.0

```

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [May 7, 2025, 3:03pm UTC](https://forum.legato.io/t/flash-usage-on-failed-updates/6920/6 "2025-05-07T15:03:03Z")

</div>

you can use “update -g” to remove it:

```auto
root@fx30:~# find /mnt/flash/legato/apps/ -name "info.properties" | xargs grep -
l "modemDemo1"
/mnt/flash/legato/apps/5e257f3becbff2790340d277c789a674/info.properties
root@fx30:~# app status
[running] atAirVantage
[running] atQmiLinker
[running] atService
[running] audioService
[running] avcService
[running] cellNetService
[running] dataConnectionService
[running] fwupdateService
[running] gpioService
[running] modemService
[running] portService
[running] positioningService
[running] powerMgr
[running] powerService
[running] qmiAirVantage
[running] secStore
[stopped] smsInboxService
[stopped] spiService
[stopped] tools
[stopped] voiceCallService
[stopped] wifi
[stopped] wifiApTest
[stopped] wifiClientTest
[running] wifiService
[stopped] wifiWebAp
[stopped] UART_TCP_Demo1
[running] hello1
[running] modemDemo1
root@fx30:~# app remove modemDemo1
Removing app 'modemDemo1'...
root@fx30:~# app status
[running] atAirVantage
[running] atQmiLinker
[running] atService
[running] audioService
[running] avcService
[running] cellNetService
[running] dataConnectionService
[running] fwupdateService
[running] gpioService
[running] modemService
[running] portService
[running] positioningService
[running] powerMgr
[running] powerService
[running] qmiAirVantage
[running] secStore
[stopped] smsInboxService
[stopped] spiService
[stopped] tools
[stopped] voiceCallService
[stopped] wifi
[stopped] wifiApTest
[stopped] wifiClientTest
[running] wifiService
[stopped] wifiWebAp
[stopped] UART_TCP_Demo1
[running] hello1
root@fx30:~# find /mnt/flash/legato/apps/ -name "info.properties" | xargs grep -
l "modemDemo1"
/mnt/flash/legato/apps/5e257f3becbff2790340d277c789a674/info.properties
root@fx30:~# update -g
System is now marked 'Good'.
root@fx30:~# find /mnt/flash/legato/apps/ -name "info.properties" | xargs grep -
l "modemDemo1"
root@fx30:~#

```
