This guide will show you how to restore the operating system (rootfs) on the Tonido Plug 2’s internal flash (NAND) to its original factory settings. To do so, you will delete the existing operating system and replace it with a fresh install. The process is very similar to setting up a USB drive to boot the plug.
This not the same as flashing the plug with a new image and it will not change any U-boot settings.
Why is this useful?
df -h /
The output should be similar to this:
Filesystem Size Used Avail Use% Mounted on rootfs 3.8G 669M 2.9G 19% /
You can see that this plug is booted from a 4GB USB stick. If you see 512MB under “Size” then you are still booting off the internal flash.
3. Attach to the internal flash (NAND) drive.
ubiattach /dev/ubi_ctrl -m 3
4. Mount the internal flash drive
mount -t ubifs ubi0:rootfs /mnt/
5. Navigate to the mounted internal flash drive.
6. Remove the operating system (rootfs) and all files on the internal flash.
rm -rf *
7. Get a fresh copy of the Tonido operating system image.
8. Make sure the checksum is correct.
9. Untar the image.
tar zxvf rootfs.tar.gz
10. Delete the compressed rootfs image to save space.
11. Unmount the internal flash.
cd / umount /mnt
13. Power down the Tonido Plug, remove the USB drive, power up again.
14. Wait 5 minutes for the plug to finish booting. When the red LED turns completely blue, connect to the Tonido Plug from a browser.
15. You can re-associate the plug your account by clicking on the “recover” link and following the prompts.
Please, only start this process AFTER you have tried to rebuild the rootfs on the NAND using Basic Reset instructions above - AND failed during either the remove step (read only error) or the wget step (write error)
That being said, the process of formatting and rebuilding a moderately corrupt NAND rootfs device is fairly simple.
apt-get update && apt-get upgrade.
3. Get some info about the NAND. Note if these info commands do not work or do not produce the outputs shown below, STOP - you have other NAND issues that cannot be addressed here.
mtdinfo Expected output: Count of MTD devices: 4 Present MTD devices: mtd0, mtd1, mtd2, mtd3 Sysfs interface supported: yes cat /proc/mtd Expected output: dev: size erasesize name mtd0: 00180000 00020000 "u-boot" mtd1: 00020000 00020000 "u-boot-env" mtd2: 00600000 00020000 "uImage" mtd3: 1f800000 00020000 "rootfs"
You should see four NAND mtd devices and We will ONLY work on mtd3 - the rootfs device.
4. Make sure mtd3 is detached:
ubidetach /dev/ubi_ctrl -m 3
Be careful here. Make sure you only target mtd3.
5. Format device mtd3 and rebuild the volume on it.
ubiformat /dev/mtd3 -s 512 ubiattach /dev/ubi_ctrl -m 3 ubimkvol /dev/ubi0 -N rootfs -m
6. Mount the newly formatted NAND volume.
mount -t ubifs ubi0:rootfs /mnt cd /mnt
7. Proceed to step 7 of the Basic Reset.