While using a Raspberry Pi (3 in this case) with Raspbian on a Harddrive (using a dedicated SATA expansioncard) I recently needed to downgrade to a smaller SSD. Here are my steps:
- Make a backup of the original harddrive
- Using gparted or sth. similar to resize the root partition as small as possibe; at least to the size of the smaller drive
- Write a VANILLA Raspbian on the new drive. This creates a usable boot partition.
- Add
program_usb_boot_mode=1parameter to config.txt on boot partition more here - Boot the RPi with the new drive connected and an SD-Card inserted.
- Boot the RPi only with the new drive.
- Write the root partition from the old drive on the new drive, overwriting the previously created root partition on the new drive.