Uploaded image for project: 'Mender'
  1. Mender
  2. MEN-2254

mender-convert: Data partition is not automatically expanded



    • Type: Bug
    • Status: Done
    • Priority: (None)
    • Resolution: Fixed
    • Affects Version/s: 1.7.0
    • Fix Version/s: None
    • Labels:
    • Environment:
      Raspbian Stretch Lite 4.14 (2018-11-13)


      Currently when using mender-convert the data partition is not expanded automatically to fill the SD card. The custom init_resize.sh is run on initial boot, but it only seems to resize the partition. Filesystem itself is not resized. Tested with Raspbian Stretch Lite.

      Problem can be fixed by running resize2fs manually. 

      $ sudo resize2fs /dev/mmcblk0p4

       As a sidenote, the original init_resize.sh script from raspi-config resizes the filesystem via a self destructing init script after the root partition is enlarged.


      Steps to reproduce.

      Download the Raspbian Stretch Lite image and run it through mender-convert.

      $ ./mender-convert from-raw-disk-image \
      --raw-disk-image /home/tuupola/2018-11-13-raspbian-stretch-lite.img \
      --mender-disk-image 2018-11-13-raspbian-stretch-lite.sdimg \
      --device-type raspberrypi3 \
      --mender-client /home/tuupola/go/src/github.com/mendersoftware/mender/mender \
      --artifact-name 2018-11-13-raspbian-stretch-lite-1 \
      --bootloader-toolchain arm-linux-gnueabihf \
      --tenant-token xxx \

      Write the result to SD card.

      $ sudo dd if=2018-11-13-raspbian-stretch-lite.sdimg of=/dev/disk2
      $ sudo sync
      $ diskutil unmountDisk /dev/disk2

      Boot up Raspberry with the SD card. Partition is enlarged but filesystem is not.

      $ sudo fdisk -l /dev/mmcblk0p4
      Disk /dev/mmcblk0p4: 3.9 GiB, 4170186752 bytes, 8144896 sectors
      Units: sectors of 1 * 512 = 512 bytes
      Sector size (logical/physical): 512 bytes / 512 bytes
      I/O size (minimum/optimal): 512 bytes / 512 bytes
      $ df -h /data
      Filesystem Size Used Avail Use% Mounted on
      /dev/mmcblk0p4 120M 1.6M 110M 2% /data


      Manually running resize2fs fixes the problem.

      $ sudo resize2fs /dev/mmcblk0p4
      resize2fs 1.43.4 (31-Jan-2017)
      Filesystem at /dev/mmcblk0p4 is mounted on /data; on-line resizing required
      old_desc_blocks = 1, new_desc_blocks = 32
      The filesystem on /dev/mmcblk0p4 is now 4072448 (1k) blocks long.
      $ df -h /data
      Filesystem Size Used Avail Use% Mounted on
      /dev/mmcblk0p4 3.8G 2.9M 3.6G 1% /data





            • Assignee:
              apodogrocki Adam Podogrocki
              tuupola Mika Tuupola
            • Votes:
              0 Vote for this issue
              5 Start watching this issue


              • Created:

                Zendesk Support