Using USB harddrives on RaspberryPi

This is surprisingly easy.

  • Make sure your PI has enough power – at least a 2Ah or better.
  • Mount the root partition your SD card
  • Mount your USB harddrive (ext4 formatted
  • Copy the root partition of the sdcard to a ext4 formatted usb-harddrive.
  • Rebember to sync to ensure all data are flushed from cache.
mount /dev/sdxY /your/sdcard/mountfolder
mount /dev/sdxY /your/usb/mountfolder
cp -r /your/sdcard/mountfolder/* /your/usb/mountfolder
sync

On the boot partition of the sdcard copy the file cmdline.txt -> cmdline.txt.bak.

cp /boot/cmdline.txt /boot/cmdline.txt.bak

Open cmdline.txt and find where it reads

root=/dev/mmcblk0p6

Change it to

root=/dev/sda1

Save your file.

Attach your USB drive to your PI, insert your SD card and plugin power. Your PI will boot faster and you dont wear your SD card down.