DietPi – Move Boot partition to smaller SD Card

Original Topic

DietPi is just a great distribution. If you haven’t tried it, do.

There is a function within the system called dietpi-drivemanager and it does what it says on the tin, manages drives. For me I wanted to move the rootfs to an SSD. Easily done with DietPi.

Once I had done that, I wanted to reclaim the 16GB SD Card for other things and reuse an old 2GB card. This turned out to be quite easy as well.

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

The smaller card shows up as sdb  with lsblk command. First, format the smaller card and create a new partition (taken from this item).

Remember the last command to actually make the changes.

Format the partition as fat

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

Next, 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

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.

Facebooktwitterby feather
This entry was posted in DietPi, Linux, RaspberryPi, Technical - General. Bookmark the permalink.

Leave a Reply