Increase Raspberry Pi disk size in QEMU.

Muhammad Muizzsuddin
2 min readAug 15, 2020

--

raspberry pi lite in qemu

If you need to do that quickly please refer to this Raspberry Pi forum.

I am learning ARM assembly language. Yay!

But there is an issue. I have no any ARM32 CPU device to practice what I’ve learned so far. I have iPhone 5s and an Android device but those are powered by ARM64 CPU. Which turns out very different.

So here’s my solution to the issue. Fortunately the tutorial shows me to use QEMU and Raspberry Pi to emulate ARM32 device. Thats pretty straightforward.

But at some point, I figured out that the disk provided by default is only 1.5 GB which is very small. I need more room!

`df -h` to check disk usage

Above image is the final result from 1.5G to 7.4G disk size.

To achieve that, here’s the steps:

# inside qemu emulated raspberry pi
# You may need to perform sudo
vim /etc/udev/rules.d/90-qemu.rules

then write this down,

KERNEL=="sda", SYMLINK+="mmcblk0" 
KERNEL=="sda?", SYMLINK+="mmcblk0p%n",

Then save and reboot!

After logged in you need to do this,

sudo raspi-config

and find expand filesystem options like this,

it may be different between raspberry pi version.

Then, allow Raspberry Pi to do the rest.

Then reboot.

Now after logged in you can recheck with df -h .

PS:

I found no issue to follow above rules. So, if you find an issue please refer to the original forum.

https://www.raspberrypi.org/forums/viewtopic.php?t=42279

--

--

No responses yet