Increase the size of the root partition

Hello. I find the size of the root partition (9.5GB to 10GB) on the Uno Q (2GB) and Uno Q (4GB) model too small for installing additional packages and downloading Docker images. I get into no space left on the device issue. How can we increase it ?

I think a better approach is to combine the root partition (/) and the home partition (/home/arduino) into a single partition. Is it possible to build a new Debian image with this configuration ?

Thanks.

Victor

Hi Victor, yeah the root partitions on the Uno Q are pretty small, so hitting space limits is normal. Instead of rebuilding the OS, a simpler fix is to move big stuff like Docker data or user files to an SD card or USB drive. That frees up space without having to make a custom image.

just posted on building slam toolbox on the 4g version: Experiments with Docker and ROS2 Implementation - UNO Family / UNO Q - Arduino Forum

The only concern of have with moving the docker data directories to usb or sd card is it will be slower, impact to developing Apps, and now forcing you to use SBC mode (using a dongle) as opposed to just connecting via usb cable or using it on a robot.

Wondering if one could resize those partitions on your current installs
either using GParted or fdisk or ???

Like shown in:
Resize Root Partition in Linux Without Unmounting

Was just looking out of curiosity on the 4g version.

arduino@arduinoQ4:/$ sudo fdisk -l
[sudo] password for arduino:
Disk /dev/zram0: 1.79 GiB, 1924108288 bytes, 469753 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mmcblk0: 29.12 GiB, 31268536320 bytes, 61071360 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: gpt
Disk identifier: 3F9906B0-5BC7-4B6B-30A1-E80569481AC9

Device             Start      End  Sectors  Size Type
/dev/mmcblk0p1    131072   138239     7168  3.5M unknown
/dev/mmcblk0p2    138240   145407     7168  3.5M unknown
/dev/mmcblk0p3    145408   145663      256  128K unknown
/dev/mmcblk0p4    145664   145919      256  128K unknown
/dev/mmcblk0p5    145920   154111     8192    4M unknown
/dev/mmcblk0p6    154112   162303     8192    4M unknown
/dev/mmcblk0p7    162304   163327     1024  512K unknown
/dev/mmcblk0p8    163328   164351     1024  512K unknown
/dev/mmcblk0p9    164352   165375     1024  512K unknown
/dev/mmcblk0p10   165376   166399     1024  512K unknown
/dev/mmcblk0p11   166400   174591     8192    4M unknown
/dev/mmcblk0p12   174592   182783     8192    4M unknown
/dev/mmcblk0p13   182784   199167    16384    8M unknown
/dev/mmcblk0p14   199168   215551    16384    8M unknown
/dev/mmcblk0p15   215552   217599     2048    1M unknown
/dev/mmcblk0p16   217600   219647     2048    1M unknown
/dev/mmcblk0p17   219648   219655        8    4K unknown
/dev/mmcblk0p18   219656   220679     1024  512K unknown
/dev/mmcblk0p19   220680   221703     1024  512K unknown
/dev/mmcblk0p20   221704   229895     8192    4M unknown
/dev/mmcblk0p21   229896   238087     8192    4M unknown
/dev/mmcblk0p22   238088   303623    65536   32M unknown
/dev/mmcblk0p23   303624   369159    65536   32M unknown
/dev/mmcblk0p24   369160   371207     2048    1M unknown
/dev/mmcblk0p25   371208   373255     2048    1M unknown
/dev/mmcblk0p26   373256   375303     2048    1M unknown
/dev/mmcblk0p27   375304   377351     2048    1M unknown
/dev/mmcblk0p28   377352   377367       16    8K unknown
/dev/mmcblk0p29   377368   381463     4096    2M unknown
/dev/mmcblk0p30   381464   385559     4096    2M unknown
/dev/mmcblk0p31   385560   389655     4096    2M unknown
/dev/mmcblk0p32   389656   393751     4096    2M unknown
/dev/mmcblk0p33   393752   459287    65536   32M unknown
/dev/mmcblk0p34   459288   461335     2048    1M unknown
/dev/mmcblk0p35   461336   463383     2048    1M unknown
/dev/mmcblk0p36   463384   464407     1024  512K unknown
/dev/mmcblk0p37   464408   464663      256  128K unknown
/dev/mmcblk0p38   464664   464919      256  128K unknown
/dev/mmcblk0p39   464920   465175      256  128K unknown
/dev/mmcblk0p40   465176   465431      256  128K unknown
/dev/mmcblk0p41   465432   465559      128   64K unknown
/dev/mmcblk0p42   465560   465687      128   64K unknown
/dev/mmcblk0p43   465688   466711     1024  512K unknown
/dev/mmcblk0p44   466712   728855   262144  128M unknown
/dev/mmcblk0p45   728856   728863        8    4K unknown
/dev/mmcblk0p46   728864   730911     2048    1M unknown
/dev/mmcblk0p47   730912   731423      512  256K unknown
/dev/mmcblk0p48   731424   747807    16384    8M unknown
/dev/mmcblk0p49   747808   814655    66848 32.6M unknown
/dev/mmcblk0p50   814656   814663        8    4K unknown
/dev/mmcblk0p51   814664   816711     2048    1M unknown
/dev/mmcblk0p52   816712   833095    16384    8M unknown
/dev/mmcblk0p53   833096   837191     4096    2M unknown
/dev/mmcblk0p54   837192   968263   131072   64M unknown
/dev/mmcblk0p55   968264   968519      256  128K unknown
/dev/mmcblk0p56   968520   968583       64   32K unknown
/dev/mmcblk0p57   968584   968647       64   32K unknown
/dev/mmcblk0p58   968648   968711       64   32K unknown
/dev/mmcblk0p59   968712   968761       50   25K unknown
/dev/mmcblk0p60   968768   969791     1024  512K unknown
/dev/mmcblk0p61   969792   971839     2048    1M unknown
/dev/mmcblk0p62   971840   972863     1024  512K unknown
/dev/mmcblk0p63   972864   976959     4096    2M unknown
/dev/mmcblk0p64   976960   981055     4096    2M unknown
/dev/mmcblk0p65   981056   985151     4096    2M unknown
/dev/mmcblk0p66   985152   985407      256  128K unknown
/dev/mmcblk0p67   985408  2033983  1048576  512M EFI System
/dev/mmcblk0p68  2033984 22954551 20920568   10G Linux root (ARM-64)
/dev/mmcblk0p69 22954552 61071326 38116775 18.2G Linux root (ARM-64)


Disk /dev/mmcblk0boot0: 4 MiB, 4194304 bytes, 8192 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: gpt
Disk identifier: C06A3861-EA36-C8D9-7AF6-B70905A6E666

Device              Start   End Sectors Size Type
/dev/mmcblk0boot0p1    34    41       8   4K unknown
/dev/mmcblk0boot0p2    42    49       8   4K unknown
/dev/mmcblk0boot0p3    50  8158    8109   4M unknown


Disk /dev/mmcblk0boot1: 4 MiB, 4194304 bytes, 8192 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: gpt
Disk identifier: 98101B32-BBE2-4BF2-A06E-2BB33D000C20

Device              Start   End Sectors Size Type
/dev/mmcblk0boot1p1    34    37       4   2K unknown
/dev/mmcblk0boot1p2    38  8158    8121   4M Microsoft basic data
arduino@arduinoQ4:/$ df -h
Filesystem       Size  Used Avail Use% Mounted on
udev             1.8G     0  1.8G   0% /dev
tmpfs            367M  1.6M  366M   1% /run
/dev/mmcblk0p68  9.8G  8.6G  688M  93% /
tmpfs            1.8G  8.0K  1.8G   1% /dev/shm
efivarfs         128K  2.2K  126K   2% /sys/firmware/efi/efivars
tmpfs            5.0M  8.0K  5.0M   1% /run/lock
tmpfs            1.8G  8.0K  1.8G   1% /tmp
tmpfs            1.0M     0  1.0M   0% /run/credentials/systemd-journald.service
/dev/mmcblk0p69   18G  911M   17G   6% /home/arduino
/dev/mmcblk0p67  488M  119M  369M  25% /boot/efi
tmpfs            367M   48K  367M   1% /run/user/103
tmpfs            1.0M     0  1.0M   0% /run/credentials/getty@tty1.service
tmpfs            1.0M     0  1.0M   0% /run/credentials/serial-getty@ttyMSM0.service

the two filesystems of interested:

Disklabel type: gpt
/dev/mmcblk0p68  2033984 22954551 20920568   10G Linux root (ARM-64)
/dev/mmcblk0p69 22954552 61071326 38116775 18.2G Linux root (ARM-64)

corresponding to

/dev/mmcblk0p68  9.8G  8.6G  688M  93% /
/dev/mmcblk0p69   18G  911M   17G   6% /home/arduino

They also correspond to only systems that have room to do anything.

So theoretically you could do it but not 100% sure the exact process - its late now so not going to try anything - but would be nice if Arduino would set it up. Not sure what it would mean if you try to do a re flash of the board?

Mike

Hi Olivia, yeah moving the Docker data to the /home/arduino partition is one way to go around the space limit of / partition. I've tried moving the Docker data to a micro-SD card and it was very slow pulling a Docker image.

Merlin513:
"The only concern of have with moving the docker data directories to usb or sd card is it will be slower, impact to developing Apps, and now forcing you to use SBC mode (using a dongle) as opposed to just connecting via usb cable or using it on a robot."

I totally agree.

Victor

KurtE

19h

post #4

Wondering if one could resize those partitions on your current installs
either using GParted or fdisk or ???

Like shown in:
Resize Root Partition in Linux Without Unmounting

Although I've managed to resize the / partition using parted, it breaks the Arduino App Lab. It couldn't communicate to the board anymore to update. Maybe, it needs to be reinstalled.

I just flash back the default Debian image.

Yeah, SD cards are usually too slow for Docker. The smoother way is to move Docker’s storage to the board’s larger partition where there’s more space, this avoids slowdowns and keeps everything running smoothly.

Well if anyone wants to try I did copy some instructions:
Arduino-Uno-Q-and-ROS2-Implementation/Docker Ros2 Notes/Migrating Docker Data.md at main · mjs513/Arduino-Uno-Q-and-ROS2-Implementation

You are on the right track! You’ve got the right train of thought, there!

I’ve tried every way i know how to backup the desktop version (not the Apps from the AppLab, but a byte-for-byte copy of the built-in emmc drive of my Arduino Q’s), like you can do in the Gnome Disk utility by ‘creating a disk image’. The reason i want to make a backup (preferably an *.img file) i so that when i destroy my OS (which i have multiple times so far), i dont have to start from literally the beginning.

Has this issue been resolved?

does this work?

No it doesn't. You can't extract eMMC and put it to "another machine".

Yes, and no…

Thank you for this reply. I came across this while Googling, but i keep messing up and getting the exact syntax i need as i cannot literally just backup / as that’s a runaway backup (attempts to backup every drive plugged into it, like my 20TB HDD, e.g. the whole File System folders, including /media and /dev).

after looking at GParted and the Gnome Disks Utility thoroughly, it seems as if i need to specifically back up partitons mmcblk0p68 and mmcblk0p69.

I am just now learning adb also i now understand what PATH is and how to add something to PATH because of your reply, so thank you for that! :slight_smile:

I will work on getting the proper syntax for the situation. making a backup seems very doable.

Also, has anyone figured out how to resize the mounted partitions? in programs such as GParted, in order to resize partitions they need to be unmounted, but by default eMMC is inherently mounted. is there a known workaround for this? Or else, what is the difference between the 2gb and 4gb versions besides just the RAM size? the allotted free space on both is equivalent, as everything installs into /home/arduino …

is there something i am missing?

Me encontré con el mismo problema y esta fue mi solución:
• Descargue la imagen debian con la herramienta cli, modifique las tablas de particiones y flasher para tener desde un inicio ~20gb en /root y ~10gb en /user
1

Este fue el procedimiento (realzado en Windows 11):
Instalaciones necesarias:
• Herramienta CLI de Arduino: https://www.arduino.cc/en/software/

• wsl Windows, maquina virtual de Linux para Windows 11 en mi caso Ubuntu, busque un tutorial de como instalar esto en su Windows 11
Pasos:

  1. Descargar la imagen de debian con cli de Arduino usando el comando: arduino-flasher-cli.exe download latest esto debería descargar un .zip el cual hay que descomprimir

  2. Copiar los archivos en la carpeta /home/[su usuario] del wls instalado

  3. Editar el archivo rawprogram0.xml que se encuentra en /flash de la imagen debian, buscar las etiquetas con el nombre de rootfs, userdata y sustituir las siguientes líneas:

  4. Instalar las herramientas en wsl en mi caso es un Ubuntu: sudo apt update && sudo apt install gdisk -y

  5. Ejecutar los siguientes comandos, estos comandos se deben ejecutar dentro de la carpeta /flash de la imagen de debian:
    dd if=/dev/zero of=emmc.img bs=512 count=67108864
    dd if=gpt_main0.bin of=emmc.img bs=512 conv=notrunc
    dd if=gpt_backup0.bin of=emmc.img bs=512 seek=67108831 conv=notrunc

  6. Buscar las ids de las particiones con el comando: sgdisk -p emmc.img

  7. Eliminar las particiones /root 7 /user
    sgdisk -d 68 emmc.img
    sgdisk -d 69 emmc.img

  8. Crear las nuevas particiones redimensionadas:
    sgdisk -n 68:2033984:43977023 -c 68:"rootfs" -t 68:8300 emmc.img
    sgdisk -n 69:43977024:0 -c 69:"userdata" -t 69:8300 emmc.img

  9. Confirme que todo salio bien con el comando: : sgdisk -p emmc.img

  1. Extraer los binarios:
    dd if=emmc.img of=gpt_main0_nuevo.bin bs=512 count=34
    dd if=emmc.img of=gpt_backup0_nuevo.bin bs=512 skip=67108831 count=33
  2. Remplazar las nuevas tablas de particiones con los siguientes comandos:
    cp gpt_main0_nuevo.bin gpt_main0.bin
    cp gpt_main0_nuevo.bin gpt_main1.bin
    cp gpt_main0_nuevo.bin gpt_main2.bin
    cp gpt_backup0_nuevo.bin gpt_backup0.bin
    cp gpt_backup0_nuevo.bin gpt_backup1.bin
    cp gpt_backup0_nuevo.bin gpt_backup2.bin
  3. Listo ya puede flasher esta imagen modificada usando la herramienta cli con el comando:
    arduino-flasher-cli.exe flash [ruta de la imagen modificada puede usar la ruta wls]

EDIT Thanks to Gemini AI and some side ways thinking full instructions follow make sure to replace partition number in the instruction with the last 2 digits in fdisk m

hi Im running my unoQ with 17gb free space
please forgive spelling im autistic
first create old home partition copy every thing maintaining permissions
make sure linux isnt looking at the old home partition
fstab?
rename the new home folder to home
use fdisk note partition names and sizes delete home
delete root then make a partition the start of root and the end of home

then use "resize??" command to tidy up
doing it this way you loose nothing but might need to delete stuff to make room to preserve any work in home. you can put all that back in your 18gb
i can try to be more detailed if you like i used gemini to tell me exactly what to type in terminal took about twenty min
the great thing is this way you dont lose anything. i tried armbian for the unoQ
that gave me the idea gemini just told me what to type. try programming when you cant type or spell but autistic people can be very determined! it uses gpt so no need to worry about primary partitions
critical you must make sure linux doesnt look for home partition

INSTRUCTIONS
You might need to install some commands

Phase 1: The "Lifeboat" (Data Migration)

​Before deleting anything, you must move your home files to the root partition.

​Create a temporary landing zone:

sudo mkdir /home_new

​Mirror your files (Preserving Permissions):

sudo rsync -avxHAWXS --numeric-ids /home/ /home_new/

​Verify: Make sure your files are in /home_new before proceeding.

​Phase 2: Breaking the Link

​You must tell Linux to stop looking for the separate hardware partition.

​Edit the Paper Trail:

sudo nano /etc/fstab

​The "Kill Switch": Find the line that mentions /home/arduino and put a # at the very start of that line. Save and exit.

​The Swap:

sudo umount /home

sudo mv /home /home_old

sudo mv /home_new /home

​Reboot: Your system is now running entirely off the root partition.

​Phase 3: The Surgical Expansion

​Now you delete the "wall" and stretch the room.

​Open fdisk: sudo fdisk /dev/mmcblk0

​Record the Start: Type p and write down the Start Sector of your root partition (usually partition 24).

​Delete: Type d and delete the old home partition number, then type d and delete the root partition number.

​Recreate: Type n for a new partition.

​Use the same partition number for root.

​Use the exact same Start Sector you wrote down.

​Hit Enter for the end sector to take the whole 20GB.

​Save the Data: When asked if you want to "remove the ext4 signature," Type N (No).

​Write: Type w and exit.

​Phase 4: The Final Stretch

​Tell the filesystem to fill the new space you just created.

​Refresh: sudo partprobe

​Grow: sudo resize2fs /dev/mmcblk0p24 (or your root number).

​Victory: df -h should now show a glorious 19GB+ on your root.

s

The developers are working to add the option for the Arduino Flasher CLI user to configure the size of the root partition when flashing the operating system image to the UNO Q:

Once completed, this feature will be present in the next release of the Arduino Flasher CLI tool.

Thank you!

Hello again @viccab. I wanted to post an update to let you know that the feature I mentioned in my previous reply has now been released in the new version 0.5.3 of Arduino Flasher CLI:

It is currently available for download from the links under the "Assets" section of the release page in the GitHub repository:

It will also be available for download from the "Software" page shortly:

https://www.arduino.cc/en/software/#flasher-tool