This topic describes how I resized my user partition in my Modded Homey Pro (Early 2023)
This was necessary (because I wanted ) as the Replaced CM4 Raspberry Pi Compute module I placed had more Flash memory than the Default 8 GB eMMC Flash.
Modding of Homey voids the warranty and can have unforeseen side effects! Be carefully and know What you do.
Bigger Flash storage can (will) have impact on the size and duration of Backup and the Cloud-backend of Homey’s Backup. Other internal processes could have different behavior or still have limitations.
Special Thanks to @robertklep @Sharkys @spkesDE for the hints,
Homey Pro (Early 2023) CM4108032 Mod
I modified my Homey Pro (Early 2023) with a CM4108032 module, just as others described.
In short:
- Order a CM4108032 Raspberry Pi Compute Module 4, BCM2711, ARM Cortex-A72, 8GB RAM, 32GB EMMC with Wifi
- Create a Homey Offline Backup using the USB Tool My devices | Homey
- Open Homey from the bottom 4 screws and carefully un-screw the 4 nut’s to remove the cooling block.
- Carefully lift the old CM4 out of the socket. (I left the blot’s in the cariër print )
- Place the new CM4 and click it in the CM4 socket.
- Restore Homey’s Offline Backup using the USB Tool
- I placed a slight higher CM4 Aluminium Heatsink same as Insert Link here… with new Thermal Pads
- Test Homey Pro … (Homey is running now a couple of days, just to verify that I don’t see side effects.)
It works perfectly, only the feeling is the 11mm Aluminium Heatsink is just ~ 0,5 mm to High, So Home’s Case is still open.
Homey Pro (Early 2023) - Resize User partition
To resize the partition, it can be done from inside Homey’s Linux but we don’t have Access there. (Officially) Therefore I decided that I wanted to resize from the outside.
Robert tipped to use the GitHub - raspberrypi/usbboot: Raspberry Pi USB booting code, moved from tools repository and connect the CM4 as a Mass storage device to modify the partition.
As I am a Windows kid ( ) and didn’t get is to work on my Windows Laptop I decided to use a Raspberry VM. (But don’t trust me on my Linux skills, you are warned.)
Preparing
- Download Raspberry Pi Desktop
- I already had VMware Workstation installed, and created a new VM for Linux, installed default and configured it with a USB 3.1 controller (it was 2.0, don’t know why, it didn’t work)
- Unplugged Homey, laid her upside down and pressed the pin while putting a short USB-c cable from Laptop to Homey. At Orange loading I Released and Connected the Discovered BCM2711 device from Windows to the Raspberry Pi Virtual machine.
As I saw several new devices (auto) mounted I opened the terminal to see what was presented.
Investigation
df show the free space of mounted disk/volumes /dev/sdb* are the Partitions on the CM4’s eMMC Flash (Homey’s filesystems)
It is the /dev/sdb9 device that is now the ~ 2.7 GB user partition
fdisk -l (list) show the partition information of the selected device,
If you would try to extend the sdb9 partition immediately you will get an error about overlapping partitions. So to understand you need to know how the partition is defined.
A standard MBR can have a maximum of 4 partitions, to have more you need extended partitions.
Below graphical in 3 steps from what it was - to what we want: (Size is not in scale)
- The new Disk (Black) is larger and has Free Space on the end,
- First (Dark Grey) AUTOBOOT partition #1
- Second is the #2 (Light Grey) Extended Partition up to the (old) end of the disk
- #5 and #6 are the BOOTA and ROOTA pair.
- #7 and #8 are the BOOTB and ROOTB pair.
- #9 Is the User Partition that needs to be extended.
So Actions:
- first Extend the /dev/sdb2 partition to the end of the disk
- then Extend the /dev/sdb9 partition
- Verify
- Extend the Linux filesystem to make use of all available partitioned space.
- test …
Using parted , it need the device, what to do (resizepart) the partition number and the new end. Lucky it knows that 100% is the end of the disk So no calculation necessary.
Verify
The Extended Partition is resized to ~29.1 GB
Next
That also looks good, 24.6 GB space reserved for /dev/sdb9 aka Userdata
Resizing the Filesystem complained it was mounted so I firest un-mounted and Checked the filesystem.
Then the Check before starting Homey:
Everything looks good, so there She go’s …
After Restarting I got a Update notification as there is a new Firmware for Homey (at this writing only in AATP) so after verifying Homey I immediately installed the update to verify the new Partitioning is not overwritten in updates:
And as you see, also after Updating 22,9 GB free of 24,57 GB
Recap the commands With Comments
in short the commands (SU or SUDO if necessary to execute the privileged commands )
But beware executing just this on a system with other mappings can F*ck-up your system!
# From my Raspberry Desktop 2022-07-01-raspios-bullseye-i386.iso
# Check with df the devices / partitions where Partition USER is. For me it was Device /dev/sdb and USER Partition = 9 so /dev/sdb
> df
# and Check (list) with fdisk -l the partions... same as above. for me partion 2 is the Extended partion! so /dev/sdb2 = Exteded and /dev/sdb9 = USER
> fdisk -l /dev/sdb
# If the filesystem is mounted unmount it (as in my case it was automatically mounted and resize2fs needs it un-mounted)
> umount /media/user/USER
# Extend the Extended partition to 100% with parted resizepart
> parted /dev/sdb resizepart 2 100%
# Extend the EXT4 USER partition 9 to 0 100%
> parted /dev/sdb resizepart 9 100%
# Check the filesystem
> e2fsck -f /dev/sdb9
# I answered NO on changes as I leave it to Homey''s OS to change in case of Issue''s
# Then resize the FS
> resize2fs /dev/sdb9
Additional testing:
- Tested a Firmaware upgrade (See Above): OK
- Tested a (online) Backup of Homey and that also worked OK,
- Reset this Modded Homey Pro (Early 2023) - CM4108032 to Factory Defaults. Still 24.57GB Total Storage!
- I tested Resetting with Restoring an Modded-Backup (Post Resize.) Works OK.
- I tested Resetting with Restoring an Original-Backup (Pre Resize.) Works OK.
Todo:
- …
Edit: Updated 20230603-23u31 with extra Tests.
Edit: Updated 20230604-17u48 with Recap and the actual Commands I used.