0

Context

I have a 500GB external SSD whith a 32 GB partition containing an older 32-bit Raspberry Pi OS, a boot partition of a few GB and a 468-ish GB partition for data (docker volumes, photos, generic data, etc...).

I want to move to a 64-bit OS, so I thought I would install the 64-bit Raspberry Pi OS on the 32 GB partition. However, I soon found that Raspberry Pi Imager and Balena Etcher can only install the image OS onto a whole device (removing any existing partitions) and not on a single partition.

While I do have a backup of what is on the 468 GB partition, it would be a recovery over a slow network so that's why I am not eager to simply overwrite everything and do a restore later.

Question

How can I flash the 64-bit Raspberry Pi OS onto a single partition of a large, multi-partition external SSD drive, preserving any other partitions?

What I've tried

  • I found this similar question/answer, but the answer seems to suggest this is simply not possible.

  • I found that one can use the dd command to copy the image onto a device. I tried this with (/dev/disk2s2 is the target partition):

    sudo dd if=2023-02-21-raspios-bullseye-arm64-lite.img of=/dev/disk2s2 bs=4M conv=fsync status=progress
    

    This produced no error, but the 32 GB partition became unmountable (I received an error when mounting: "wrong fs type, bad option, bad superblock").

2 Answers 2

1

Simple answer. You can't.

The Pi needs a MBR medium to boot and looks at the first FAT partition for boot files.

It is possible to manually prepare partitions on a SSD and copy content. The simplest way to do this is to use a SD Card as source.

You could loop mount the image and copy contents of image partitions to your existing SSD. (This would require minor changes to PARTUUID.)

There are unsupported methods to boot from a GPT medium but they are not simple.

3
  • Thank you, could you perhaps elaborate on the possible workarounds mentioned in the 2nd and 3rd paragraph? That seems like a solution to pmy problem. Mar 25, 2023 at 10:54
  • Either of the options I suggested requires a Linux computer (which can be a Pi with another SD Card) because you not modify an active mounted partition. The first could be done with rsync after completing a normal install. The second requires more Linux expertise but is probably the option I would use. If you have never used loop mount might be more challenging. If you want to do this and have the requisite hardware I could post a loop mount script. This is really a different question.
    – Milliways
    Mar 25, 2023 at 11:17
  • As I suggested the first is simplest. Do a fresh install to a new SD Card. Mount the SSD then use rsync to update the boot and root partitions on the SSD. You need to adjust the PARTUUID to match the SSD.
    – Milliways
    Mar 25, 2023 at 11:27
0

Unearthing this old discussion: It can be done.

I for myself had OMV5 installed on a small root partition of a micro-SD, with a huge data partition – and I wanted to re-install OMV6 from scratch into that same partition, while not touching the data partition.

So I went and installed a fresh Raspbian on a fresh micro-SD. … That's obviously only half the race, as you want this fresh installation on the original micro-SD – both boot and root partition.

So I went back to my own old blog post from 2020 that dealt with transferring a living, breathing Raspbian system to a different SD (bigger or smaller, just a different one). I used that before to transfer a NOOBS based Raspbian, but it works here just as well: I transferred the freshly installed Raspbian from the fresh micro-SD into the original partition on the previous micro-SD.

Everything you need to know can be found here:
https://ger.oza.hn/2020/02/transfer-raspbian-from-noobs-partition-to-regular-sd-card/

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.