6 Replies Latest reply on Mar 29, 2016 9:53 AM by Intel Corporation

    Reformat edison update partition from command line?




      I am trying to make a script to pull an Edison image from my server and load it with an OTA update. I have had issues with the update occasionally not "sticking"-- mount the update, call "reboot ota", and the Edison wakes up with the old image intact. While trying to debug this, I tried to reformat the /update partition. Apparently I messed up, as I'm now getting the following error with my update script:

      /sbin/losetup -o 8192 /dev/loop0 /dev/disk/by-partlabel/update

      mount /dev/loop0 /update


      mount: wrong fs type, bad option, bad superblock on /dev/loop0,

              missing codepage or helper program, or other error

              In some cases useful info is found in syslog - try

              dmesg | tail or so.


      I can't find anything helpful in dmesg | tail. Is there anything I can do to recover this module? I can connect just fine, but I can't get another update on.

        • 1. Re: Reformat edison update partition from command line?

          Hi nrlakin,


          If you don't mind, I was going to ask you a question about your post, as we have interest in doing the same thing.  Unfortunately we haven't attempted yet so I can't be helpful in terms of your specific question.  But perhaps we could attempt and provide feedback on our experience. 


          I was curious if you are loading your own custom image or the latest one from Intel?  I noticed that the latest image (edison-iotdk-image-280915.zip) is too large for the /update partition.  This has been documented on this forum, and it seems the only method to load this image is from the Flash Tool, or by running flashall.sh script.  It also appeared it might be possible to change the partition table to expand the /update partition, but this would effectively wipe the /home partition thus making OTA more challenging if not impossible.


          Just thought I would see what you have found, as it sounds like you have had some success ...



          • 2. Re: Reformat edison update partition from command line?

            Hey ttc,


            We are loading a custom image based off an earlier Yocto release, so I'm not sure if I can be helpful. Are you mounting the update partition before or after populating it with the Yocto image? It will throw an error if you try to pull the image from a server without executing the


            /sbin/losetup -o 8192 /dev/loop0 /dev/disk/by-partlabel/update

            mount /dev/loop0


            commands first, as it seems to try fitting the full image in RAM without the partition allocated. If the order is correct, and the image is just too big, I found this page in my hunting:


            which includes a procedure to increase the size of the /update partition. I haven't tried it, though, and the mkfs.vfat command at the top is how I broke my OTA update, so user beware!



            • 3. Re: Reformat edison update partition from command line?

              Thanks Neil, that is helpful to know you are using your own custom image.


              I may try at some point to expand the partitions and see if that method works.  Obviously we will eat into our existing storage space, but might be a worthwhile tradeoff.

              • 4. Re: Reformat edison update partition from command line?
                Intel Corporation
                This message was posted on behalf of Intel Corporation

                Hello nrlakin,


                In order to recover your board I'd suggest you to try using either Flash Tool Lite or flashall. That should get your board into a regular state.
                Now, I'm not sure I understand what you are trying to achieve. As ttc7152 mentions the latest image (159.devkit) is bigger than Edison's drive storage, how in previous versions this is not the case. So in this case you have several options, flash the Edison with wired methods (Flash Tool Lite and flashall), use a previous version of the image or repartition the Edison's storage (for this, building the image with the new partitions is the best option and I must point out that a "reboot ota" won't repartition the board).
                From your post I believe you are trying to create an "over the air" flash process for your board, am I right? If so, you might be interested in checking the code for configure_edison, since it has the option --upgrade that was used (up to version 146) to download the image and flash it. You could adapt this code to our project, it can be found in /usr/bin/configure_edison.



                • 5. Re: Reformat edison update partition from command line?

                  Hi Peter,


                  I've actually got my OTA flash process working--I'm just trying to recover one module that I broke while figuring out the process. At some point, I tried reformatting the /update partition with this command:


                  mkfs.ext4 /dev/disk/by-partlabel/update


                  and now when I try to mount the /update partition I get the error described at the top of this thread. I'm not trying to update to the larger image; we have a custom image built off an earlier Yocto version, and size isn't an issue; I think ttc7152 is trying to get an OTA update working with the larger image. My OTA update is working fine with my production image, I'd just like to recover the other board.

                  • 6. Re: Reformat edison update partition from command line?
                    Intel Corporation
                    This message was posted on behalf of Intel Corporation

                    I understand, in that case you have three options, you can recover your board using Flash Tool Lite, flashall, or flashall.sh and pre-built xFSTK. The last method I mentioned is only available for Linux, you can find the guides on how to try them in:
                    Flash Tool Lite:
                    *The tool can be downloaded from: https://software.intel.com/en-us/iot/hardware/edison/downloads
                    Flashall.sh and pre-built xFSTK:
                    Try them and let me know if they help you recover your board.