I am creating a minimal image for my Raspberry Pi 3b+ with an Preemptive RT Linux Kernel using Yocto Project's warrior branch.

I was able to create a base image for the same (bitbake -k core-image-base) and the Pi boots up well with the PREEMPT RT showing up when executing uname -a.

The image is about ~300MB big on an SD-Card that is 16GB. I wish to expand the SD Card completely in order to use the extra space.


  1. Initially I found that parted isn't available as a binary on the base image hence I used fdisk as follows:

    fdisk -u /dev/mmcblk0

which provides me two partitions mmcblk0p1 and mmcblk0p2

  1. I delete partition 2 and create a new one with the start value as one normally does.

  2. Upon writing the partition (w in fdisk) I get an ioctl Error stating resource is busy

  3. I also do not have resize2fs available on the image. I only have a binary called resize which upon execution does not resize the SD Card even upon reboot.

Is there an alternative solution to resizing for Images creating using Yocto? There are no recipes for raspi-config which makes it difficult to have other tools to expand an SD Card.

1 Answer 1


You cannot resize a mounted image.

The easiest approach would be to resize on another Linux system.

The traditional approach is described in https://raspberrypi.stackexchange.com/a/37744/8697 - this is effectively what raspi-config does, but if you don't have the standard Linux tools you would be out of luck.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.