Skip to content

Auto Expand Root #152

@jlpoolen

Description

@jlpoolen

I downloaded the Raspberry Pi 4B, 3B/B+ 64-bit Lite Version alpha9 (576Kb) posted on the project page gentoo-on-rpi-64bit. I installed the extracted image, genpi64-arm64-openrc-lite-alpha9.img (4,349 KB), on a SanDisk 64GB SDHC. I've been working with several Raspberry Pi builds and had become lulled into the expectation that when I burned an image onto a SDHC, the operating system would on the first run expand to consume the extra disk space.

Here's what is on my system:

GenPi64 /usr/local/src/gstreamer # ls /dev
ashmem           fd         loop2         net    ram4            snd     tty19  tty33  tty48  tty62      vcs1    vcsa12    vcsu3        video15
autofs           full       loop3         null   ram5            stderr  tty2   tty34  tty49  tty63      vcs10   vcsa2     vcsu4        video16
block            fuse       loop4         port   ram6            stdin   tty20  tty35  tty5   tty7       vcs11   vcsa3     vcsu5        video18
btrfs-control    gpiochip0  loop5         ppp    ram7            stdout  tty21  tty36  tty50  tty8       vcs12   vcsa4     vcsu6        video20
bus              gpiochip1  loop6         ptmx   ram8            tty     tty22  tty37  tty51  tty9       vcs2    vcsa5     vcsu7        video21
cachefiles       gpiomem    loop7         pts    ram9            tty0    tty23  tty38  tty52  ttyAMA0    vcs3    vcsa6     vcsu8        video22
cec0             hidraw0    loop-control  ram0   random          tty1    tty24  tty39  tty53  ttyprintk  vcs4    vcsa7     vcsu9        video23
cec1             hidraw1    mapper        ram1   raw             tty10   tty25  tty4   tty54  ttyS0      vcs5    vcsa8     vga_arbiter  watchdog
char             hidraw2    media0        ram10  rfkill          tty11   tty26  tty40  tty55  uhid       vcs6    vcsa9     vhci         watchdog0
console          hwrng      media1        ram11  rpivid-h264mem  tty12   tty27  tty41  tty56  uinput     vcs7    vcsm-cma  vhost-net    zero
cpu_dma_latency  input      media2        ram12  rpivid-hevcmem  tty13   tty28  tty42  tty57  urandom    vcs8    vcsu      vhost-vsock
cuse             kmsg       mem           ram13  rpivid-intcmem  tty14   tty29  tty43  tty58  v4l        vcs9    vcsu1     video10
disk             kvm        mmcblk0       ram14  rpivid-vp9mem   tty15   tty3   tty44  tty59  vchiq      vcsa    vcsu10    video11
dma_heap         log        mmcblk0p1     ram15  serial0         tty16   tty30  tty45  tty6   vcio       vcsa1   vcsu11    video12
dri              loop0      mmcblk0p2     ram2   serial1         tty17   tty31  tty46  tty60  vc-mem     vcsa10  vcsu12    video13
fb0              loop1      mqueue        ram3   shm             tty18   tty32  tty47  tty61  vcs        vcsa11  vcsu2     video14
GenPi64 /

In my case, fdisk tells me partition 2 is consuming 59.2 GB:

GenPi64 /usr/local/src/gstreamer # fdisk -l /dev/mmcblk0
Disk /dev/mmcblk0: 59.48 GiB, 63864569856 bytes, 124735488 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xdd08d348

Device         Boot  Start       End   Sectors  Size Id Type
/dev/mmcblk0p1 *      2048    524287    522240  255M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      524288 124735487 124211200 59.2G 83 Linux
GenPi64 /usr/local/src/gstreamer #

Yet, df tells a different story:

GenPi64 /usr/local/src/gstreamer # df -lh
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p2  3.9G  3.5G  528K 100% /
devtmpfs         10M     0   10M   0% /dev
tmpfs           1.6G  760K  1.6G   1% /run
cgroup_root      10M     0   10M   0% /sys/fs/cgroup
shm             3.9G     0  3.9G   0% /dev/shm
/dev/mmcblk0p1  255M   70M  186M  28% /boot
tmpfs           782M     0  782M   0% /run/user/0
tmpfs           782M     0  782M   0% /run/user/1001
GenPi64 /usr/local/src/gstreamer #

In discussion with @jonesmz on Discord, he indicated /boot/autoexpand_root.sh "needs to be moved into the initramfs"

In my glee about having Gentoo working on the Rapsberry Pi Zero 2 W, I raced towards getting gstreamer compiled only to discover I had a 4 GB memory limitation and my build stopped at task 2587 of the 6226 needed:

 ../subprojects/gst-plugins-bad/gst/dvdspu/gstspu-vobsub.c:524:1: fatal error: error writing to /tmp/ccvKHYmt.s: No space left on device
  524 | }
      | ^
compilation terminated.
[2587/6226] 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions