How to adjust Mender disk image artifact

Hi am doing new mender artifact image… Am getting error from mender diak image adjust size… I have rawdisk image size 16gb how can I do adjust menderdisk size

Can you pls post command + log. Thanks.

command :
./docker-mender-convert from-raw-disk-image
–raw-disk-image $RAW_DISK_IMAGE
–mender-disk-image $MENDER_DISK_IMAGE
–device-type $DEVICE_TYPE
–artifact-name $ARTIFACT_NAME
–bootloader-toolchain arm-buildroot-linux-gnueabihf
–demo
–demo-host-ip $DEMO_HOST_IP

log file

1/9 re-partitioning raw disk image…
detected raw disk image with 1 partition(s).
adjust Mender disk image size to the total storage size(8000mb)
Defined total storage size of MB is too small
Minimal required storage is 30532MB. aborting

Can you pls try to add option: --storage-total-size-mb 32000 to arguments and try? There is default 8G but looks like your image is pretty big.

where i have to add pls tell me

Similar problem was discussed and resolved here,

–bootloader-toolchain arm-buildroot-linux-gnueabihf command not found , how can i install this bootloader-toolchain

It’s installed by default in docker. Please add this line to arguments:

--bootloader-toolchain arm-buildroot-linux-gnueabihf

Also which version of mender-convert are you using? Thanks.

mender 2.0 version pls help me

I mean mender-convert tool version not mender version itself. Did you rebuild docker recently? Maybe you do update bu forget to run: docker-build

git clone -b 1.1.0 https://github.com/mendersoftware/mender-convert.git

i installed this version

OK then you perform docker build and run command to generate pls share this command

command :
./docker-mender-convert from-raw-disk-image
–raw-disk-image $RAW_DISK_IMAGE
–mender-disk-image $MENDER_DISK_IMAGE
–device-type $DEVICE_TYPE
–artifact-name $ARTIFACT_NAME
–storage-total-size-mb 32000
–bootloader-toolchain arm-buildroot-linux-gnueabihf
–demo
–demo-host-ip $DEMO_HOST_IP

Pls post also log from output directory output/build.log

Mender conversion tool

A tool that takes an existing embedded image (Debian, Ubuntu, Raspbian, etc)
and converts it to a Mender image by restructuring partition table and adding
necessary files.

Usage: ./mender-convert COMMAND [options]

General commands:

    from-raw-disk-image                     - composes fully functional Mender
                                              image compliant with Mender
                                              partition layout, having all
                                              necessary files installed
    mender-disk-image-to-artifact           - creates Mender artifact file
                                              from Mender image
    raw-disk-image-shrink-rootfs            - shrinks existing embedded raw
                                              disk image

Options: [-r|–raw-disk-image | -m|–mender-disk-image | -s|–data-part-size-mb |
-d|–device-type | -p|–rootfs-partition-id | -n|–demo | -i|–demo-host-ip |
-c|–server-cert | -u|–server-url | -t|–tenant-token |
-g|–mender-client | -b|–bootloader-toolchain | -a|–artifact-name |
-e|–storage-total-size-mb | -k|–keep | -v|–version -h|–help]

    raw-disk-image        - raw disk embedded Linux (Debian, Raspbian,
                            Ubuntu, etc.) image path
    mender-disk-image     - Mender disk image name where the script writes to
                            should have "sdimg" suffix
    data-part-size-mb     - data partition size in MB; default value 128MB
    device-type           - target device identification used to build
                            Mender image
    rootfs-partition-id   - selects root filesystem (primary|secondary)
                            as the source filesystem for an artifact
    demo                  - Configure image using demo parameters
    demo-host-ip          - server demo ip used for testing purposes
    server-cert           - server certificate file
    server-url            - production server url
    tenant-token          - Mender tenant token
    mender-client         - Mender client binary
    bootloader-toolchain  - GNU Arm Embedded Toolchain
    artifact-name         - Mender artifact name
    storage-total-size-mb - total storage size in MB; default value 8000MB;
                            it is used to calculate the rootfs final size
    keep                  - keep intermediate files in output directory
    version               - print the version
    help                  - show help and exit

Examples:

To create fully functional Mender image from raw disk image in a single step:

    ./mender-convert from-raw-disk-image
            --raw-disk-image <raw_disk_image_path>
            [--mender-disk-image <mender_image_name>]
            --device-type <beaglebone | raspberrypi3>
            [--mender-client <mender_binary_path>]
            --artifact-name release-1_1.5.0
            --bootloader-toolchain arm-linux-gnueabihf
            --demo-host-ip 192.168.10.2
            --keep

    Output:
        - Mender image: ready to use image with client and bootloader installed
        - Mender artifact: update file based on the already built Mender image
        - Mender root filesystem: EXT4 image used to produce the Mender artifact

To create Mender artifact file from Mender image:

    ./mender-convert mender-disk-image-to-artifact
            --mender-disk-image <mender_image_path>
            --device-type <beaglebone | raspberrypi3>
            --artifact-name release-1_1.5.0
            --rootfs-partition-id <primary | secondary>

    Note: artifact name format is: release-<release_no>_<mender_version>

To shrink the existing embedded raw disk image:

    ./mender-convert raw-disk-image-shrink-rootfs
            --raw-disk-image <raw_disk_image_path>

    Output: Root filesystem size (sectors): 4521984

Check /mender-convert/output/build.log for details.

This is output from: output/build.log ?

yes this is build.log file …

You have typo in arguments thus it print this. Pls try to use below (with necessary modifications -> this on build fine image for rpi0w):

#!/bin/sh

DEVICE_TYPE="raspberrypi0w"
RAW_DISK_IMAGE="input/2018-11-13-raspbian-stretch-lite.img"

ARTIFACT_NAME="2018-11-13-raspbian-stretch-lite"
MENDER_DISK_IMAGE="2018-11-13-raspbian-stretch-lite.sdimg"
TENANT_TOKEN="1234"

./docker-mender-convert from-raw-disk-image                 \
        --raw-disk-image $RAW_DISK_IMAGE                \
        --mender-disk-image $MENDER_DISK_IMAGE          \
        --device-type $DEVICE_TYPE                      \
        --artifact-name $ARTIFACT_NAME                  \
        --bootloader-toolchain arm-buildroot-linux-gnueabihf    \
        --server-url "https://hosted.mender.io"         \
        --tenant-token $TENANT_TOKEN \
        --storage-total-size-mb 4000

command :
./docker-mender-convert from-raw-disk-image
–raw-disk-image $RAW_DISK_IMAGE
–mender-disk-image $MENDER_DISK_IMAGE
–device-type $DEVICE_TYPE
–artifact-name $ARTIFACT_NAME
–bootloader-toolchain arm-buildroot-linux-gnueabihf
–demo
–demo-host-ip $DEMO_HOST_IP

log file

1/9 re-partitioning raw disk image…
detected raw disk image with 1 partition(s).
adjust Mender disk image size to the total storage size(8000mb)
Defined total storage size of MB is too small
Minimal required storage is 30532MB. aborting

command :
./docker-mender-convert from-raw-disk-image
–raw-disk-image $RAW_DISK_IMAGE
–mender-disk-image $MENDER_DISK_IMAGE
–device-type $DEVICE_TYPE
–artifact-name $ARTIFACT_NAME
–bootloader-toolchain arm-buildroot-linux-gnueabihf
–demo
–demo-host-ip $DEMO_HOST_IP

log file

1/9 re-partitioning raw disk image…
detected raw disk image with 1 partition(s).
adjust Mender disk image size to the total storage size(8000mb)
Defined total storage size of MB is too small
Minimal required storage is 30532MB. aborting