Similar question was asked here, but the answer is out of date and I don't have enough reputation to ask in a comment. I know it's possible to boot a Raspberry Pi 4 from USB with the latest firmware update, but does it still need to be on an MBR disk?
4 Answers
Yes, it is possible, I just did it a few hours ago, all with the latest Raspberry Pi OS Lite image.
I just created a GPT on the external disk, a 256MB partition formatted with vfat and labeled boot, and an 64GB one formatted with ext4 and labeled rootfs, just like the SD card. Then I copied all the files from the SD card boot partition into the disk boot partition, and did the same thing with the rootfs partitions. I choose 64GB as a personal choice. I wanted to have a root partition and a data one. You can probably fill the disk with the root partition.
By the way, you will have to update your /boot/cmdline.txt and /etc/fstab files, as your partitions will have different PARTUUID values. Also you have to change the boot order with raspi-config.
I recommend you set up /dev/sdX values in those files and then boot the raspberry and update the values with the right PARTUUID values. I tried to use the PARTUUID values I got when the disk was attached to my laptop, but they are different, for some reason.
- 66
- 1
- 3
No the Pi will only boot from a FAT partition on a MBR partition table.
I believe it may be possible with a modified image with GPT support in an initramfs.
- 62,573
- 32
- 113
- 225
The awnser of @sildur is correct. Here is an a little bit more in detail what I had to do to get debian on a pi cm4 to boot on a fully usable 4TB m.2 ssd.
- Have an MBR Drive where the os is flashed and ran at least one time.
- Copy all data while preserving attribute to your local machine
- cp -rp ...dist/bootfs/* ./bootfs
- cp -rp ...dist/rootfs/* ./rootfs
- Use GParted to create an gpt partition table.
- Use GParted to create 3 partitions:
- bootfs (fat32 with 4MiB storage free before that and 512MiB in size)
- rootfs (ext4 with all the space that os and programms need)
- (optional) nameAsYouWant (ext4 the rest of the space available)
- Copy all the data back to the disk
- cp -rp ./bootfs/* ...dist/bootfs
- cp -rp ./rootfs/* ...dist/rootfs
- Change ...dist/rootfs/etc/fstab and ...dist/bootfs/cmdline.txt PARTUUIDs matching to the PARTUUIDs from blkid (Use PARTUUID not UUID!) You should need to adjust 3 variables in total.
Please adjust the mounting points to your needs: ...dist/bootfs and ...dist/rootfs.
I tried it with a pi 2, it is possible but it was a hassle to got it working.
After almost booting it said that the root account was blocked and access was denied.
How I got it working (using windows tools):
- I took a snapshot from an SD card with working Raspbian with Macrium Reflect
- after hooking up the HDD with USB i opened
diskpart(windows cmdline utility)
In diskpart, use the following commands:
- see which disk you want to use; type
list disk - select the disk
select disk x(where x is your disk) - type
cleanto clear the whole disk (ALL EXISTING DATA IS LOST) - create a partition with
create partition primary - type
GPT ATTRIBUTES=0x8000000000000000to set the right access (if you don't do this, you'll end op with the root access denied message)
Now the disk is finished; open up "Macrium Reflect" select restore select the USB disk and remove partition 2 which diskpart created.
(Leave the 15MB partition on the disk otherwise Macrium reflect converts the disk back to MBR).
After this, edit the boot/firmware/cmdline.txt file and change the UUID with the rootfs partition UUID.
- in windows you can use
mountvolto see all partitions UUID's - on the Raspberry Pi you can use
ls /dev/disk/by-partuuidto show the UUIDs
Save the file and reboot.
- 2,882
- 3
- 17
- 22