NAS326: bad blocks in NAND and two different firmware versions installed

Options
mahowi
mahowi Posts: 6  Freshman Member
edited March 2020 in Personal Cloud Storage
On my NAS326 I have two different firmware versions installed in NAND1 and NAND2. From fw_printenv:
fwversion_1=V5.21(AAZF.3)
fwversion_2=V5.21(AAZF.7)
Could this be related to bad blocks in NAND:
Bad block table found at page 131008, version 0x01
Bad block table found at page 130944, version 0x01
nand_read_bbt: bad block at 0x000002320000
nand_read_bbt: bad block at 0x000006b60000
nand_read_bbt: bad block at 0x00000cd60000
nand_read_bbt: bad block at 0x00000d920000
nand_read_bbt: bad block at 0x00000f500000
nand_read_bbt: bad block at 0x00000f940000
Apparently only Kernel-2 and RootFS-2 are updated but not Kernel-1 and RootFS-1. But sometimes the NAS boots with kernel-1 and asks me to upgrade the firmware. After reboot I get the message that the firmware update is done but Kernel-1 and RootFS-1 are still on version V5.21(AAZF.3).

Is there any chance to fix this?


#NAS_Mar_2020

Accepted Solution

  • Mijzelf
    Mijzelf Posts: 2,614  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    edited March 2020 Answer ✓
    Options
    Except for the 'sometimes the NAS boots with kernel-1' this is expected behavior. When you flash a new version, it is flashed to the other, currently inactive half of the flash. Only when flashing succeeded, a flag is set in the u-boot environment to switch to 'the other half'. This way you can never have a bad flash.
    Further it's normal to have 2 different versions of firmware in the flash, the current and the previous.

    When you box boots with kernel-1, and you flash it, the new firmware is written to kernel-2, where it already was.

    About the bad blocks, that can be normal. Most boxes have some bad blocks in nand, and the nand driver in the kernel can handle that. As long as the bad blocks are stable (as in always the same) this is no problem.

    'sometimes the NAS boots with kernel-1', this is worrying. As an extra protection against a bad flash the bootloader can detect when the linux kernel fails to boot (it doesn't reset a watchdog in time), and then the bootloader will revert to the previous flash half. This is not supposed to happen. Maybe you have a nand-block containing part of kernel-2 which is only sometimes bad?

    Anyway, it's relatively easy to get the latest firmware in kernel-1. Just flash it once again while you are running kernel-2. Maybe it will decline because it is no upgrade. In that case you'll have to enable the ssh server, login over ssh, and execute

    su
    echo 1 > /firmware/mnt/info/revision

    and retry the flash.

All Replies

  • Mijzelf
    Mijzelf Posts: 2,614  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    edited March 2020 Answer ✓
    Options
    Except for the 'sometimes the NAS boots with kernel-1' this is expected behavior. When you flash a new version, it is flashed to the other, currently inactive half of the flash. Only when flashing succeeded, a flag is set in the u-boot environment to switch to 'the other half'. This way you can never have a bad flash.
    Further it's normal to have 2 different versions of firmware in the flash, the current and the previous.

    When you box boots with kernel-1, and you flash it, the new firmware is written to kernel-2, where it already was.

    About the bad blocks, that can be normal. Most boxes have some bad blocks in nand, and the nand driver in the kernel can handle that. As long as the bad blocks are stable (as in always the same) this is no problem.

    'sometimes the NAS boots with kernel-1', this is worrying. As an extra protection against a bad flash the bootloader can detect when the linux kernel fails to boot (it doesn't reset a watchdog in time), and then the bootloader will revert to the previous flash half. This is not supposed to happen. Maybe you have a nand-block containing part of kernel-2 which is only sometimes bad?

    Anyway, it's relatively easy to get the latest firmware in kernel-1. Just flash it once again while you are running kernel-2. Maybe it will decline because it is no upgrade. In that case you'll have to enable the ssh server, login over ssh, and execute

    su
    echo 1 > /firmware/mnt/info/revision

    and retry the flash.

Consumer Product Help Center