Big HDD installation

Hi! I’ve been enjoying DietPi for a few years now and this time when my SD card got corrupted again - I decided to stop using cards. I’ve flashed the DietPi image on the 4TB USB HDD and booted my RPI4. Everything is nice but I can’t expand the root partition - it is limited by MBR.

The size of this disk is 3.7 TiB (4000752599040 bytes). DOS partition table format cannot be used on drives for volumes larger than 2199023255040 bytes for 512-byte sectors. Use GUID partition table format (GPT).

So how do I fix this? Is there a GPT boot image? Will it boot on RPI4?
Thanks a lot!

probably something you can answer :slight_smile:

AFAIK the Raspberry Pi bootloader does not support GPT partition tables to boot from, but I can check back. We don’t have a GPT image anyway. Interesting point with the size limitation, never saw this :thinking:.

EDIT: True, 2 TiB limit with 512 bytes sector size.

EDIT2: And Raspberry Pi requires the boot partition on an MBR partition table indeed, so there is no solution:
The first part of the answer was only true in the first months after RPi4 release, in the meantime it can boot from USB.

Thanks for the info. I guess I’ll have to use the card for boot partition. Can it be safely set as read only?

Not when you want to use dietpi-config, dietpi-software or do kernel upgrades. Many config files are located there.

for the RootFS there are ways to have it as r/o but BootFS could be challenging :thinking:

Could it be done this way:
Boot partition is mounted RO
User runs a config utility
Boot partition is re-mounted RW
User exits a config utility
Boot partition is re-mounted RO

But what is the reason for the R/O mount then? Note that only root user has write access anyway, so no reason to worry for accidents when using a regular login user.

I believe it could help with sd card corruption. Is it?

Well you could use a small USB stick for bootFS.

Filesystem corruption happens during disk writes, not because of a mount flag. So no, as long as you do not manually induce writes, significantly only done during kernel upgrades, having the boot partition R/O mounted won’t reduce the chance for corruption. For the root partition it is true, since it has many directories where various users have write access to and systemd units + cron jobs that do regular writes.