Shrink Rootfs...To Switch Golden Image Media

Hello All!

I would like to move my device image over to some industrial media/better media. The new media is a few bytes smaller, so I will need to:

./docker-mender-convert raw-disk-image-shrink-rootfs

My plan was to resize after, possibly using gparted. Does

./docker-mender-convert raw-disk-image-shrink-rootfs

insert any resize scripts or anything?

If it does not, I assume that resizing via gparted/whatever is good?

You should be able to run,

./docker-mender-convert raw-disk-image-shrink-rootfs \
            --raw-disk-image ${RAW_DISK_IMAGE}

and then use --storage-total-size-mb to set a new size,

./docker-mender-convert from-raw-disk-image                       \
            --raw-disk-image $RAW_DISK_IMAGE                      \
            --storage-total-size-mb 2048

Is that what you are after?

It is nice to know that the a command accepts those switches, and this does help thanks!

What I am asking, is at what stage does mender insert its resize script…the one where it creates /data…and resizes that partition/etc.

Creation of data and resizing partitions is done “offiline” when you run the mender-convert tool and is not a script that is inserted in to the image.

You input a image to mender-convert and output is an “.sdimg” file that has all the necessary modifications.