Boot from 4TB NVMe #

The Raspberry PI Imager creates max 2TB partitions as MBR type. If you want to use a 4TB SSD as boot device you need this instructions.

Approach in short

  1. Install Raspberry PI OS on SD Card
  2. Use GPT table on NVMe and create same type of partitions on NVMe like on SD card
  3. copy over both partitions data
  4. switch boot order

1. Prepare SDF Card#

I will use terminal only, so I use lite version:
  • Raspberry Pi Imager > Raspberry PI OS (Other) > Raspberry PI OS Lite (64-bit)

2. Prepare NVMe#

We create same partitions like in SD-Card, check out SD-Card first:
> sudo fdisk --list
	[...]
	Device           Start        End    Sectors  Size Type
	/dev/nvme0n1p1    8192    1056767    1048576  512M Microsoft LDM metadata
	/dev/nvme0n1p2 1056768 7814035455 7812978688  3.6T Linux filesystem

	Device         Boot   Start      End  Sectors  Size Id Type
	/dev/mmcblk0p1         8192  1056767  1048576  512M  c W95 FAT32 (LBA)
	/dev/mmcblk0p2      1056768 15597567 14540800  6.9G 83 Linux

Create

> sudo fdisk /dev/nvme0n1 
create GPT first, this enables us to use MORE than 2TB !
> g 
create first partition: 512MiB boot partition. 4MiB before partition. fat32. Label as ‘bootfs’
> n  (new partition)
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1):
USE exact size from former SD-card (see >sudo fdisk --list<), e.g. 8192 - 1056767

> t (change partition type)
> 11 = Microsoft basic data !!! - "efi system partition" should work too(?)

create second partition ext4 partition
> n
> primary
> (defaults)
note: partition type "Linux" = ext4

3. create file systems#

> sudo mkfs -t vfat /dev/nvme0n1p1 > sudo mkfs -t ext4 /dev/nvme0n1p2

4. change label#

> sudo fatlabel /dev/nvme0n1p1 bootfs > sudo e2label /dev/nvme0n1p2 rootfs

5. check#

> lsblk -f