Download image of the SD card
Here, you find the image of an SD card for the Raspberry Pi Zero. It only works for the Pi Zero. If you want to create a MQTT broker for another platform, you have to download the normal OS and then apply Peters script
- If you have a other Linux system with a graphical interface, you can install gparted and mount your newly created SD card with the (too small) image into a USB card reader and the card reader into your running Raspberry.
- You have to enter your password twice
- You start gparted and search for your SD card. Then, with the right mouse, you resize/move your ext4 file system. Enter zero in the field “free space following) and hit “resize/move”
- Then, you apply all operations.
Complex way (all commands in bold)
- Mount your newly created SD card with the (too small) image into a USB card reader and the card reader into your running Raspberry.
- Sudo fdisk -l shows you the name of this device (usually /dev/sda). It has two partitions, SDA1 and SDA2. And SDA2 is very small
- Sudo umount /dev/sda (usually, it is not mounted)
- Sudo parted /dev/sda
- The numbers in red show the max number of cylinders, heads, and sectors of your SD card (actually, all numbers are too big). The yellow shows the actual beginning of your second partition
- Now, we have to remove the boundaries of the second partition: sudo rm 2
- And create new boundaries: mkpart primary 8,138,2 1963,254,62. We use the two numbers from before and subtract at least 1 from each (red number). You might get the error message “…is outside of the device /dev/sda”. Then, just experiment till your values are accepted (I found no better way)
- Now we quit the utility
- Next, we have to clean the newly created partition: sudo e2fsck -f /dev/sda2
- And resize the partition: sudo resize2fs /dev/sda2
- If we look at our partitions (sudo fdisk -l), we see, that the partition is bigger than before
This is the way it worked for me. No guarantee, that it works for you! I am a Linux beginner.