Community discussions

MikroTik App
 
User avatar
AlverGant
just joined
Topic Author
Posts: 6
Joined: Mon Aug 14, 2017 7:13 pm
Contact:

RB433AH and RB493G netinstall fail because of no space caused by bad blocks

Mon Aug 14, 2017 7:54 pm

Hi,

I have been doing some experiments with OpenWRT on a RB433, RB433AH and RB493G and was hit by this "bug" viewtopic.php?t=48585
Micro-sd card was inserted and when I was flashing OpenWRT, lots of bad erase blocks and ECC error happened.
I still have access to the console, able to do a TFTP and boot OpenWRT from network but I see hundreds of bad erase blocks.

OK, having figured out that this could be caused by the interference from the micro-sd card (link above) and hoping that the bad blocks could be "false errors", I removed it and tried to do a NetInstall to rollback to RouterOS hoping that it would clear the false blocks, but to my despair, NetInstall throws an error of not enough space! OMG, maybe the kernel or root partition don't hold a minimum space to reflash RouterOS.

Things that I have tried:
Reformat NAND from RouterBoot - inefective
Reformat kernel and rootfs partitions from OpenWRT - These didn't touch the bad blocks, merely skips them
Find older and smaller RouterOS version to see if it fits - Release 6.0 was the smallest and went up to 80% before no space error throws

Is there any minimal RouterOS NPK package available, one that just boots to see if I can reclaim the lost space again?

Best Regards,
Alvaro Antelo

PS: RB433 does not exhibit this behaviour nor has a micro-sd card
 
jarda
Forum Guru
Forum Guru
Posts: 7756
Joined: Mon Oct 22, 2012 4:46 pm

Re: RB433AH and RB493G netinstall fail because of no space caused by bad blocks

Tue Feb 20, 2018 6:55 pm

Were you able to succeed finally somehow?

I see similar behaviour on one of my rb493g. I put there microSD card and closed the box. Then I was not able to see the card anywhere so I left it there. After some time I realised full disk alert in dude. When explored I found 100% bad blocks of internal flash card. Cpu utilised at 100% too by unspecified and management.

At the moment the device is still able to perform its tasks and kept in place with expectations that it will not boot again after the power loss.

I asked support for help.
[Ticket#2018020622006727]

They suggested netinstall as it maybe could be able to solve the bad blocks in some cases and provided some link to other forum where someone had similar problem.
https://github.com/AlverGant/mikrotik_erase_bbt

I am going to switch the device off, pull out the sd card and try to format nand together with netinstall, but I am afraid that it will not succeed.

How did it worked in your case and what is your experience with this?

If the combination with sd card is able to take down the flash in this way, then it is definitely a problem of ros that should be repaired soon.
 
User avatar
AlverGant
just joined
Topic Author
Posts: 6
Joined: Mon Aug 14, 2017 7:13 pm
Contact:

Re: RB433AH and RB493G netinstall fail because of no space caused by bad blocks

Tue Feb 20, 2018 8:24 pm

Hi, yes I was able to solve the problem applying the solution that I posted on:
https://github.com/AlverGant/mikrotik_erase_bbt
Apparently it worked with at least one other user too.

Best regards,

Alvaro Antelo
 
User avatar
AlverGant
just joined
Topic Author
Posts: 6
Joined: Mon Aug 14, 2017 7:13 pm
Contact:

Re: RB433AH and RB493G netinstall fail because of no space caused by bad blocks

Tue Feb 20, 2018 8:27 pm

After repairing with a full netinstall, and do a format from RouterOS I ended with zero bad blocks.
After removing the SD-Card I was able to install OpenWRT with no problems whatsoever.
Clearly there is an interference between the microSD-Card and writing to the NAND flash.
 
jarda
Forum Guru
Forum Guru
Posts: 7756
Joined: Mon Oct 22, 2012 4:46 pm

Re: RB433AH and RB493G netinstall fail because of no space caused by bad blocks

Fri Mar 02, 2018 2:40 pm

Looks like I am missing a very important step, or I am not able to move forward. What I am able to:
- boot rb493G with both dhpc and bootp protocol
- manage everything over serial console
- see rb493g in netinstall, push a system package there (but fail due to not enough space...)

while I have a IP address 192.168.1.4 got from dhcp server, i use the tftp command:

"tftp -i 192.168.1.4 put d:\openwrt.elf" (renamed the file to be shorter only)

This does nothing, after a minute or so it ends up with "timeout - attempt not successfull". In the console just asterisks are growing...

Using windows 7 for doing that, with fttp client installed.

How to pass the elf image to the rb493g from windows 7 over the tftp?

Mikrotik who is responsible for that situation, should provide a correction package to be pushed directly from netinstall... Easy and reliable.

And of course, the sd card was removed before any attempts.

Thanks in advance.
 
User avatar
AlverGant
just joined
Topic Author
Posts: 6
Joined: Mon Aug 14, 2017 7:13 pm
Contact:

Re: RB433AH and RB493G netinstall fail because of no space caused by bad blocks

Sat Mar 03, 2018 1:28 am

Hi,

I am not sure what the problem is but appears to be related to your server setup.
In order for Mikrotik to boot an Openwrt image, we need a DHCP and TFTP server pointing to the modified ELF image capable of erasing bad blocks.

I will provide instructions for the following option - use an OpenWRT device configured to serve DHCP and TFTP; but technically you could use any TFTP server on Linux and Windows, the modified image must be on TFTP root, you dont have to put the image, instead if everything went well the router will get an IP address from DHCP and also retrieve the ELF image from TFTP as the URL will be passed along through the DHCP server.

In the provided instructions you will need an OpenWRT router with enough memory to receive the ELF image as you will have to SCP it to the /tmp router directory which is a ramdrive so the ELF image will be lost after boot. The advantage of doing this way is that you only will need this router and also connect RB493 on its LAN port. If I remember correctly you will have to connect to ETH1 on RB493.

The commands to be applied on this router are: (configure the variables to match your setup)
It is assuming that there is already a DHCP server which is the default and that the ELF image is renamed to mikrotikcc.elf

ipaddress=$(uci get network.lan.ipaddr)

uci set dhcp.@dnsmasq[0].enable_tftp='1'
uci set dhcp.@dnsmasq[0].tftp_root='/tmp'
uci set dhcp.linux=boot
uci set dhcp.linux.filename='mikrotikcc.elf'
uci set dhcp.linux.serveraddress=$ipaddress
uci set dhcp.linux.servername='OpenWRT'
uci commit dhcp
/etc/init.d/network reload
/etc/init.d/dnsmasq restart

Good luck
 
jarda
Forum Guru
Forum Guru
Posts: 7756
Joined: Mon Oct 22, 2012 4:46 pm

Re: RB433AH and RB493G netinstall fail because of no space caused by bad blocks

Mon Mar 05, 2018 11:59 am

Bingo. I finally succeeded, now I have zero bad blocks and the RB493G is running like before!

What was my critical path to reach the goal:

1) Set the "next-server" in DHCP network of my main router (also mikrotik) to ip address of my computer.
2) Set the "boot file name" there to "openwrt.elf".
3) Run the Solar Winds TFTP server with the "openwrt.elf" file it its root tftp directory.
4) Boot the backup booter with dhcp boot option, elf image downloaded and run smoothly.
5) The bad blocks were removed during the openwrt boot up process.
6) Made "mtd -n erase /dev/mtd5" and "mtd -n erase /dev/mtd6" with error message that one block was not able to unmark as bad block (but finally there is zero percent of bad blocks...).
7) Netinstalled RouterOS.
8) Everything looks good and works as expected.

License stayed untouched, no "format nand" was performed at all.

I did not need any openwrt running device nor to run any kind of linux anywhere else. Everything was done from one pc with win 7.

Beware: Only single partition is supported, need to repartition to 1 before step 4, if more partitions are created.

Big thanks to Alvaro Antelo.

Really. Thank you very much.
 
User avatar
AlverGant
just joined
Topic Author
Posts: 6
Joined: Mon Aug 14, 2017 7:13 pm
Contact:

Re: RB433AH and RB493G netinstall fail because of no space caused by bad blocks

Mon Mar 05, 2018 6:06 pm

Hi Jarda,

That's awesome! Glad to hear that the modification helped you too!
Yes that is correct, if the DHCP and TFTP servers have different IP address, we need to inform the client through ''Next Server" DHCP message.
Thank you for pointing out the partition issue on Routerboard, I will add that to the instructions and also detail more about the servers setup.

Best regards,

Alvaro Antelo

Who is online

Users browsing this forum: No registered users and 56 guests