12 Replies Latest reply on Oct 18, 2016 12:55 PM by Intel Corporation

    Problems with update partition and post_install.sh

    nilson

      Hello everybody,

      I have some trouble with the update partition /dev/mmcblk0p9; /dev/loop0; /dev/disk/by-partlabel/update; or how you call it.

       

      The mass storage comes not up correctly (it is not formated and has no name) using Windows or Linux.

      • I need to name that device and make it accessable to Windows and Linux

       

       

      I used the Edison Board Configuration Tool to update the firmware on the Intel Edison (Firmware version installed: 201606061707).

      [   18.563981] sh[231]: Restore home/root contents on new /home partition : Success

      [   18.596204] sh[231]: Welcome to fdisk (util-linux 2.24.2).

      [   18.623243] sh[231]: Changes will remain in memory only, until you decide to write them.     

      [   18.655411] sh[231]: Be careful before using the write command.

      [   18.678830] sh[231]: Command (m for help):

      [   18.703369] sh[231]: Partition type:

      [   18.719515] sh[231]: p   primary (1 primary, 0 extended, 3 free)

      [   18.743195] sh[231]: e   extended

      [   18.775534] sh[231]: Select (default p): Partition number (2-4, default 2): Value out of range.

      [   18.822599] sh[231]: Partition number (2-4, default 2):

      [   18.855412] sh[231]: No free sectors available.

      [   18.887189] sh[231]: Command (m for help):

      [   18.932133] sh[231]: Command (m for help):

      [   18.959143] sh[231]: Selected partition 1

      [   19.012041] sh[231]: Hex code (type L to list all codes): Changed type of partition 'W95 FAT32' to 'W95 FAT32'.

      [   19.047267] sh[231]: Command (m for help): Disk /dev/disk/by-partlabel/update: 768 MiB, 805306368 bytes, 1572864 sectors                         

      [   19.073691] sh[231]: Units: sectors of 1 * 512 = 512 bytes

      [   19.103428] sh[231]: Sector size (logical/physical): 512 bytes / 512 bytes

      [   19.127200] sh[231]: I/O size (minimum/optimal): 512 bytes / 512 bytes

      [   19.162166] sh[231]: Disklabel type: dos

      [   19.199085] sh[231]: Disk identifier: 0xbe3d1766

      [   19.247342] sh[231]: Device                                      Boot Start   End         Blocks  Id System

      [   19.287234] sh[231]: /dev/disk/by-partlabel/update1         2048   1572863 785408   b W95 FAT32

      [   19.297741] sh[231]: Command (m for help): Re-reading the partition table failed.: Invalid argument          

      [   19.299766] sh[231]: The partition table has been altered.

      [   19.302168] sh[231]: Calling ioctl() to re-read partition table.

      [   19.432357] sh[231]: The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).                

      [   19.435091] sh[231]: Formatting update partition Step 1 : Success

      [   19.437099] sh[231]: Formatting update partition Step 2 : Failed ret(1)

      [   19.439176] sh[231]: No journal files were found.

      [   20.034073] sh[231]: mkfs.vfat: /dev/loop0 contains a mounted file system.

      [   20.074714] sh[231]: mkfs.vfat 2.11 (12 Mar 2005)

      [   20.106236] sh[231]: Formatting update partition Step 3 : Failed ret(1)

      [   20.172362] sh[231]: No journal files were found.

      [   20.938308] sh[231]: Formatting update partition Step 4 final : Success

      [   22.209492] sh[231]: Update file system table /etc/fstab : Success

      [   23.711607] sh[231]: Generating Wifi Access Point SSID and passphrase : Success

      [   23.773219] sh[231]: Post install success

       

      It seems to me that it fails at diffent points (fdisk, step 2 and step 3)

      [   18.775534] sh[231]: Select (default p): Partition number (2-4, default 2): Value out of range

      [   19.437099] sh[231]: Formatting update partition Step 2 : Failed ret(1)

      [   19.439176] sh[231]: No journal files were found.

      [   20.034073] sh[231]: mkfs.vfat: /dev/loop0 contains a mounted file system.

      [   20.074714] sh[231]: mkfs.vfat 2.11 (12 Mar 2005)

      [   20.106236] sh[231]: Formatting update partition Step 3 : Failed ret(1)

       

      All that is part of the post_install.sh script.

      I also tried to build Yocto Linux http://iotdk.intel.com/src/3.5/edison/iot-devkit-yp-poky-edison-20160606.zip but the result is the same.

       

      So I did the process after updating using commands from console by hand. All commands related to post_install.sh script:

      meta-intel-edison - Layer for the Intel Edison Development Platform

       

      First unmount the device because of error:

      [   20.034073] sh[231]: mkfs.vfat: /dev/loop0 contains a mounted file system.

      root@edison:~# df -h

      Filesystem       Size  Used Avail Use% Mounted on

      /dev/root        1.4G 1010M  319M  76% /

      devtmpfs         480M     0  480M   0% /dev

      tmpfs            481M     0  481M   0% /dev/shm

      tmpfs            481M  592K  480M   1% /run

      tmpfs            481M     0  481M   0% /sys/fs/cgroup

      tmpfs            481M  4.0K  481M   1% /tmp

      tmpfs            481M  6.1M  474M   2% /var/volatile

      /dev/loop0       767M  4.0K  767M   1% /media/storage

      /dev/mmcblk0p10  1.3G  2.0M  1.3G   1% /home

      /dev/mmcblk0p5  1003K   19K  913K   3% /factory

      tmpfs             97M     0   97M   0% /run/user/0

      root@edison:~# root@edison:~# df -h

       

      root@edison:~# umount /dev/loop0

       

      Then run fdisk but delete partition first because of error:

      [   18.775534] sh[231]: Select (default p): Partition number (2-4, default 2): Value out of range.

      root@edison:~# fdisk /dev/disk/by-partlabel/update

       

      Welcome to fdisk (util-linux 2.24.2).

      Changes will remain in memory only, until you decide to write them.

      Be careful before using the write command.

       

       

      Command (m for help): d

      Selected partition 1

      Partition 1 has been deleted.

       

      Command (m for help): n

       

      Partition type:

         p   primary (0 primary, 0 extended, 4 free)

         e   extended

      Select (default p): p

      Partition number (1-4, default 1): 1

      First sector (2048-1572863, default 2048):

      Last sector, +sectors or +size{K,M,G,T,P} (2048-1572863, default 1572863):

       

      Created a new partition 1 of type 'Linux' and of size 767 MiB.

       

      Command (m for help): t

      Selected partition 1

      Hex code (type L to list all codes): b

      If you have created or modified any DOS 6.x partitions, please see the fdisk documentation for additional information.

      Changed type of partition 'Linux' to 'W95 FAT32'.

       

      Command (m for help): w

      The partition table has been altered.

      Calling ioctl() to re-read partition table.

      Re-reading the partition table failed.: Invalid argument

       

      The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).

       

      Then setup the loopdevice without error:

      [   19.437099] sh[231]: Formatting update partition Step 2 : Failed ret(1)

      root@edison:~# losetup -o 8192 /dev/loop0 /dev/disk/by-partlabel/update

       

      Then run mkfs.vfat with an warning that schould be ok but without error:

      [   20.034073] sh[231]: mkfs.vfat: /dev/loop0 contains a mounted file system.

      root@edison:~# mkfs.vfat /dev/loop0 -n "Edison" -F 32

      mkfs.vfat 2.11 (12 Mar 2005)

      Loop device does not match a floppy size, using default hd params

       

      Then detach loopdevice and reboot system

      root@edison:~# losetup -d /dev/loop0

      root@edison:~# shutdown -r now

       

      After reboot the mass storage did not come up with its name and had to be formated by Windows.

      I think that should have been done by mkfs.vfat command.

      Can anyone help me with that issue?

       

      Some questions that are important for me:

      1. Is that issue known?
      2. how can I name and format the mass storage from within the OS of an Intel Edison?
      3. Where can I resize partitions in Yocto sources?

       

       

      Thanks for your reply.

       

      Best regards

      Nils

        • 1. Re: Problems with update partition and post_install.sh
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hello nilson,

           

          I'll try to help you repartition your board's memory. This is a common issue that can be caused by several reasons, it is usually easy to recover from it using the flashing tools. Since you have already tried to recover your board using the setup tool, I suggest you to try the flashall method. You can find instructions on how to do it in https://communities.intel.com/docs/DOC-25154.

           

          If you'd like to change the drive's label, you could use a tools such as mlabel (https://linux.die.net/man/1/mlabel). Nevertheless, you will have to build it from source. In order to install mlabel you have to install mtools (https://www.gnu.org/software/mtools/) and its dependencies.

           

          The subject of resizing the image's partitions has been discussed several times in the past, so, I'd suggest you to read the following thread and guides to learn how to do it:

           

          https://communities.intel.com/thread/55612?start=0&tstart=0
          https://communities.intel.com/docs/DOC-23449
          http://alextgalileo.altervista.org/blog/changing-partition-setup-edison/

           

          I hope this information helps you.
          -Peter.

          • 2. Re: Problems with update partition and post_install.sh
            nilson

            Hello Peter,

            I'll try to help you repartition your board's memory. This is a common issue that can be caused by several reasons, it is usually easy to recover from it using the flashing tools. Since you have already tried to recover your board using the setup tool, I suggest you to try the flashall method. You can find instructions on how to do it in https://communities.intel.com/docs/DOC-25154.

             

            unfortunately the flashall method did not work for me. I tried the method using Windows and Linux. Do you have any other idea regarding that problem?

             

            Example for Linux:

            sudo ./flashall.sh

            Using U-Boot target: edison-blankcdc

            Now waiting for dfu device 8087:0a99

            Please plug and reboot the board

            Flashing IFWI

            Download    [=========================] 100%      4194304 bytes

            Download    [=========================] 100%      4194304 bytes

            Flashing U-Boot

            Download    [=========================] 100%       237568 bytes

            Flashing U-Boot Environment

            Download    [=========================] 100%        65536 bytes

            Flashing U-Boot Environment Backup

            Download    [=========================] 100%        65536 bytes

            Rebooting to apply partition changes

            Now waiting for dfu device 8087:0a99

            Flashing boot partition (kernel)

            Download    [=========================] 100%      6144000 bytes

            Flashing rootfs, (it can take up to 5 minutes... Please be patient)

            Download    [=========================] 100%   1400102912 bytes

            Rebooting

            U-boot & Kernel System Flash Success...

            Your board needs to reboot to complete the flashing procedure, please do not unplug it for 2 minutes.

             

            The result in post_install.sh at first startup is the same.

            Is there a difference when using sudo ./flashall.sh --recovery? I tried to get that working with xFSTK Tools like described here: Flashall.sh and pre-built xFSTK

             

            I have following issue with that method:

            ./flashall.sh --recovery

            Starting Recovery mode

            Please plug and reboot the board

            Flashing IFWI

            xfstk-dldr-solo: error while loading shared libraries: libQtCore.so.4: cannot open shared object file: No such file or directory

            Xfstk tool error

            DEBUG: lsusb

            Bus 002 Device 002: ID 8087:8000 Intel Corp.

            ...

             

            If you'd like to change the drive's label, you could use a tools such as mlabel (https://linux.die.net/man/1/mlabel). Nevertheless, you will haev to build it from source. In order to install mlabel you have to install mtools (https://www.gnu.org/software/mtools/) and its dependencies.

            The subject of resizing the image's partitions has been discussed several times in the past, so, I'd suggest you to read the following thread and guides to learn how to do it:

            https://communities.intel.com/thread/55612?start=0&tstart=0
            https://communities.intel.com/docs/DOC-23449
            http://alextgalileo.altervista.org/blog/changing-partition-setup-edison/

            I will try the partitioning and label change (adding mtools) next week.

            Thank you so far. I will post the result.

             

            Best

            Nils

            • 3. Re: Problems with update partition and post_install.sh
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              Hi Nils,

              I understand, since you have already tried both the flashall method and the Flashall.sh and pre-built xFSTK method, your best option is to submit an email to the form: https://customercare.intel.com/?lang=en-US. There we'll be able to take a closer look at your case. When filling the form, please explain that you have tried to recover your board with the Setup Tool, the flashall method and the Flashall.sh and pre-built xFSTK method.

              Let me know if you receive a response.
              -Peter.

              • 4. Re: Problems with update partition and post_install.sh
                nilson

                Hello Peter,

                I did not contact the customer service yet but I could solve the main problem with the update partition at the weekend.

                 

                Maybe the post_install.sh script is not working correctly in the given way. Perhaps an Yocto Intel BSP developer could verify that.

                For me the following way worked well:

                 

                I have some trouble with the update partition /dev/mmcblk0p9; /dev/loop0; /dev/disk/by-partlabel/update; or how you call it.

                The mass storage comes not up correctly (it is not formated and has no name) using Windows or Linux.

                • I need to name that device and make it accessable to Windows and Linux

                 

                 

                1. use "df -h" to check if your update partition is mounted and use "umount" to unmount it
                2. start fdisk /dev/mmcblk0p9
                  1. delete the partition (do not create a new one!!!)
                  2. set the device to fat32
                  3. write changes
                3. start mkfs.vfat -F 32 -n Edison /dev/mmcblk0p9
                4. reboot

                 

                Now your USB device named Edison should come up using Linux.

                Windows is not working with that configuration! I will write a message when I got that.

                 

                 

                Best

                Nils

                • 5. Re: Problems with update partition and post_install.sh
                  Intel Corporation
                  This message was posted on behalf of Intel Corporation

                  Thank you for updating us, please keep us aware of any news and if you have issues, please contact us back and we'll  try to help you.

                  -Peter.

                  • 6. Re: Problems with update partition and post_install.sh
                    Intel Corporation
                    This message was posted on behalf of Intel Corporation

                    Hi Nils,

                    Do you have any updates about this?

                    -Peter.

                    • 7. Re: Problems with update partition and post_install.sh
                      nilson

                      Hi Peter,

                      I had no time to get deeper in touch with the problem. I hope that I will have more time next week.

                       

                      But the mass storage device is also working on MAC.

                       

                      I will give you an update as soon as possible.

                       

                       

                      Best

                      Nils

                      • 8. Re: Problems with update partition and post_install.sh
                        Intel Corporation
                        This message was posted on behalf of Intel Corporation

                        Hi Nils,

                        Thank you for letting us know, please keep us updated.

                        -Peter.

                        • 9. Re: Problems with update partition and post_install.sh
                          nilson

                          Hello Peter,

                          I could not manage to have a running accessible mass-storage device. When using Linux or MAC it is not necessary to create a partition. You can only formate the hole memory space with "mkfs.vfat" or "mkdosfs". Then you have a accessible mass-storage. I have a question about the process of partitioning the update memory area.

                          Earlier you said

                          Intel Corporation schrieb:

                           

                          I'll try to help you repartition your board's memory. This is a common issue that can be caused by several reasons, it is usually easy to recover from it using the flashing tools.

                          Can you please show me a way from inside the Yocto Linux to make a partition that is accessible from the outside (Windows) with g_multi. What else is necessary and not mentioned in the post_install.sh. Is there a call of "dd" or some configuration that can fail. What are these several reasons?

                           

                          Best

                          Nils

                          • 10. Re: Problems with update partition and post_install.sh
                            Intel Corporation
                            This message was posted on behalf of Intel Corporation

                            On my first reply when I mentioned:
                             
                            "...This is a common issue that can be caused by several reasons, it is usually easy to recover from it using the flashing tools…"
                             
                            I originally thought that the behavior was caused because of a software issue on the image. That's why I suggested you to flash your board with flashall. Nevertheless, as the thread developed I appeared as this was not the case.
                             
                            According to your following statement (and the post it's on):
                             
                            "...Now your USB device named Edison should come up using Linux.
                            Windows is not working with that configuration..."
                             
                            It seems that your Edison is working fine but the issue might be on the Windows PC you are trying to connect to. However, the fact that you had to modify post_install.sh also makes me wonder if the image you are using is a custom image you created. If this was the case I would like that you try the following:
                             
                            Flash your board with the official image (https://software.intel.com/edison-image/latest) using the flashall method (https://communities.intel.com/docs/DOC-25154). Then check again if the drive can be found on Windows. Let us know how it goes.
                             
                            If that is not the case and you were always using the official image, please let us know.
                            We'll be waiting for your reply.
                            -Peter.

                            • 11. Re: Problems with update partition and post_install.sh
                              nilson

                              Hello Peter,

                              I am working with the official sources. I only added some special python libraries and so on.

                              Also with an official image it is not working to have the mass-storage accessible (neither on Linux nor on Windows). To access it from Linux fdisk must be used in a different way then done in post_install.sh.

                               

                              Unfortunately at this moment I have no time to go on with that issue. Maybe we can close this discussion and go on later.

                               

                              Thank you for your help on that.

                               

                              Best

                              Nils

                              • 12. Re: Problems with update partition and post_install.sh
                                Intel Corporation
                                This message was posted on behalf of Intel Corporation

                                I understand your situation. 

                                Yes, whenever you can continue to troubleshoot this issue reply to this thread and we'll try to help you.

                                -Peter.