[FX30-4G LTE-M] Wrong /etc size in ls FW14

Currently we use winSCP to update files in the FX30 ( via SCP).
However, winSCP doesn’t work anymore due to a really really wrong size on the /etc folder:

root@fx30:~# ls -lks /
     0 drwxr-xr-x    3 root     root            26 May 14  2021 WEBSERVER
     0 drwxr-xr-x    2 root     root          1103 May 14  2021 bin
     0 drwxr-xr-x    2 root     root             3 May 14  2021 boot
     0 drwxr-xr-x    1 root     root          1664 Nov 23 09:37 data
     0 drwxr-xr-x   10 root     root          5740 Nov 23 09:07 dev
     0 drwxr-xr-x    1 root     root     18446744073709549488 Nov 23 09:07 etc
     0 drwxrwxr-x    3 appsecSt appsecSt        28 Dec 11  2020 firmware
     0 drwxr-xr-x    3 root     root           224 Jan  1  1970 home
     0 drwxr-xr-x    5 root     root           576 Nov 23 09:08 legato
     0 drwxr-xr-x    5 root     root          1160 May 14  2021 lib
     0 lrwxrwxrwx    1 root     root            19 May 14  2021 linuxrc -> /bin/busybox.nosuid
     0 drwxr-xr-x    2 root     root             3 May 14  2021 media
     0 drwxr-xr-x    7 root     root            84 May 14  2021 mnt
     0 drwxr-xr-x    2 root     root             3 May 14  2021 opt
     0 dr-xr-xr-x  210 root     root             0 Jan  1  1970 proc
     0 drwxr-xr-x    2 root     root            80 Nov 23 09:07 run
     0 drwxr-xr-x    2 root     root          1401 May 14  2021 sbin
     0 dr-xr-xr-x   12 root     root             0 Jan  1  1970 sys
     0 drwxr-xr-x    5 root     root           240 Nov 23 09:37 tmp
     0 drwxr-xr-x   12 root     root           178 May 14  2021 usr
     0 drwxr-xr-x    6 root     root           140 Nov 23 09:07 var

As you can see the etc folder size is: 18446744073709549488 (which is way more than the few hundreds of MB of flash).

How can we fix that?

Best regards,
Guillaume

how about re-download FW??
how about download to old FW??
how about erase the userapp partition by swiflash on old FW?

Hi,
I have re-flashed my box with the same FW and after reboot, the result is the same (bad folder size).
I use this FW: FX30_WP77xx_full_R14.1.1.002-generic-SWI9X06Y_02.36.06.00

I will try the R11 for the Cat-m to see if the problem also occur.

I downgraded the box FW from R14 to R11 and the problem was still here.
However, after resetting the overlay (with developer studio tool) the problem disappeared from the R11.
I’m guessing, this strange problem was due to our way to clean the overlay (which is mandatory between update for us).
Currently (on our custom R14 FW), we clean the overlay with that script:


rm -rf /mnt/flash/ufs/etc/*
rm -rf /mnt/flash/ufs/usr/*
rm -rf /mnt/flash/ufs/sbin/*
rm -rf /home/root/*

After, that we reboot the box.

Are there any better way to clean the overlay (without breaking the size of folder)?

you can use “swiflash -r” in R11:

The reset of overlay was successful on the R11, however because the R14 can’t be reset that way and since we must do this on our FW (that run on the R14), we create the script (on my previous message) that erase folders directly in the overlay.

It seem that our script to clean the overlay is the cause of the etc size problem, so how can we clean the overlay (maybe we miss to erase some parts of the system)?

Did you try swiflash or the method here?

I tried the swiflash method on the R14 and it doesn’t work (as expected).
In all case, the swiflash is not viable for us since we need to erase the overlay on FX30 that are not connected to the PC.

Could you confirm that our script that clean the overlay, do enough erasing (we want to create the same behavior as reset.cwe does)?

Did you try the flash_eraseall method

Hello,
Downgrading from R14.1 to R11 is not recommended. The secure storage configuration items will become corrupted and unable to be restored once the device is updated back to R14.1.

To clean the overlay, you could try the FX30 factory reset via the external pushbutton, but this doesn’t delete the ufs sbin and usr folders, and also the home/root folder, as these aren’t actually part of the overlay.

BR,
Chris

Hello,
I tried the flash_erase /dev/mtd16 0 0 method and sometimes it work like a charm and sometimes the kernel log indefinitely errors like that:

  206.341567] Not a node, first 24 bytes:
[  206.345018] 00000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff                          ........................
[  206.358723] UBIFS error (ubi3:0 pid 2916): ubifs_readdir: cannot find next direntry, error -22
[  206.367407] UBIFS error (ubi3:0 pid 2916): ubifs_read_node: bad node type (255 but expected 2)
[  206.376564] UBIFS error (ubi3:0 pid 2916): ubifs_read_node: bad node at LEB 13:61944, LEB mapping status 1
[  206.386504] Not a node, first 24 bytes:
[  206.389198] 00000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff                          ........................
[  206.403568] UBIFS error (ubi3:0 pid 2916): ubifs_readdir: cannot find next direntry, error -22
[  206.411939] UBIFS error (ubi3:0 pid 2916): ubifs_read_node: bad node type (255 but expected 2)
[  206.419738] UBIFS error (ubi3:0 pid 2916): ubifs_read_node: bad node at LEB 13:61944, LEB mapping status 1
[  206.429903] Not a node, first 24 bytes:
[  206.433198] 00000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff                          ........................
[  206.446674] UBIFS error (ubi3:0 pid 2916): ubifs_readdir: cannot find next direntry, error -22
[  206.455332] UBIFS error (ubi3:0 pid 2916): ubifs_read_node: bad node type (255 but expected 2)
[  206.465695] UBIFS error (ubi3:0 pid 2916): ubifs_read_node: bad node at LEB 13:61944, LEB mapping status 1
[  206.474434] Not a node, first 24 bytes:
[  206.477970] 00000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff                          ........................
[  206.491627] UBIFS error (ubi3:0 pid 2916): ubifs_readdir: cannot find next direntry, error -22
[  206.500326] UBIFS error (ubi3:0 pid 2916): ubifs_read_node: bad node type (255 but expected 2)
[  206.508169] UBIFS error (ubi3:0 pid 2916): ubifs_read_node: bad node at LEB 13:61944, LEB mapping status 1
[  206.518253] Not a node, first 24 bytes:
[  206.521610] 00000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff                          ........................
[  206.535042] UBIFS error (ubi3:0 pid 2916): ubifs_readdir: cannot find next direntry, error -22
[  206.543804] UBIFS error (ubi3:0 pid 2916): ubifs_read_node: bad node type (255 but expected

I just called the flash_erase and then reboot (to start with a fresh overlay)

how about using FX30 factory reset via the external pushbutton

I disconnect the power supply and after reconnection the FX30 is back as normal (with a cleaned overlay).
What is the cause of that error in kernel?
We can’t use the flash_erase method if it require a human action.

i don’t know, I don’t see problem to use flash_erase method to erase userapp partition on my WP76 on R16.

Calling the erasing that way:

 flash_erase /dev/mtd16 0 0 && reboot

Seem to generate the error (but not each time), is it the case on your system?

The kernel error is logged (at least) on the serial port.

I did like this:


root@swi-mdm9x28-wp:~# flash_eraseall /dev/mtd16
flash_eraseall has been replaced by `flash_erase <mtddev> 0 0`; please use it
Erasing 256 Kibyte @ 82c0000 -- 100 % complete
root@swi-mdm9x28-wp:~# reboot