Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Supporting Larger Drives (GPT) #755

Open
Technologyman00 opened this issue Dec 16, 2023 · 16 comments
Open

[FEATURE] Supporting Larger Drives (GPT) #755

Technologyman00 opened this issue Dec 16, 2023 · 16 comments
Labels
enhancement New feature or request

Comments

@Technologyman00
Copy link

Is your feature request related to a problem? Please describe.
Building a gpt file system is a frustrating task for drives that are larger than 2TB

Describe the solution you'd like
I'd love to see rpi imager create a gpt partition tables to support larger 2TB partitions

Describe alternatives you've considered
One can build the partitions themselves but it's difficult or impossible without a Linux environment

Additional context
It's possible to boot a pi with GPT partition table
https://forums.raspberrypi.com/viewtopic.php?t=319435

@Technologyman00 Technologyman00 added the enhancement New feature or request label Dec 16, 2023
@maxnet
Copy link
Collaborator

maxnet commented Dec 16, 2023

May need more than just GPT to make large drives work.
E.g. chances are your drive has 4k sectors, which boot firmware.may not like.
#505 (comment)

@Technologyman00
Copy link
Author

My drives don't have 4k sectors. I'm just tired of doing it manually every time

@lurch
Copy link
Contributor

lurch commented Dec 17, 2023

RPi Imager simply copies whatever's in your disk-image-file directly onto your SD-card / HardDrive. So if your disk-image contains MBR partitions, then you'll get MBR partitions on your HardDrvie. If you want your HardDrive to use GPT partitions, then you need to ensure that your disk-image contains GPT partitions. I.e. the decision whether to use MBR or GPT isn't anything to do with Raspberry Pi Imager.

pi-gen is the tool that's used to build the Raspberry Pi OS images, and it creates MBR partitions for maximum compatibility. Perhaps you could patch pi-gen to create disk-images using GPT partitions instead?

impossible without a Linux environment

If you don't have a Linux environment, I guess an easy workaround is to boot your Raspberry Pi from SD-card, use that to setup the GPT partitions on your HardDrive, then remove the SD-card and reboot.

@maxnet
Copy link
Collaborator

maxnet commented Dec 17, 2023

If you want your HardDrive to use GPT partitions, then you need to ensure that your disk-image contains GPT partitions

Things are not always that simple...

The GPT backup table lives at end of drive... (That's why Imager already also zeroes out end of drive before write).
So certainly it would need help from Imager if we want standard compliant GPT support.
The only way someone could create a GPT disk image right now, that includes the backup GPT table as well, would be if the person creating the disk image is using the exact same size disk as the user.

But I still think it is a moot point to implement, as long as boot firmware is not properly rewritten first to support 4k sectors first.
There may be large disks out there that still use 512 byte sectors as the TS mentioned. But the ones I have are 4k, and useless with Pi.
And hard to explain to end-users that we would only support some large disks. With no easy way for them to tell which one they have, that is going to lead to support questions.

@lurch
Copy link
Contributor

lurch commented Dec 17, 2023

The GPT backup table lives at end of drive... (That's why Imager already also zeroes out end of drive before write).
So certainly it would need help from Imager if we want standard compliant GPT support

Ah good point, I'd forgotten about that! 😆

@guru
Copy link

guru commented Jan 9, 2024

Signal boosting this as I'm running a 4TB NVMe drive through the RPi 5 PCIe, and can only use 2TB as a boot drive using Imager. There doesn't seem to be any low-friction path for making anything larger than a 2TB a boot drive and using all the capacity. Sad Panda.

@Technologyman00
Copy link
Author

Technologyman00 commented Jan 10, 2024

@guru this is mostly because pi images come with a MBR partition table when you need GPT for higher than 2 TB. You also may run into block size issues for some larger drives. You can also try this, it's the easiest possible way https://forums.raspberrypi.com/viewtopic.php?f=29&t=196778

@guru
Copy link

guru commented Jan 10, 2024

@Technologyman00 Thanks. Already went there and usb-boot rejected nvme* device as an invalid target. I got a solution for now, and it's only 20 simple steps ;)

As I say, signal boosting for a low-friction GPT (or glob forbid Hybrid) image available via Imager for a brighter future.

@geerlingguy
Copy link

Agreed here — I've been getting emails from people buying NVMe HATs and trying to use 4 TB (or even 8 TB!) drives with the Pi 5, and running into the 2 TB size limit.

Outside of those intimately familiar with Linux, I would never recommend someone try messing with partitions, so there's effectively no simple way to use drives larger than 2TB on the Pi 5 right now for boot.

As mentioned above, there are a few tweaks that would be required for Imager, but whatever internal process is used at Pi Towers to generate the OS images would also need to be changed to support GPT (not sure where an issue for that would need to be created).

@maxnet
Copy link
Collaborator

maxnet commented Jan 15, 2024

As mentioned above, there are a few tweaks that would be required for Imager, but whatever internal process is used at
Pi Towers to generate the OS images would also need to be changed to support GPT (not sure where an issue for that
would need to be created).

Technically, Imager could also add the GPT automagically on large disks, and it could work if the OS has an initramfs and is referring to its partitions by ext4 UUID. (PARTUUID would not do).

Problem that it will only work with 512 byte drives and not 4K sector drives would still exists though.
That would need love from firmware folks to fix...

@guru
Copy link

guru commented Jan 15, 2024

Technically, Imager could also add the GPT automagically on large disks, and it could work if the OS is referring to its partitions by ext4 UUID.

This would be a big step forward. Getting a 4TB to work was a case of: partitioning via GPT, copying over the OS to each partition, updating the PARTUUIDs in the bootfs cmdline and rootfs fstab.

@lurch
Copy link
Contributor

lurch commented Jan 15, 2024

Interestingly, https://www.google.com/search?q=nvme+4K+sector suggests that some SSDs can be switched between 512 byte sectors and 4KB sectors - I never knew that!

@Technologyman00
Copy link
Author

I sent a message through the contact us on the raspberry pi website with a link to this GitHub issue. No idea if that will go anywhere but hopefully it helps something.

@ralphwiles
Copy link

Signal boosting this as I'm running a 4TB NVMe drive through the RPi 5 PCIe, and can only use 2TB as a boot drive using Imager. There doesn't seem to be any low-friction path for making anything larger than a 2TB a boot drive and using all the capacity. Sad Panda.

So are you saying that the the other 2TB is lost in this case, can't be used? Or just not available as a boot drive? I just bought a Pi 5 8GB and I was planning to get a 4TB SSD using a Geekwork X1001 HAT for the SSD... I was going to partition the 4TB down into something like a 32GB partition for the RP system and then make a couple of other partitions that would be less than 2TB each. If this wouldn't work then my backup plan would be to use a 32GB micro SD for the OS and use the 4TB drive for the rest of the things I was going to do.

@guru
Copy link

guru commented Jan 19, 2024

So are you saying that the the other 2TB is lost in this case, can't be used?

Anything over 2TB can't be addressed using MBR formatting. The default RPi OS formats use MBR.
So you have to format the drive as GPT or Hybrid MBR/GPT and install/transfer the OS yourself, which can be done.
Or you format the drive as a GPT data drive, and boot from another drive.

@sagesolar
Copy link

sagesolar commented Jun 30, 2024

Is this something that is likely to be looked into being supported officially? Looking online support for NVMe drives larger than 2TB is possible on RPi. For example, this solution works well:

https://github.com/mcpat-it/NVMe

It seems to me that there will be an increasing number of end users wanting to use their RPi's for storage solutions that support bootable, more than 2TB NVMe's. Surely adding support for creating a GPT disk image for such use cases is a good idea? Especially for consumers that are not in command of the technicalities of copying around boot images etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants
@guru @lurch @geerlingguy @maxnet @Technologyman00 @sagesolar @ralphwiles and others