Vera extroot

Hi, I just want to make sure I understand what you are trying to do: Are you trying to extroot your 4453 unit or are you trying to upgrade a previously extrooted vera?

If you are trying to extroot a 4453 unit, you should use the extroot.sh script. The extroot-upgrade.sh is for the latter case: upgrade a previously extrooted vera. The upgrade script will not work if you are not already extrooted!

Your absolutely right, I was running the wrong script. Thanks for your quick response.

It looks like everything went well with the correct script!

root@MiOS_50017625:~# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 116.7G 108.6M 110.7G 0% /
/dev/root 10.0M 10.0M 0 100% /rom
tmpfs 124.8M 408.0K 124.4M 0% /tmp
/dev/sda2 116.7G 108.6M 110.7G 0% /
tmpfs 512.0K 0 512.0K 0% /dev
/dev/sda1 493.6M 3.8M 453.5M 1% /tmp/log/cmh
/dev/mtdblock10 50.0M 1.4M 48.6M 3% /storage
/dev/mtdblock10 50.0M 1.4M 48.6M 3% /etc/cmh-firmware
/dev/mtdblock10 50.0M 1.4M 48.6M 3% /etc/cmh-backup
/dev/mtdblock9 9.8M 9.8M 0 100% /mios

Awesome, thanks for reporting back.

Bit late to the party on this but very interested. I’m just after some clarification on a few points please?

  1. After making this change, is the process for reverting as simple as pulling out the SSD and restoring from backup?

  2. Will applying future firmware updates mean this change needs to be reapplied each time

and,

  1. Is this script just for the VeraPlus or will it work for the Edge/Secure as well?

Thanks.

  1. Yes, reverting is as simple as unplugging the USB drive and rebooting the vera
  2. I posted two different ways to upgrade the firmware in the storage thread:
    a. backup your configuration, unplug the drive, reboot, upgrade with factory reset, restore from backup, apply extroot
    b. apply upgrade from UI then apply a script I will provide (I call it “extroot-upgrade.sh”)
  3. The script has been validated to work on the Veraplus and Secure. I vaguely remember having done it on my Vera edge. I may need to customize the script very slightly for it based on the feedback on this thread.
1 Like

Awesome! Thanks heaps
 off to get an SSD!..

Interested also to hear experiences using extroot with Vera Edge. @cranb, any progress?

1 Like

Actually if you could follow the instructions I gave cranb above and see if it works

Basically:

  1. plug in your ssd,
  2. go through the USB logging enabling process in the UI.
  3. SCP the script over into the vera and run it.
  4. SSH into the vera and Run df -h to see if it pivoted
  5. if not, run

nano /etc/config/fstab

and if you see you see two references to /dev/sda2, delete the first section which should be referring to a swap partition which is disabled. Reboot.

For people looking at doing this in the US, the USB-SATA cable often goes on sale for <$5. It currently is on Amazon.
https://slickdeals.net/f/12976606-sabrent-usb-3-0-to-ssd-sata-hard-drive-adapter-4-95?src=frontpage

@tunnus
Did try this on my production unit but did not complete the procedure.

Will try this again on my test unit this week and report back.

Hi @rafale77 - I had some problems getting vera to use the new ssd but it’s working now.

What happened was, after running the script (successfully, with no errors) Vera rebooted and showed me the following (note the 2 new partitions but rootfs still on the old):-

Filesystem Size Used Available Use% Mounted on
rootfs 8.6M 6.5M 2.1M 75% /
/dev/root 10.0M 10.0M 0 100% /rom
tmpfs 124.8M 312.0K 124.4M 0% /tmp
/dev/mtdblock7 8.6M 6.5M 2.1M 75% /overlay
overlayfs:/overlay 8.6M 6.5M 2.1M 75% /
tmpfs 512.0K 0 512.0K 0% /dev
/dev/sda1 493.6M 2.1M 455.2M 0% /tmp/log/cmh
/dev/sda2 219.4G 105.7M 208.2G 0% /mnt/sda2
/dev/mtdblock10 50.0M 11.2M 38.8M 22% /storage
/dev/mtdblock10 50.0M 11.2M 38.8M 22% /etc/cmh-firmware
/dev/mtdblock10 50.0M 11.2M 38.8M 22% /etc/cmh-backup
/dev/mtdblock9 9.8M 9.8M 0 100% /mios

I rebooted again - no change. I ran the script again (probably a mistake but still, no change).

I then went into the GUI and disabled the USB logging checkbox. When Vera rebooted and came back online, to my surprise, the checkbox was still enabled! I then checked the file system again and it now looks ok:-

Filesystem Size Used Available Use% Mounted on
rootfs 219.4G 105.7M 208.2G 0% /
/dev/root 10.0M 10.0M 0 100% /rom
tmpfs 124.8M 352.0K 124.4M 0% /tmp
/dev/sda2 219.4G 105.7M 208.2G 0% /
tmpfs 512.0K 0 512.0K 0% /dev
/dev/sda1 493.6M 3.3M 454.1M 1% /tmp/log/cmh
/dev/mtdblock10 50.0M 1.4M 48.6M 3% /storage
/dev/mtdblock10 50.0M 1.4M 48.6M 3% /etc/cmh-firmware
/dev/mtdblock10 50.0M 1.4M 48.6M 3% /etc/cmh-backup
/dev/mtdblock9 9.8M 9.8M 0 100% /mios

Not sure what happened but thought I’d post my findings.

Thanks for creating this script!

Great! Thank you for reporting back. Let me know if it reverts for some reason. It looks to me like somehow the script to disable USB logging failed and deleted something. If you don’t mind, could you PM me the content of your /etc/config/fstab file?

Hmm looking closer at you df output, it looks like the first time you ran the script, you may have run the wrong script? Did you run the savespace script instead? The reason is the content of your mtdblock10 seems bigger than normal


I have never seen these errors before. Is this the entire output or was there more before it?
Did you have an SSD plugged in with USB logging enabled?

It is also strange that without the SSD your vera won’t reboot since
 the script technically does not change anything on the onboard drive besides modifying the fstab which will make it look for the external SSD and pivot at boot. I suspect you are having other problems. Can you try to factory reset?

There are many ways to figure out what IP it has. Hopefully it was assigned by your DHCP server and so it will show up on your router as a new DHCP lease you should be able to recognize. If not you can always use a mobile app called fing, there are a lot of different network scanners out there depending on what platform you use. That’s how you will get your vera’s IP if it is in the subnet.

The few lines you obtained are very strange. They are indicative of a hardware failure or I am thinking, running out of DRAM during the process. Without the beginning of it, it will be difficult for me to figure out what happened. It seems like everything attached properly. The Plus does have much more RAM than the edge and the process makes use of the /tmp folder which is oddly called the nvram but really is a ramdisk. It however should not fill it as it is only used as a mount point.

The reset process if I am not mistaken requires you to push the reset button rapidly several times after the vera has booted. You might want to try this. From the output your provided, it is unlikely your SSD’s second partition was properly setup.

This should be the reset process. The vera is copying files from its rom partition to your root partition
 aka factory reset

I still have no idea how the script could have done this,
Once you have restored from your backup,

could you run these one at a time and tell me the output?

echo “arch ramips_24kec 100” >> /etc/opkg.conf
echo “arch ramips_1004kc 200” >> /etc/opkg.conf
echo “arch all 300” >> /etc/opkg.conf
echo “src/gz base Index of /barrier_breaker/14.07/ramips/mt7620a/packages/base/” >> /etc/opkg.conf
echo “src/gz packages Index of /barrier_breaker/14.07/ramips/mt7620a/packages/packages/” >> /etc/opkg.conf
opkg update
opkg install nano
opkg install block-mount

1 Like

Just got my factory refurb delivered that replace my bricked VeraPlus. 90% full already.
Filesystem Size Used Available Use% Mounted on
rootfs 8.8M 7.9M 860.0K 90% /
/dev/root 10.0M 10.0M 0 100% /rom
tmpfs 124.8M 784.0K 124.0M 1% /tmp
/dev/mtdblock6 8.8M 7.9M 860.0K 90% /overlay
overlayfs:/overlay 8.8M 7.9M 860.0K 90% /
tmpfs 512.0K 0 512.0K 0% /dev
/dev/mtdblock10 50.0M 1.4M 48.6M 3% /storage
/dev/mtdblock10 50.0M 1.4M 48.6M 3% /etc/cmh-firmware
/dev/mtdblock10 50.0M 1.4M 48.6M 3% /etc/cmh-backup
/dev/sda1 54.9G 63.3M 52.0G 0% /tmp/log/cmh
/dev/mtdblock9 9.8M 9.8M 0 100% /mios
time to extroot it appears

I had the same experience with a new Vera plus, ran the script and rootfs size did not change, untick enable log to USB in the GUI and presto

root@MiOS_50201345:~# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 146.1G 106.1M 138.5G 0% /
/dev/root 10.0M 10.0M 0 100% /rom
tmpfs 124.8M 4.0M 120.7M 3% /tmp
/dev/sda2 146.1G 106.1M 138.5G 0% /
tmpfs 512.0K 0 512.0K 0% /dev
/dev/sda1 493.6M 27.3M 430.0M 6% /tmp/log/cmh
/dev/mtdblock10 50.0M 1.4M 48.6M 3% /storage
/dev/mtdblock10 50.0M 1.4M 48.6M 3% /etc/cmh-firmware
/dev/mtdblock10 50.0M 1.4M 48.6M 3% /etc/cmh-backup
/dev/mtdblock9 9.8M 9.8M 0 100% /mios

Tried to run extroot.sh and got this output.
This script will ExtRoot your vera. Please make sure that you have an external drive plugged into the vera and that USB logging is enabled.
Are you ready? y
Downloading http://dl.mios.com/firmware/mt7621_G450/openwrt/ramips/packages/Packages.gz.
Updated list of available packages in /var/opkg-lists/mios_g450.
Downloading http://archive.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/base/Packages.gz.
Updated list of available packages in /var/opkg-lists/base.
Downloading http://archive.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/packages/Packages.gz.
Updated list of available packages in /var/opkg-lists/packages.
Installing nano (2.3.6-1) to root

Downloading http://archive.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/packages/nano_2.3.6-1_ramips_24kec.ipk.
Configuring nano.
Installing block-mount (2014-06-22-e0430f5c62f367e5a8e02755412977b02c3fc45e) to root

Downloading http://archive.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/base/block-mount_2014-06-22-e0430f5c62f367e5a8e02755412977b02c3fc45e_ramips_24kec.ipk.
Configuring block-mount.
mke2fs 1.42.4 (12-June-2012)
Could not stat /dev/sda2 — No such file or directory

The device apparently does not exist; did you specify it correctly?
mount: mounting /dev/sda2 on /mnt/sda2 failed: No such file or directory
./
./bin/
./bin/8021xd
./bin/8021xdi
./bin/adduser
./bin/ash
./bin/ated
./bin/base64
./bin/busybox
./bin/cat
./bin/chgrp
./bin/chmod
./bin/chown
./bin/conspy
./bin/cp
./bin/date
./bin/dd
./bin/deluser
./bin/df
./bin/dmesg
./bin/dnsdomainname
./bin/echo
./bin/egrep
./bin/em357-ncp-uart-rts-cts-use-with-serial-uart-bl-500.ebl
./bin/false
./bin/fgrep
./bin/fsync
./bin/getopt
./bin/grep
./bin/gunzip
./bin/gzip
./bin/hostname
./bin/ip
./bin/ipcalc
./bin/ipcalc.sh
./bin/kill
./bin/linux32
./bin/linux64
./bin/ln
./bin/lock
./bin/login
./bin/login.sh
./bin/ls
./bin/mkdir
./bin/mknod
./bin/mktemp
./bin/more
./bin/mount
./bin/mt
./bin/mv
./bin/netmsg
./bin/netstat
./bin/nice
./bin/opkg
tar: can’t create symlink from ./bin/kill to busybox: No space left on device
tar: can’t create symlink from ./bin/linux32 to busybox: No space left on device
tar: can’t create symlink from ./bin/linux64 to busybox: No space left on device
tar: can’t create symlink from ./bin/ln to busybox: No space left on device
tar: can’t create symlink from ./bin/lock to busybox: No space left on device
tar: can’t create symlink from ./bin/login to busybox: No space left on device
tar: can’t open ‘./bin/login.sh’: No space left on device
cfg0e4d78
cfg0f4d78
cfg104d78
uci: I/O error
umount: can’t umount /dev/sda2: No such file or directory
/dev/mtdblock5: UUID=“0d5070bb-ad8ab638-89b1e4d9-4f636109” VERSION=“1024.0” TYPE=“squashfs”
/dev/mtdblock6: TYPE=“jffs2”
/dev/mtdblock9: UUID=“c82ec6c0-834b904c-3543ccdc-032a1b86” VERSION=“1024.0” TYPE=“squashfs”
/dev/sda1: UUID=“de8930f3-e06e-49db-8e8b-26afda5d5188” LABEL=“MiOS” NAME=“EXT_JOURNAL” VERSION=“1.0” TYPE=“ext3”
root@MiOS_50021410:/lib#

Did you enable usb logging on the log page of the UI? The output shows that you don’t have a partitioned usb drive. The script actually asks you this question.

I did and the box is checked. I assumed it was enabled because I saw this line:
/dev/sda1 54.9G 63.3M 52.0G 0% /tmp/log/cmh