Default way to resizing SD card with raspi-config is not going to work on USB SSD disk so we have to do this old fashion i.e. command line fdisk. Let change partition table with fdisk. You need to remove exiting partition entries and then create a new partition that takes the all the free space on the disk we have. This will only change the disk partition table not the data on the disk.

First Part of this post about: Boot Raspberry Pi from USB SSD

Resizing usb ssd disk in raspberry pi with raspi-config

Resizing USB SSD disk in raspberry pi with raspi-config

Run fdisk -l to list all the partitions and all the disks attached to your raspberry pi.

If you are not sure which disk is your root partition then you have to check it to be sure, first run df -h command to see whcih one is your root mount / and then you can check with findmnt command where root partition is sitting on actual disk.

Output from findmnt

You can see my / (root) partition is sitting on /dev/sda2

Output from df -h

Size of the partition and used capacity along with available capacity.

Lets get to work and extend /dev/sda2 partition to use full disk. Run fdisk /dev/sda command and follow steps below.

  1. p – Print exiting partition table and take note of /dev/sda2 start (in my case it was 540672 but this is very important)
  2. and then 2 – to delete exiting partition /dev/sda2
  3. np – 2 create new partition, set it primary, and its number 2
  4. First sector – this is the magic number in my case it was 540672  and press enter.
  5. You may get this message if you do type n to Partition #2 contains a ext4 signature. Do you want to remove the signature? 
  6. w to save partition table and exit fdisk
  7. reboot the pi
Partition contains a ext4 signature message

Partition contains a ext4 signature message

List of steps to Create Partition

Resize Partition

After rebooting you can see disk size is still old one, now we need to resize file system with resize2fs command

Run df -h command to check size of the partition and used capacity along with available capacity, now run sudo resize2fs /dev/sda2 to resize root partition (This make take some time). Once partition is resized you can check disk capacity again with df -h

You can buy PiHome SSD disk with all os and

Note: You can buy PiHome Smart Heating SSD disk with the full LAMP stack (Apache, PHP 7.x and MySQL/MariaDB and phpMyAdmin) pre-installed and configured, PiHome SSD is tested with Raspberry pi and compatible with updates from PiHome.