Announcement

Collapse
No announcement yet.

How to backup Z-NET image

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Sorry I couldn't get back to you sooner, I switched the SD card from the z-net to the RPi3 and vice versa. The z-net backed up properly with the card that wouldn't work in the RPi3.

    Now the Rpi3 says I have to unmount the card before I can proceed. I answered yes and the process started but is taking quite a long time. Not sure if it is locked up or not. Will report back...
    Attached Files

    Comment


      #17
      It did complete, so it appears all is well after swapping two SD cards. I'll try another backup tomorrow and see how it goes. Thanks again @zwolfpack.

      Comment


        #18
        I have a Z-Net, but I'm clueless with Linux. I downloaded rpi-clone, but not really sure what to do with it. Are there any good guides for complete newb? Does it require disassembly to access an sdcard inside?

        Comment


          #19
          This thread provides a reasonably good guide...

          Post #2 links to the two predominant backup solutions

          Post #5 details why periodic backup of the Z-Net often isn't necessary.

          Post #10 provides an installer and instructions to jump-start use of rpi-clone.

          Post #4 answers you final question - no disassembly required with rpi-clone. It does require an SD card adapter similar to that linked in post #12.

          Comment


            #20
            Originally posted by zwolfpack View Post
            This thread provides a reasonably good guide...

            Post #2 links to the two predominant backup solutions

            Post #5 details why periodic backup of the Z-Net often isn't necessary.

            Post #10 provides an installer and instructions to jump-start use of rpi-clone.

            Post #4 answers you final question - no disassembly required with rpi-clone. It does require an SD card adapter similar to that linked in post #12.
            Thanks @zwolfpack, I realize that a periodic backup is not required unless making changes to the Z-Net. So for now, I'll make a note of this thread and try to learn a bit more before trying later. I appreciate the information and your utility you posted above!

            Comment


              #21
              Originally posted by zwolfpack View Post
              This thread provides a reasonably good guide...

              Post #2 links to the two predominant backup solutions

              Post #5 details why periodic backup of the Z-Net often isn't necessary.

              Post #10 provides an installer and instructions to jump-start use of rpi-clone.

              Post #4 answers you final question - no disassembly required with rpi-clone. It does require an SD card adapter similar to that linked in post #12.
              Hi @zwolfpack, I'm back. I used Putty to connect to my Z-Net and ran the commands outlined above, but I saw a reference to one error. Not sure what it was about, so I tried to copy the entire screen contents so I could paste into this thread for help. But when I right-clicked, it copied *and* pasted back into the Putty session window, so all my output was executed (at least what wasn't invalid). I don't think I broke it because it still works fine, but I'm not sure of its state either.

              When I run a "ls" command, I see a lot of directories listed. Wasn't sure if that was leftover, so I closed the session and reconnected. When I re-run the "ls" command, I still see them.

              Any idea how to fix it or reset back to default (e.g. maybe an image download?)?

              The Z-Net still works to control my lights, so whatever happened, didn't see to have broken it.


              Here's what I see from the last session:

              Code:
              login as: pi
              pi@192.168.1.166's password:
              
              The programs included with the Debian GNU/Linux system are free software;
              the exact distribution terms for each program are described in the
              individual files in /usr/share/doc/*/copyright.
              
              Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
              permitted by applicable law.
              pi@ZNet-Apartment:~ $ ls
              ]               Debian      inflating:           pi@ZNet-Apartment:~  Saving
              00README.txt    dpkg        Is                   postfix_install.sh   sdlabels
              --2018-04-15    error:      logrotate.rpi-clone  replace              the
              Archive:        HTTP        Makefile             rpi-clone            The
              cron.rpi-clone  individual  permitted            rpi-clone-batch.zip  unzip
              pi@ZNet-Apartment:~ $ cd rpi-clone
              pi@ZNet-Apartment:~/rpi-clone $ ls
              pi@ZNet-Apartment:~/rpi-clone $
              Attached Files

              Comment


                #22
                When you log in as user 'pi' you are pretty well protected from messing up, due to file permissions. Looks like you created a few junk files in pi's home directory - no harm, and easy to get rid of.

                First, make sure you are in the home directory - type the command 'cd' with no argument, then Enter.
                The prompt should now be
                pi@ZNet-Apartment:~ $

                The '~' at the end indicates you are in the home directory.

                Next type command:
                rm -i *

                rm is the 'remove file' command; with the option -i (interactive) it will ask for a confirmation before removing each file specified. The '*' is a wildcard that will match everything in the current directory. So you can type 'y' for everything you want to delete and 'n' for anything you want to retain.

                You can answer 'y' to pretty much everything in that directory. When you get to the directory 'rpi-clone' that you created, you can say 'n' (although even if you said 'y' this one won't work, as rm in this simple form only removes files, not directories).

                Comment


                  #23
                  Cool, thanks @zwolfpack. I'll run that to clean up my mess :-)!

                  I really appreciate your help/guidance!

                  Comment


                    #24
                    Originally posted by zwolfpack View Post
                    When you log in as user 'pi' you are pretty well protected from messing up, due to file permissions. Looks like you created a few junk files in pi's home directory - no harm, and easy to get rid of.

                    First, make sure you are in the home directory - type the command 'cd' with no argument, then Enter.
                    The prompt should now be
                    pi@ZNet-Apartment:~ $

                    The '~' at the end indicates you are in the home directory.

                    Next type command:
                    rm -i *

                    rm is the 'remove file' command; with the option -i (interactive) it will ask for a confirmation before removing each file specified. The '*' is a wildcard that will match everything in the current directory. So you can type 'y' for everything you want to delete and 'n' for anything you want to retain.

                    You can answer 'y' to pretty much everything in that directory. When you get to the directory 'rpi-clone' that you created, you can say 'n' (although even if you said 'y' this one won't work, as rm in this simple form only removes files, not directories).
                    Originally posted by NetworkGuy View Post
                    Cool, thanks @zwolfpack. I'll run that to clean up my mess :-)!

                    I really appreciate your help/guidance!
                    Hi @zwolfpack:

                    I got the device cleaned - thanks for the help! I'll re-run through the instructions to install rpi-clone (I noticed that the rpi-clone directory is empty).

                    I'm waiting on the SD card adapter you pointed out in your earlier post. Probably should purchase some extra 32GB MicroSD cards too soon. My order says it won't arrive for about another week or so. Once I get that, I'll execute using the sudo command (sudo rpi-clone -f sda). Earlier you mentioned that a cron job will run the backup daily (or maybe I misunderstood).

                    Is a cron job setup automatically or do you run it on demand as needed (sudo rpi-clone -f sda)?
                    Last edited by NetworkGuy; April 17, 2018, 03:06 PM.

                    Comment


                      #25
                      Once you run the posted instructions, the backup will be refreshed automatically once a day.

                      You stated that the rpi-clone directory was empty - however I notice that the files expected to be in there were among the files that were in the home directory. This would be the situation if you missed performing the 2nd command, which is to change directory (cd) into the rpi-clone directory before downloading and unzipping the file. (instructions reposted below)

                      BTW, the z-net SD card is typically 4GB, of which less than half is filled. So a 32GB card is bigger than needed...

                      Code:
                      mkdir rpi-clone
                      cd rip-clone
                      wget '[URL]https://forums.homeseer.com/attachment.php?attachmentid=68005&d=1523126717[/URL]' -O rpi-clone-batch.zip
                      unzip rpi-clone-batch.zip
                      make install
                      
                      sudo rpi-clone -f sda

                      Comment


                        #26
                        Hi @zwolfpack:

                        I ran the first few commands up to "WGET". It returned a few errors, so I didn't go any further. Does this output look expected?

                        Should I run the "unzip" command anyway?


                        EDIT:
                        I think the copy command shortened the URL, so I copied the URL and updated the command. I re-ran without those errors. I'll UNZIP and MAKE INSTALL now.

                        Output from UNZIP and MAKE INSTALL commands:
                        Code:
                        pi@ZNet-Apartment:~/rpi-clone $ unzip rpi-clone-batch.zip
                        Archive:  rpi-clone-batch.zip
                          inflating: 00README.txt
                          inflating: Makefile
                          inflating: rpi-clone
                          inflating: cron.rpi-clone
                          inflating: logrotate.rpi-clone
                          inflating: postfix_install.sh
                          inflating: sdlabels
                        pi@ZNet-Apartment:~/rpi-clone $ make install
                        unzip -uo rpi-clone-batch.zip
                        Archive:  rpi-clone-batch.zip
                          inflating: 00README.txt
                          inflating: Makefile
                          inflating: rpi-clone
                          inflating: cron.rpi-clone
                          inflating: logrotate.rpi-clone
                          inflating: postfix_install.sh
                          inflating: sdlabels
                        dpkg -V rsync || sudo make rsync
                        dpkg -V dosfstools || sudo make dosfstools
                        sudo install -p -t /usr/local/sbin rpi-clone
                        [sudo] password for pi:
                        sudo rm -f /etc/cron.daily/rpi-clone-sda
                        sudo install -p cron.rpi-clone /etc/cron.daily/rpi-clone
                        sudo install -p -m 644 logrotate.rpi-clone /etc/logrotate.d/rpi-clone
                        sudo install -p -t /usr/local/sbin sdlabels
                        pi@ZNet-Apartment:~/rpi-clone $

                        Code:
                        login as: pi
                        pi@192.168.1.166's password:
                        
                        The programs included with the Debian GNU/Linux system are free software;
                        the exact distribution terms for each program are described in the
                        individual files in /usr/share/doc/*/copyright.
                        
                        Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
                        permitted by applicable law.
                        pi@ZNet-Apartment:~ $ mkdir rpi-clone
                        mkdir: cannot create directory ‘rpi-clone’: File exists
                        pi@ZNet-Apartment:~ $ cd rpi-clone
                        pi@ZNet-Apartment:~/rpi-clone $ ls
                        pi@ZNet-Apartment:~/rpi-clone $ wget 'https://forums.homeseer.com/attachment.php                                                                                              ?attachmentid=68005&d=1523126717' -O rpi-clone-batch.zip unzip rpi-clone-batch.z                                                                                              ip make install
                        --2018-04-17 19:51:25--  https://forums.homeseer.com/attachment.php?attachmentid                                                                                              =68005&d=1523126717
                        Resolving forums.homeseer.com (forums.homeseer.com)... 45.32.202.7
                        Connecting to forums.homeseer.com (forums.homeseer.com)|45.32.202.7|:443... conn                                                                                              ected.
                        HTTP request sent, awaiting response... 200 OK
                        Length: 14633 (14K) [application/zip]
                        Saving to: ‘rpi-clone-batch.zip’
                        
                        rpi-clone-batch.zip 100%[=====================>]  14.29K  --.-KB/s   in 0.08s
                        
                        2018-04-17 19:51:26 (179 KB/s) - ‘rpi-clone-batch.zip’ saved [14633/14633]
                        
                        --2018-04-17 19:51:26--  http://unzip/
                        Resolving unzip (unzip)... 65.254.248.199
                        Connecting to unzip (unzip)|65.254.248.199|:80... connected.
                        HTTP request sent, awaiting response... 403 Forbidden
                        2018-04-17 19:51:26 ERROR 403: Forbidden.
                        
                        --2018-04-17 19:51:26--  http://rpi-clone-batch.zip/
                        Resolving rpi-clone-batch.zip (rpi-clone-batch.zip)... 65.254.248.199
                        Reusing existing connection to unzip:80.
                        HTTP request sent, awaiting response... 403 Forbidden
                        2018-04-17 19:51:26 ERROR 403: Forbidden.
                        
                        --2018-04-17 19:51:26--  http://make/
                        Resolving make (make)... 65.254.248.199
                        Reusing existing connection to unzip:80.
                        HTTP request sent, awaiting response... 403 Forbidden
                        2018-04-17 19:51:27 ERROR 403: Forbidden.
                        
                        --2018-04-17 19:51:27--  http://install/
                        Resolving install (install)... 65.254.248.199
                        Reusing existing connection to unzip:80.
                        HTTP request sent, awaiting response... 403 Forbidden
                        2018-04-17 19:51:27 ERROR 403: Forbidden.
                        
                        FINISHED --2018-04-17 19:51:27--
                        Total wall clock time: 1.9s
                        Downloaded: 1 files, 14K in 0.08s (179 KB/s)
                        pi@ZNet-Apartment:~/rpi-clone $ ls
                        rpi-clone-batch.zip
                        pi@ZNet-Apartment:~/rpi-clone $
                        Last edited by NetworkGuy; April 17, 2018, 07:19 PM.

                        Comment


                          #27
                          The first transcript looks correct; the scripts should now be installed and ready to go.

                          You can verify that the rpi-clone script has been installed via:

                          Code:
                          $ ls -l /usr/local/sbin/rpi-clone
                          -rwxr-xr-x 1 root staff 37800 Nov 30 12:04 /usr/local/sbin/rpi-clone
                          [Not sure what was going on with the 2nd transcript].

                          Once you get your card reader and spare cards, you can run
                          Code:
                          sudo rpi-clone -U -f sda
                          to make the 1st backup (note I've added the '-U' option, which prevents having to answer a couple of prompts).

                          Once initialized, the script installed at /etc/cron.daily/rpi-clone will run rpi-clone on a daily basis. You can track this via
                          Code:
                          more /var/log/rpi-clone.log
                          If the backup fails for any reason, email to the root user is generated. Of course, email isn't set up at this point so that'll end up in the bit-bucket.
                          For a future exercise, you might want to try configuring and running the included script 'postfix_install.sh' which can get outgoing email going.

                          Comment


                            #28
                            Originally posted by rprade View Post
                            David understands the underlying architecture of the Z-Net better than most, but it is important to realize that the Z-Net operating system is static. The only time the image changes is when you edit the Ethernet/Wifi settings or HomeSeer pushes out an update. Once you have yours configured and take an image of it, you will not need another unless you update the software or IP settings. Nothing is written to the SD card during normal operation. All Z-Wave node and routing information is stored on the GPIO daughtercard and nothing is written to the SD card. Z-Wave backups are stored on the HS host machine.
                            So does that mean there is no necessity to back up your card ? I think you can download an image from HS ? Had a problem with a corrupt card a while ago and I think thats how I fixed it

                            Comment


                              #29
                              Originally posted by mikee123 View Post
                              So does that mean there is no necessity to back up your card ? I think you can download an image from HS ? Had a problem with a corrupt card a while ago and I think thats how I fixed it
                              I made a backup of mine last night, then got it mixed up with another one and accidentally overwrote it. So I was grateful to have a backup... until I tried to restore it and I kept getting errors trying to write it.

                              Does anyone have a link to an HS image? I contacted support, but it's the weekend and I'm going on a business trip Monday morning and my family is gone for the week, so I'm really hoping to get it up and running ASAP!

                              Comment


                                #30
                                Does anyone have a link to an HS image?

                                The only HS3 image I am aware of that Homeseer 3 provides is really just a boot and write new Zee2 Raspberry Pi image.

                                Best is doing that DIY thing and keeping the RPi2 SD card to 16Gb and less compressed.

                                Fastest and smallest is just a compressed zipped or tarred HomeSeer directory copy.

                                You can do either vivo or not. Vivo you can write the image to a NAS drive mapped over to your RPi or an external USB stick or SD card. The RPi-Clone script mentioned above is probably easiest and fastest.

                                You can make a clean image with Homeseer installed for safe keeping then just write a clean and working and updated HomeSeer directory.

                                The stock Linux image is just a stock published RPi image with the addition of an auto start, mono and text to speech (linux) and a copy of the /usr/local/HomeSeer directory which Homeseer has not been configured yet (blank slate).

                                Ancient and still on the rack today is a Raritan 16 port KVM which has a web based remote control which does still work for remote access to the rack but rarely utilized these days as my RPis (and ARM) computers are just connected to the network with no keyboard, mouse or monitor.

                                Yesterday by accident here was updating my ZNet like device in the attic and fat fingered it via SSH using root access and deleting the /sbin directory. I did climb up to the attic and disconnected the RPi. Pulled the SD and rewrote a similiar Stretch /sbin directory to it. Did a check disk with GParted on it. Booted it up downstairs and it was working fine. Updated it, shut it down and put it back in the attic and all was well. Losing this device disconnected my ZWave network which did cause me a bit of grief.

                                Fastest right now that you can do in an hour or less is just build a new Zee2 image downloading the link to the HS3 Zee2 stuff and copy your backed up HomeSeer directory to it overwriting the Zee2 HomeSeer directory. If you are using DHCP the mac address will be the same. This will be less typing than downloading a stock RPi image and tweaking it for Homeseer from the RPi site. Most important is for the RPi running Homeseer you can get by with an 8Gb or 16Gb microSD card and do not really need a 32 or 64Gb microSD card. Well and these are cheaper and you can buy a bunch of fast ones for the price of one 32 or 64Gb microSD cards.
                                Last edited by Pete; July 14, 2018, 01:10 PM.
                                - Pete

                                Auto mator
                                Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
                                Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
                                HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

                                HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                                HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                                X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                                Comment

                                Working...
                                X