Move Boot partition to smaller SD Card

Solved. I had misunderstood the response. For anyone following on it is very simple to do.

From the top - I inserted the smaller SDCard into a USB adapter and plugged it into the Pi.

It shows up as sdb with lsblk. First, format the smaller card and create a new partition (taken from this item https://www.raspberrypi.org/forums/viewtopic.php?t=117820#p800811).

root@DietPi:~# fdisk /dev/sdb
Command (m for help): n
Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (1,3,4, default 1): 1
First sector (2048-15407103, default 2048): 8192
Last sector, +sectors or +size{K,M,G,T,P} (8192-122879, default nnnnnnnn): 122879

Created a new partition 1 of type 'Linux' and of size 56 MiB.

Command (m for help): w

Remember the last command to actually make the changes.

Format the partition as fat

root@DietPi:~# mkfs.fat /dev/sda1

Once the filesystem is made you’re ready to copy - I used dd

root@DietPi:~# dd if=/dev/mmcblk0p1 of=/dev/sdb1

Next is the bit I missed, you need to edit the /etc/fstab file.

You need to edit this line and insert the right PARTUUID for the new boot partition. Use the blkid command to get the value. Remember, it will still be shown as the PARTUUID for /dev/sdb1

PARTUUID=cb7b86f7-01 /boot vfat noatime,lazytime 0 1

I then un-mounted the /boot partition, removed the card and inserted the smaller card before rebooting.

As the boot partition is not mentioned in the cmdline.txt file, I did not find a need to edit it.

Bingo! I now have the boot on an otherwise redundant 2GB card and free up a 16GB card for other things. Reduce, reuse recycle :sunglasses:

MichaIng - would be really great if this function was an option in the dietpi-drivemanager.

Cheers all.