Help Needed: Restoring Zyxel NAS542 to Factory State After Failed os Attempts

Options
stronghold
stronghold Posts: 2 image  Freshman Member

hi

Help Needed: Restoring Zyxel NAS542 to Factory State After Failed os Attempts

I'm hoping to get some expert advice for my Zyxel NAS542. I've spent趋势 a lot of time trying to install a custom OS (first OpenWrt, then exploring Alpine Linux and Debian) but have run into several roadblocks. After this long journey, my primary goal now is to perform a full, clean factory reset of the device.

My Journey So Far:

  • I have a working UART (serial adapter) and can access the Barebox bootloader.
  • I understand the device has a dual-firmware layout (kernel1/rootfs1 and kernel2/rootfs2).
  • I have tried booting various initramfs images via TFTP with some success in getting a temporary Linux system running in RAM.
  • I made some changes to the Barebox environment using setenv and saveenv, which I now want to revert to the absolute factory defaults.
  • My attempts to analyze the stock firmware's UBI filesystem to extract the default /env files failed due to limitations in my WSL2 kernel (missing UBI/UBIFS module support).

My Goal:

I want to completely restore the device to its original factory state. This involves two main steps:

  1. Resetting the Barebox environment to its compiled-in defaults.
  2. Flashing the official Zyxel stock firmware over both system partitions (mtd5 and mtd7).

Where I Need Help / My Specific Questions:

I have a solid plan, but I would be very grateful if someone could confirm it or provide some crucial files.

  1. Resetting Barebox Environment: My version of Barebox does not have the env -d command. My plan is to boot into a temporary initramfs and then run flash_erase /dev/mtd2 0 0 to wipe the environment partition. Can anyone confirm that mtd2 is indeed the correct partition for the Barebox environment on the SPI flash?
  2. Flashing Stock Firmware: My plan is to boot into the same initramfs, TFTP the official stock.bin firmware to /tmp, and then run mtd write /tmp/stock.bin /dev/mtd5 and mtd write /tmp/stock.bin /dev/mtd7. Is this the correct and safe procedure?
  3. Crucial Files (The Most Important Request): I saw a post by a user named "stein_990" who mentioned that another user, Mijzelf, had provided backup files for the SPI flash (nas520_mtd0, nas520_mtd1, nas540.mtd2). Would anyone in the community be able to share these files or a full 1MB SPI flash backup for the NAS542? Having these files would be the ultimate safety net in case anything goes wrong with the Barebox environment.

I've learned so much from reading through these forums, and I'm amazed by the expertise here. Any confirmation, advice, or files you could provide would be incredibly helpful.

Thank you in advance for your time and help!

Best regards,

stronghold

All Replies

  • stein_990
    stein_990 Posts: 34 image  Freshman Member
    First Comment Friend Collector

    https://community.zyxel.com/en/discussion/30409/nas542-dead-spi-flash-dead-barebox-dead-uloader-dead#latest

Consumer Product Help Center