Raspberry Pi’s normally boots from a SD/Micro SD card. That also means that your root and home partitions lives on the SD card and there is a lower limit to how big it can be and how fast it is compared to normal Hard Drives and SSD drives. Sometimes it can be better to move all other but the /boot partition to an external Hard Drive.
Here is how to move allready existing partitions to an external drive.
1. First fdisk the drive and create an EXT4 filesystem
fdisk /dev/sda delete existing partitions create new Primary Linux partition as /dev/sda1 write the system to disk with the command w exit fdisk
mke2fs -t ext4 /dev/sda1
2. Mount the External Harddrive on your Raspberry Pi
sudo su mount -t ext4 /dev/sda1 /mnt
3. Install rsync
sudo apt-get install rsync
4. Copy all the files from the microSD card to the external hard drive. By using rsync then all file permissions and ownership are keept intact.
sudo rsync -axv / /mnt
this will take a while to finish.
5. Then we need to modify the Raspberry Pi’s startup file, Your device will look for it on the SDCard in the /boot partition
We need to edit two parts of this line. Change the root= to /dev/sda, add rootdelay=5
It should look like this
6. Then we are adding the hard drive entry to “/mnt/etc/fstab” so the root folder in the external hard drive is automatically mounted at boot up.
Add this to the end of the file
/dev/sda1 / ext4 defaults,noatime 0 1
Comment out the line with the SDCard with a # so it look like this
#PARTUUID=c1c4201a-01 / ext4 defaults,noatime 0 1
After the changes, it should look like this (here is a screenshot from one of my Pi’s)
Reboot your Pi, and it should boot up and run from the external hard drive. One thing to note is that the microSD card needs to be in its slot, as the Pi needs to read the startup file from it before it boots up on the drive you wan’t
It is also possible to boot without the SDcard, but this way is how i prefer it to be done as it is very easy to switch back to the SDcard…just change the
Here is how the result can be with an External 1 TB USB Hard Drive.