Skip to content

M.2 Install

TheRealRexo edited this page Oct 19, 2026 · 5 revisions

M.2 Install

This flow stores the OS as a single .img file on the internal NVMe SSD inside a data partition, rather than as a raw root partition. Keeping the OS as a file is more resilient to the PS5 touching the drive, and lets the initramfs loop-mount it at boot.

⚠️ Coexistence caveat. The official guide treats the M.2 as Linux-exclusive. A PS5 soft format is expected to leave the Linux data partition (and therefore the .img) intact, but a repair / hard format will erase it. Back up your image. Format the M.2 in the PS5 before creating the Linux partition.

Tools

Build them from the repo's tools/ directory (or copy the prebuilt scripts onto a running Linux):

Tool Purpose
m2_init Writes the hidden GPT (--device, --size-gb).
ps5-osinstall Creates the data partition and copies the .img onto it (--target m2, --img, --label).
ps5-osexec kexec into a Linux root partition/label (raw-partition installs).

Steps

  1. Boot Linux from the USB image (see Installation).

  2. Copy the tools to a writable path (e.g. /tmp), make them executable.

  3. Create the hidden GPT and partition:

    sudo ./m2_init --device /dev/nvme0n1 --size-gb 128
  4. Install the image as a file:

    sudo PATH=$PWD:$PATH ./ps5-osinstall --img /mnt/usb/ps5-arch.img \
         --target m2 --device /dev/nvme0n1 --size-gb 128 --label PS5M2 --yes

    ps5-osinstall writes a ps5-os-image marker recording the target, partition label, source image, root label and install time. If the partition already exists it skips m2_init and reuses it.

  5. Reboot and send the payload. On boot the initramfs:

    • scans the M.2 (NVMe) first, then USB, for a *.img;
    • loop-mounts the image;
    • hands off to systemd, which mounts the image's own root filesystem.

    Boot files (bzImage / initrd.img / cmdline.txt) still come from the USB root.

Verifying

From the booted system:

findmnt /            # should show the loop device / image root
lsblk                # nvme0n1p1 is the data partition holding the .img

Clone this wiki locally