7 Replies Latest reply on Nov 25, 2015 3:50 PM by joe-iot

    Resize SD card linux


      I optimistically picked up a 32GB micro SDHC card, expecting to download tons of good stuff for this Linux system.

      What will I need to do to expand the Intel provided Linux image file system to fill this card?

      I did this for the Raspberry Pi - but there is no guarantee this will work on the Galileo.

      No rush - Mouser is estimating a couple of weeks still before I get my board.


      Kudos to SergeyK - I also ordered the Centrinoi N 6235, and downloaded the driver he recommended. It is already

      on my SD card... Really nifty WiFi - Bluetooth board, and $22 on Amazon. Still need to fabricate my antenna bracket - it will be a copy of his.



        • 1. Re: Resize SD card linux



          Galileo uses a loop mounted file system image (image-full-clanton.ext3) for the root filesystem. The file system size really depends on this file and not on the size of your SD card. It is possible to resize the file system contained in that image, but unfortunately the Linux image that Intel provides does not include required utilities to resize a file system.


          If you have access to another Linux computer, you can use the following steps to resize the filesystem.


          Assuming that SD card is mounted under /media/sdcard:

          1. Run a file system check (fsck) first:

          fsck.ext3 -f /media/sdcard/image-full-clanton.ext3

          2. Run resize2fs to resize the file system. The second argument (409600 in the example) specifies the new filesystem size in kilobytes:

          resize2fs /media/sdcard/image-full-clanton.ext3 409600




          1 of 1 people found this helpful
          • 2. Re: Resize SD card linux

            Man Sergey, you do get around!


            I am 2000 steps into this 2700 step Linux Yocto build, from the BSP build guide. bitbake image-full.

            Anything I should include in the build to make this easier, or I could even download the extra tools onto the Intel image once I get it booted up.


            My build system is a vmware Ubuntu 12.04 LTS virtual machine. I suspect I can follow your suggestion, and mount the Intel image for modification. If this build ever finishes...


            Thanks again!

            • 3. Re: Resize SD card linux

              Another option if you do not want to be constrained by the size of the loop mounted image (this might also shave off a few seconds from your boot time, because the initramfs is no longer needed and the file system is not loop mounted)


              • Repartition your card to provide 2 partitions

                        -partition 1 doesn't need to be too large - 200MB is more than enough (it only holds the boot/grub/grub.conf and the bzImage kernel image)

                        -partition 2 will hold the root file system

              • Loop mount the image-full-clanton.ext3 and copy its contents to the second partition on the SD card
              • Copy the boot directory (boot/grub/grub.conf) and the kernel image (bzImage) to partition 1
              • Boot using the second option in the grub menu (Clanton SVP kernel-SPI rootfs-SD IMR-On IO-APIC/HPET NoEMU). I am not sure why this says kernel-SPI if it boots using the kernel on the SD.
              • It will run a bit slow the first time you boot because this is when the SSH keys are generated, but after that your boots should be much faster
              • 4. Re: Resize SD card linux



                I used cygwin to do the fsck and the resize2fs. The file size grew on the SD card.


                However, when I boot, root is still the same size as before.


                Filesystem           1K-blocks      Used Available Use% Mounted on

                rootfs                  302183    265578     21245  93% /


                Is there anything else that I need to do here? Here is my config for what its worth:

                     Linux clanton 3.8.7-yocto-standard #1 Fri Jun 6 21:49:26 PDT 2014 i586 GNU/Linux


                many thanks



                • 5. Re: Resize SD card linux

                  same issue as me, I changed it and it still remains the same

                  • 6. Re: Resize SD card linux

                    Just for completeness there actually is a way to make the image bigger with the build script. Inside of your build dir, there is a folder called conf and a file local.conf. Append this to the end to make the image bigger IMAGE_ROOTFS_EXTRA_SPACE = "2000000"

                    • 7. Re: Resize SD card linux

                      Just as a note, since the SD Card is formatted FAT32 the max you can make the .ext3 root file system with resize2fs is 4GB.


                      Cut you can resize the file, then create symbolic links of var/tmp/whatever to /media/mmcblkp0 for more space.