1

I have a Pi 3 with a USB-attached SSD, which I always intended to make bootable, but never got around to. It has a 16GB "root" partition on it and the rest of the space is used for a 450GB data partition. It's currently booting and running from / and /boot on the SD card though, using only the data partition of the SSD.

I'd like to replace that 16GB partition with something resembling the contents of the SD card, which fdisk reports as:

Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0d06468e

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1        8192   532479   524288  256M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      532480 31116287 30583808 14.6G 83 Linux

The equivalent output for the SSD is:

Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Portable SSD T5
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 678BC9F4-F780-4F5A-A793-B8C18ED2B528

Device        Start       End   Sectors   Size Type
/dev/sda1      2048  33556479  33554432    16G Linux filesystem
/dev/sda2  33556480 976773134 943216655 449.8G Linux filesystem

I can make some of the partition changes to the SSD just fine, resulting in this:

Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Portable SSD T5
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 678BC9F4-F780-4F5A-A793-B8C18ED2B528

Device        Start       End   Sectors   Size Type
/dev/sda1      2048    526335    524288   256M Linux filesystem
/dev/sda2  33556480 976773134 943216655 449.8G Linux filesystem
/dev/sda3    526336  33556479  33030144  15.8G Linux filesystem

Filesystem/RAID signature on partition 1 will be wiped.
Partition table entries are not in disk order.

What I can't do is mark /dev/sda1 as W95 FAT32 (LBA), which I believe to be essential for the Pi to boot from it. The output from l listing the available types is a long and very different list, presumably because the Disklabel type is gpt rather than dos.

The list starts with EFI System, MBR partition scheme, Intel Fast Flash, BIOS boot, Sony boot partition, Lenovo boot partition, PowerPC PReP boot and then has many different Linux, FreeBSD, Apple, Solaris and other options.

Is one of the available types going to work as a bootable partition for a Pi, or do I need to start again with this SSD, as a "dos" disklabel type? (A fresh install doesn't really get me to where I want to be, due to the expand-to-fill-all-the-space step of a first-run)

I'm trying to get the partition table to resemble, or be compatible with:

Device        Start       End   Sectors   Size Type
/dev/sda1      2048    526335    524288   256M W95 FAT32 (LBA)   (this will be `/boot`)
/dev/sda2  33556480 976773134 943216655 449.8G Linux filesystem  (this will be `/mnt/data`)
/dev/sda3    526336  33556479  33030144  15.8G Linux filesystem  (this will be `/`)

I believe (based on an instructional page by AdaFruit) that I can populate what will become the root partition on the SSD from the SD card using sudo rsync -axv / /mnt/ssdroot (where /mnt/ssdroot is pointing at /dev/sda3) (and similar for /boot). I will then need to edit the root=PARTUUID= part of /boot/cmdline.txt, and similar changes in /etc/fstab.

Is this switch achievable without starting from scratch?

Update:

When looking into what "Disklabel type" really meant and what implications/limitations it had, I found this page on the raspberry Pi forums, which seems hopeful. I will update once I've had chance to try it out.

1 Answer 1

1

Forget whatever is on the SSD do a fresh install (or copy using an imager or SD Card Copier). It needs to be formatted as MBR.

1
  • I would like to preserve the data partition (which I could do via a backup and restore) but also various configuration elements of the root partition (e.g. a TVHeadend setup that took a while). It seems Pi3 USB boot isn't quite complete enough to boot from a GPT partitioned disk so I'm probably going to go down the route of sticking with the SD for just /boot and using the SSD for / and /mnt/data.
    – Chris
    Commented Sep 16 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.