Resizing Boot Partition for More Storage (Raspberry Pi)

Hey there folks, I’ve installed Rocky Linux 9 on my 64GB SD card, Raspberry Pi 3B+. The installation went fine but the filesystem is not fully utilizing the space available from the SD card, so I can’t install docker due to insufficient space.

The code below is just showing that I can’t install docker due to insufficient space.

[rocky@localhost ~]$ sudo dnf -y install docker-ce docker-ce-cli containerd.io docker-compose-plugin
[sudo] password for rocky:
Last metadata expiration check: 1:45:14 ago on Tue 26 Dec 2023 05:58:11 AM UTC.
Dependencies resolved.
========================================================================================================================
 Package                              Architecture       Version                      Repository                   Size
========================================================================================================================
Installing:
 containerd.io                        aarch64            1.6.26-3.1.el9               docker-ce-stable             26 M
 docker-ce                            aarch64            3:24.0.7-1.el9               docker-ce-stable             15 M
 docker-ce-cli                        aarch64            1:24.0.7-1.el9               docker-ce-stable            6.5 M
 docker-compose-plugin                aarch64            2.21.0-1.el9                 docker-ce-stable             11 M
Installing dependencies:
 container-selinux                    noarch             3:2.221.0-1.el9              appstream                    55 k
 fuse-overlayfs                       aarch64            1.12-1.el9                   appstream                    63 k
 fuse3                                aarch64            3.10.2-6.el9                 appstream                    52 k
 fuse3-libs                           aarch64            3.10.2-6.el9                 appstream                    88 k
 libslirp                             aarch64            4.4.0-7.el9                  appstream                    68 k
 slirp4netns                          aarch64            1.2.1-1.el9                  appstream                    46 k
 tar                                  aarch64            2:1.34-6.el9_1               baseos                      865 k
Installing weak dependencies:
 docker-buildx-plugin                 aarch64            0.11.2-1.el9                 docker-ce-stable             11 M
 docker-ce-rootless-extras            aarch64            24.0.7-1.el9                 docker-ce-stable            3.6 M

Transaction Summary
========================================================================================================================
Install  13 Packages

Total size: 75 M
Installed size: 318 M
Downloading Packages:
[SKIPPED] containerd.io-1.6.26-3.1.el9.aarch64.rpm: Already downloaded
[SKIPPED] docker-buildx-plugin-0.11.2-1.el9.aarch64.rpm: Already downloaded
[SKIPPED] docker-ce-24.0.7-1.el9.aarch64.rpm: Already downloaded
[SKIPPED] docker-ce-cli-24.0.7-1.el9.aarch64.rpm: Already downloaded
[SKIPPED] docker-ce-rootless-extras-24.0.7-1.el9.aarch64.rpm: Already downloaded
[SKIPPED] docker-compose-plugin-2.21.0-1.el9.aarch64.rpm: Already downloaded
[SKIPPED] tar-1.34-6.el9_1.aarch64.rpm: Already downloaded
[SKIPPED] container-selinux-2.221.0-1.el9.noarch.rpm: Already downloaded
[SKIPPED] fuse3-libs-3.10.2-6.el9.aarch64.rpm: Already downloaded
[SKIPPED] fuse3-3.10.2-6.el9.aarch64.rpm: Already downloaded
[SKIPPED] fuse-overlayfs-1.12-1.el9.aarch64.rpm: Already downloaded
[SKIPPED] slirp4netns-1.2.1-1.el9.aarch64.rpm: Already downloaded
[SKIPPED] libslirp-4.4.0-7.el9.aarch64.rpm: Already downloaded
Running transaction check
Transaction check succeeded.
Running transaction test
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: Transaction test error:
  installing package docker-buildx-plugin-0:0.11.2-1.el9.aarch64 needs 26MB more space on the / filesystem
  installing package docker-ce-cli-1:24.0.7-1.el9.aarch64 needs 56MB more space on the / filesystem
  installing package docker-ce-rootless-extras-0:24.0.7-1.el9.aarch64 needs 71MB more space on the / filesystem
  installing package docker-ce-3:24.0.7-1.el9.aarch64 needs 140MB more space on the / filesystem

Error Summary
-------------
Disk Requirements:
   At least 140MB more space needed on the / filesystem.

After that, I went to check the storage available using df -lh and noticed that the / and /boot directories are so small. Below is the output of df -lh.

[rocky@localhost ~]$ df -lh
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       2.5G  2.3G  197M  93% /
devtmpfs        421M     0  421M   0% /dev
tmpfs           455M     0  455M   0% /dev/shm
tmpfs           182M  3.4M  179M   2% /run
/dev/mmcblk0p1  286M  141M  146M  50% /boot
tmpfs            91M  4.0K   91M   1% /run/user/1000

I tried googling the answer and I eventually got into this ask ubuntu post, but this is not that answer that I’m looking for because what I really wanted to do is just resizing the SD card to get more space from the same SD card. Your help would be appreciated, thanks in advance. :saluting_face:

Not sure if this is helping but I’m just gonna share my neofetch here.

[rocky@localhost ~]$ neofetch
        #####           rocky@localhost
       #######          ---------------
       ##O#O##          OS: Rocky Linux 9.3 (Blue Onyx) aarch64
       #######          Host: Raspberry Pi 3 Model B Plus Rev 1.3
     ###########        Kernel: 6.1.31-v8.1.el9.altarch
    #############       Uptime: 2 days, 21 hours, 29 mins
   ###############      Packages: 572 (rpm)
   ################     Shell: bash 5.1.8
  #################     Terminal: /dev/pts/0
#####################   CPU: BCM2835 (4) @ 1.400GHz
#####################   Memory: 125MiB / 909MiB
  #################
[rocky@localhost ~]$

There should be a rootfs-expand command, so just run that.

See here or /home/rocky/README.

Just ran sudo rootfs-expand and everything has worked as expected. Thank you so much.

[rocky@localhost ~]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        58G  2.3G   56G   4% /
devtmpfs        421M     0  421M   0% /dev
tmpfs           455M     0  455M   0% /dev/shm
tmpfs           182M  3.4M  179M   2% /run
/dev/mmcblk0p1  286M  141M  146M  50% /boot
tmpfs            91M  4.0K   91M   1% /run/user/1000

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.