0

My Pi 5 boots from a Pimoroni PCIE SSD. I should like to reduce the rootfs partition to give space for a partition separate from rootfs. If the boot order is changed to "sdcard, ssd", the system does indeed boot from the SD card but / is still found on the SSD. Because the partition is mounted, it cannot be modified. How, please, can the system be told to use the SD card version of / rather than the SSD version?

Physically removing the SSD to change the partitions seems rather a clumsy option. Is there, perhaps, a way to reboot the Pi to a dedicated parted system running from RAM?

Further information following @milliways comment:

When used with an SD card alone, without the SSD connected, the Pi booted and ran normally. With the SSD connected it ran normally with nvme0n1 showing as a disk in the output from lsblk. The contents of the SD card were then copied to the nvme drive with SD Card Copier. This copies the partitions to the SSD as bootfs and rootfs. After removing the SD card, the Pi runs correctly from the SSD. At this point, the bootfs and rootfs partitions on the SSD are each mounted and thus not amendable.

With the original SD card reinstalled and the boot order set to 'SD card, then SSD', lsblk shows

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
mmcblk0     179:0    0  29.7G  0 disk
├─mmcblk0p1 179:1    0   512M  0 part /boot/firmware
└─mmcblk0p2 179:2    0  29.2G  0 part
nvme0n1     259:0    0 465.8G  0 disk
├─nvme0n1p1 259:1    0   512M  0 part
└─nvme0n1p2 259:2    0 465.3G  0 part /

The SD card boot partition contains the active /boot/firmware but the system root is still on nvme0n1p2. For the partition structure on the SSD to be changed, nvme0n1p2 must be unmounted. How, please, can the system be instructed to use the SD card rootfs (mmcblk0p2) as rootfs instead of the nvme version?

Further information

The contents of cmdline.txt are

cat /boot/firmware/cmdline.txt
console=serial0,115200 console=tty1 root=PARTUUID=a7bba259-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles cfg80211.ieee80211_regdom=US

The output from blkid is:

/dev/nvme0n1p1: LABEL_FATBOOT="bootfs" LABEL="bootfs" UUID="EF6E-C078" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="a7bba259-01"
/dev/nvme0n1p2: LABEL="rootfs" UUID="4aa56689-dcb4-4759-90e6-179beae559ac" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="a7bba259-02"
/dev/mmcblk0p1: LABEL_FATBOOT="bootfs" LABEL="bootfs" UUID="EF6E-C078" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="a7bba259-01"
/dev/mmcblk0p2: LABEL="rootfs" UUID="4aa56689-dcb4-4759-90e6-179beae559ac" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="a7bba259-02"

From this it is clear that the "Copy SSD" operation clones the SD card to the SSD without updating the partition UUID.

It should be possible to manipulate the various partition UUIDs to resolve the problem.

Simple solution

Use a different SD card as the boot device.

  1. Set the Pi to boot first from the SD card and then from the SSD;
  2. Shutdown the Pi;
  3. Insert a bootable SD card that is not the card used to set up the SSD;
  4. Boot the Pi. The output from blkid is now:
/dev/nvme0n1p1: LABEL_FATBOOT="bootfs" LABEL="bootfs" UUID="EF6E-C078" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="a7bba259-01"
/dev/nvme0n1p2: LABEL="rootfs" UUID="4aa56689-dcb4-4759-90e6-179beae559ac" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="a7bba259-02"
/dev/mmcblk0p1: LABEL_FATBOOT="bootfs" LABEL="bootfs" UUID="EF6E-C078" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="2c068419-01"
/dev/mmcblk0p2: LABEL="rootfs" UUID="4aa56689-dcb4-4759-90e6-179beae559ac" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="2c068419-02"

so the PARTUUIDs are now different.

The output from lsblk is now:

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
mmcblk0     179:0    0 238.8G  0 disk
├─mmcblk0p1 179:1    0   512M  0 part /boot/firmware
└─mmcblk0p2 179:2    0 238.2G  0 part /
nvme0n1     259:0    0 465.8G  0 disk
├─nvme0n1p1 259:1    0   512M  0 part
└─nvme0n1p2 259:2    0 465.3G  0 part

so / is now on the SD card.

It is now possible to resize the nvme0n1p2 partition.

Job done!

1
  • You haven't explained any detail of what you did or listed any diagnostics. Did you try using a fresh installation to a SD Card?
    – Milliways
    Feb 16 at 22:05

0

Your Answer

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

Browse other questions tagged or ask your own question.