I am somewhat new to Raspberry Pi.
I would like to make the 5 TB WD My Book USB drive the boot drive with the Raspberry Pi OS FULL (32-Bit)
image. If I use the Raspberry Pi Imager
to configure the USB Drive, I encounter an error on the firstboot because of insufficient privileges to create partitions. I have also noticed that the Raspberry Pi Imager
converts the drive to MBR. This renders 3TB of the drive unusable.
I am going to be using some development tools that only work when installed to the boot drive.
Thus far, I have had no luck what-so-ever on using a 5 TB GPT drive as a boot drive. I can use it as a data drive.
Most of the problems are partition issues.
What I have tried
Imager
When the the `Imager` on the WD My_Book 5 TB drive (with no no partitions); an attempt is made during the firstboot to resize the /dev/sda2. This fails and leaves the drive in an error state. The error that appears in GParted is: Superblock checksum does not match the superblock while trying to open /dev/sda2. Couldn't find valid filesystem superblock.
- Issued the following command:
$sudo su - root
Removed all existing partitions from the USB drive in
GParted
.Started the
Imager
.Set the following options:
Operating System: RASPBERRY PI OS FULL (32-BiT)
Storage: WD MY_BOOK
Imager
successfully writes and verifies to the USB Drive. The following message appears:
Write Successful Raspberry Pi OS Full (32-bit) has been written to WD My_Book_25EE. You can now remove the SD card from the reader
Removed the SD Card and Clicked OK.
Re-booted the Raspberry Pi.
The Raspberry Pi endlessly cycles between: Trying Boot Mode USB-MSD and Trying Boot Mode SD
OR
Subsequent re-boot produces the following error: Failed running firstboot: Partition table resize of the root partition (/dev/sda2) failed
Manually define Partitions
I have worked through partitioning and formatting the partitions of the 5 TB USB drive. My steps are below.
- Unmounted the drive from the Raspberry Pi
File Manager
. - Opened a terminal and started a
parted
session.
$ sudo parted
- Selected the
/dev/sda
drive to partition.
(parted) select /dev/sda
- Created a GPT partition table.
(parted) mklabel gpt
- Created new partitions on the drive.
(parted) mkpart os fat32 0gb 750gb
(parted) mkpart dev-ntfs 750gb 50%
(parted) mkpart dev-ext4 50% 100%
- Exited
parted
.
(parted) q
- Formatted the new partitions.
$ sudo mkfs.ntfs -L dev-ntfs -Q /dev/sda2
$ sudo mkfs.ext4 -L dev-ext4 /dev/sda3
- Powered down the Raspberry Pi and restarted.
- Temporarily remounted the partitions under
/mnt
.
$ cd /mnt
$ sudo mkdir dev-ntfs
$ sudo mkdir dev-ext4
- Temporarily mount the partitions.
$ sudo mount /dev/sda2 /mnt/dev-ntfs
$ sudo mount /dev/sda3 /mnt/dev-ext4
- Obtain the
PARTUUID
for the new partitions.
$ sudo blkid
- At a stand-still until I can find a way to install the OS on the USB.
rpi-clone
Unmounted and deleted all partitions from the USB Drive in
GParted
.Tried using
rpi-clone
as per https://github.com/billw2/rpi-cloneSet the boot-order in
raspi-config
.This clones the SD-Card to the USB but renders the majority of the USB drive unallocated and unusable.
The Raspberry Pi will not boot from the USB drive.
Test Case with 128 GB USB (This Works)
As a test case I setup a 128 GB USB stick by using the Raspberry Pi Imager
.
This works.
- Boot the Raspberry Pi 4B from an SD Card.
- Make sure the Raspberry Pi 4B is up-to-date.
$ sudo apt-get ugrade -y
$ sudo rpt-eeprom-update
My Raspberry Pi 4B was already up-to-date from attempts with the GPT drive.
Plug the 128 GB stick into a USB3 port.
Use the
Raspberry Pi Imager
to burn the OS onto the 128 GB USB stick.When the imager completes the verify of the write to the 128 GB USB, shut down the Raspberry Pi 4B.
Take the SD-Card out of the Raspberry Pi 4B.
Power the Raspberry Pi 4B on.
Questions
- I would like to setup a USB GPT drive with desired partitions.
I have setup partitions on the USB GPT that ensures all partitions are < 2 TB and fat32.
I would like to:
Setup the desired partitions manually on a USB GPT drive with a predefined
boot
partition.Copy the
boot
from a working SD-Card to the predefined USB GPT drive.Boot from the GPT USB Drive and by-pass the automatic resize of the GPT USB Drive during firstboot (or any boot).
/etc/fstab
. I need to do some research to determine where the partitions are actually set. If I open `/etc/fstab', no new lines for the two new USB drive partitions are there. This must have been changed./etc/fstab
) determine where the root fs is? Do we check all accessible filesystems? What if there is an/etc/fstab
on all of them and they conflict? Like any linux system, the root fs is determined by the kernel command line, generally provided by the bootloader (which in the case of the Pi, is read from thecmdline.txt
file on the boot partition). You should consult the official documentation when doing this kind of thing: raspberrypi.com/documentation/computers/configuration.htmlraspi-config
has an option for this, but I have not checked. The GUI imager cannot do that (while it could write something to the image to run on first boot and do it, there is an obvious chicken and egg problem there).