RPI Image not utilizing all available space
So I was doing my round of updating all my Linux boxes and I was having quite a bit of trouble from the modbro-raspberry pi. Constantly disconnecting my SSH sessions, extremely slow input lag.
I didn't check free diskspace at first. No, my first step was to create a swapfile, because the RPI was really slow and unresponsive and I thought it was having memory issues.
I couldn't even create a 1GB swapfile, because the disk was full.
Upon checking, I found this:
Filesystem Size Used Avail Use% Mounted on
/dev/root 2.7G 2.7G 0 100% /
devtmpfs 459M 0 459M 0% /dev
tmpfs 464M 4.2M 459M 1% /dev/shm
tmpfs 464M 6.2M 457M 2% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 464M 0 464M 0% /sys/fs/cgroup
none 10M 196K 9.9M 2% /var/log
/dev/mmcblk0p1 253M 53M 200M 21% /boot
tmpfs 93M 0 93M 0% /run/user/1001
This not being my first RPI, I knew what to do, but it would be nice if the Modbro setup would go through this automatically.
What you need to do, is run “sudo raspi-config”, go to "Advanced Options" and select “Expand Filesystem”.
I had to do this twice in a row, because the first attempt threw an error (lack of diskspace), the 2nd time it did work.
After rebooting my RPI, the entire memorycard was finally being used (check the root size):
Filesystem Size Used Avail Use% Mounted on
/dev/root 15G 3.9G 10G 28% /
devtmpfs 459M 0 459M 0% /dev
tmpfs 464M 6.2M 457M 2% /dev/shm
none 10M 0 10M 0% /run
tmpfs 464M 0 464M 0% /sys/fs/cgroup
none 10M 200K 9.9M 2% /var/log
/dev/mmcblk0p1 253M 53M 200M 21% /boot
After this step, the performance and responsiveness improved drastically (obviously).
This can easily be automated by running a single command “raspi-config --expand-rootfs”, followed by a reboot.
Hi @Bobtb
thanks for bringing this up. Totally forgot that we did shrink the image to 3GB ?
Did you install any additional software on it or did it completely fill up just by itself running MoBro?
If added this to the backlog for the next version.
We'll just expand the filesystem on the first boot like you mentioned.
I just noticed I posted this in the wrong forum (Android), my bad!
To answer your question, I did not install any additional software on the RPI. It filled up all by itself.
Don't worry, it's already moved ;)
Good to know. For the next version we're going to switch to mounting the filesystem read-only to reduce wear on the SD card and avoid corruption.
So I guess this shouldn't be an issue going forward anyways.