[HowTo][Modding] Homey Pro (Early 2023) - Resize user Partition on eMMC

This topic describes how I resized my user partition in my Modded Homey Pro (Early 2023)
This was necessary (because I wanted :wink: ) 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
    image
  • 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 ( :joy: ) 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)
image

  • 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 :wink: 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 :heart_eyes:

Recap the commands With Comments

in short the commands (SU or SUDO if necessary to execute the privileged commands :wink: )

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:

  • :white_check_mark: Tested a Firmaware upgrade (See Above): OK
  • :white_check_mark: Tested a (online) Backup of Homey and that also worked OK,
  • :white_check_mark: Reset this Modded Homey Pro (Early 2023) - CM4108032 to Factory Defaults. Still 24.57GB Total Storage!
  • :white_check_mark: I tested Resetting with Restoring an Modded-Backup (Post Resize.) Works OK.
  • :white_check_mark: 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.

13 Likes

My Total and Free space according to sysInternals before and after Resizing.

4 Likes

Todo: See what happens after you update Homey (suggestion) :wink:

Just ordered a CM410832 too :+1:

1 Like

Cograts :slight_smile:
Have you tested also USB backup ?

Already Updated from rc111 to rc112

1 Like

Not yet, good point.

Wow, really nice! Is the backup option (read from USB) Also working until 100%?

Many thanks for sharing!

Ps. The CM4008032 (as described) will not work in homey as far as I know. You need the WiFi option if I am right!

Edit; if the backup reading will get stuck between 90-100%, it is possible to try to rename the swap file and restore that. But… when 8-32 GB storage is unused. That will not be a problem. But if we include that storage to the user partition, it can be a problem :smiling_face:

1 Like

Sorry, typo in the late evening, you are right, it needs to be a CM4108032 ( so 41 as with wifi and ending 008 or higer for the eMMC Flash)

2 Likes

can this also be done before restoring homey’s back up on it? so first this part and that the homey part

and firmware for AATP??? never heard of :rofl:

Like here

1 Like

Probably not as the restore is a restore of a disk with partitions afaik. The new CM4 didn’t have these partitions afaik.

1 Like

Any tips where to buy the:

CM4108032 Raspberry Pi Compute Module 4, BCM2711, ARM Cortex-A72, 8GB RAM, 32GB EMMC with Wifi?

https://www.google.com/search?q=CM4108032&tbm=shop

Always check that you order the correct model (and not one Without WiFi , with Less RAM or with Less Flash)
And I guess not many people can say: This shop/supplier is both Fast, Cheap and trustworthy.

Mine was send ~15 days after order (Therefore not recommended by me now. ) … and I received it ~31 days after placing order. (14 days from China, That’s OK.) and had to pay 9,51€ for Import-Handling-cost (No 3,21 Tax was requested :joy: + 6€ for PostNL )

Now (today) it is in same shop Same part is 130 Euro higher than what I payed and they want 6 euro extra for sending.

1 Like

Thanks! But i think i will wait till the prices drop.
Very expensive at this moment or not in stock.

Edit: Updated 20230603-23u31 with extra Tests.

5 Likes

Really nice and looking forward to try this om my homey too!

3 questions;

  1. Is there an easy way to make a backup/restore on this way too? (With a computer). Not talking about the default USB<>website tool because this is never completing successfully and my homey is in ‘production’ :smiling_face:. Maybe an ‘read to ISO’ or ‘read to IMG’ option?
  2. Is this also possible on MacOS?
  3. Is it possible to make a list of the exact commands you use to complete the operation? For me Linux is something I use only for my 3D printers :see_no_evil:

Many thanks for help and this great mod!!

Like to see this also :pray:

I guess not,
You ask easy… Athom made it easy with the website but is depending on 100s of different os installations wit different drivers. If you want it done using tooling it is still depending on that os and the installed driver’s.

You also need to restart Homey connecting it to a
PC so in my opinion this is just disaster recovery.
If it doesn’t finish because if issues on your pc you probably need to fix it on your pc. (Alreadytried another PC?)

For normal backups You probably are better off with the cloud backup.

1 Like

Probably Yes,

  1. VMware Workstation is on a mac VMware fusion. So i guess you would be able to run the Raspberry Desktop in a VM like I did.
  2. afaik macOS is also a sort of linux, so find the correct drivers and figure out the device names it gets on MacOS to execute the above commands to extend the partitions and filesystem.

Just like a Fiat Panda is a “sort of Tesla” just because they are both cars :stuck_out_tongue:

4 Likes