Article

How To Create a RetroPie USB Boot Drive for Raspberry Pi 3

In this article, you are going to learn how to use an HDD with your Raspberry Pi instead of a SD Card.

If you really enjoy this article, consider checking out my TechWizTime YouTube Channel.

And for an awesome source of Raspberry Pi Accessories, check out my Raspberry Pi Amazon List.

Let’s get started!

What you’ll need

Update your RetroPie

Press “F4” to get into the Command Line.

Type “sudo apt-get update && sudo apt-get install rpi-update” and press “Enter”

Type “sudo BRANCH=next rpi-update” and press “Enter”

Configure the boot config file

Type “echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt” and press “Enter”

Reboot the system by tytping “sudo reboot”

After it reboots properly, press “F4” to return to the Command Line.

Type “echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt” and press “Enter”, if the return is 17:3020000a, you may continue, if not, then your HDD or USB Stick may not be compatible.

Go into the config file by typing “sudo nano /boot/config.txt” and then pressing “Enter”

Scroll to the bottom of the file with your arrow keys.

Delete the line that reads “program_usb_boot_mode=1”

Press “Ctrl” + “X”, then press “Y” and then hit “Enter”, this will save the file and take us back to the Command Line.

Setting up the Hard Drive Partitions

After we’re back to the Command Line, type “sudo parted /dev/sda” and press “Enter”

Type “mktable msdos” and press “Enter”

Say “Yes” to destroying the disk label.

Create the “fat32” partition by typing “mkpart primary fat32 0% 100M”

Create the Linux partition by typing “mkpart primary ext4 100M 100%”

Type “quit” to get out of the partition tool

Type “sudo mkfs.vfat -n BOOT -F 32 /dev/sda1” and press “Enter”

Type “sudo mkfs.ext4 /dev/sda2” and then press “Enter”

Copy all the files from your MicroSD Card to your Hard Drive

Type “sudo mkdir /mnt/target” and press “Enter”

Type “sudo mount /dev/sda2 /mnt/target/” and press “Enter”

Type “sudo mkdir /mnt/target/boot” and press “Enter”

Type “sudo mount /dev/sda1 /mnt/target/boot/” and press “Enter”

Be sure that you have “rsync” installed to it’s latest version by typing “sudo apt-get update && sudo apt-get install rsync”

Type in “sudo rsync -ax –progress / /boot /mnt/target” and press “Enter”. Be ready to have a long wait as it’ll start to copy all the files on your SD Card to your Hard Drive.

Bind the system directories

Type “cd /mnt/target” to access one of the mount directories

Type “sudo mount –bind /dev dev” and press “Enter”

Type “sudo mount –bind /sys sys” and press “Enter”

Type “sudo mount –bind /proc proc” and press “Enter”

To delete your SSH key and make your Drive a bit more secure, type “sudo chroot /mnt/target” and press “Enter” to get root access

Type “rm /etc/ssh/ssh_host*” to delete your SSH key.

Type “dpkg-reconfigure openssh-server” to create a new SSH key.

Type “Exit” once that the new SSH key is generated to get out of root.

Type “sudo umount dev” and press “Enter”

Type “sudo umount sys” and press “Enter”

Type “sudo umount proc” and press “Enter”

Finish adding the needed information to the Command Line of the Boot file by typing “sudo sed -i “s,root=/dev/mmcblk0p2,root=/dev/sda2,” /mnt/target/boot/cmdline.txt” and then press “Enter”

Add “fstab” to the boot file by typing “sudo sed -i “s,/dev/mmcblk0p,/dev/sda,” /mnt/target/etc/fstab” and then pressing “Enter”

Type “cd ~” after entering the last 2 commands and press “Enter”

Log out of the boot partition by typing “sudo umount /mnt/target/boot”

Type “sudo umount /mnt/target” and press “Enter”

Power off your Raspberry Pi by typing “sudo poweroff”, that way you can take out the SD Card.

Creation of an USB Boot for Retropie Finished

Congratulations, you’ve just set up your HDD to work with your Raspberry Pi and boot into RetroPie.

Did you manage to set it up by yourself? Did you have any problems during the setup? Have any suggestions? Then leave a comment below.

 

 

 

Dereck Frost

I write tech articles and tutorials based around a number of topics.

Share
Published by
Dereck Frost

Recent Posts

11 Survival Gadgets 2024 | Every Man Should Have

11 Survival Gadgets 2024 | Every Man Should Have 🔗 LINKS Spika Strike Gaiter -…

14 hours ago

Impressive eGPU With OCULINK, USB4, NVMe SSD – ONEXGPU!

Unleash the power of the OneXGPU and take your gaming experience to the next level!…

21 hours ago

Top 5 Best FREE Video Players for Windows (2024)

To play the videos stored on your computer, you’ll need a reliable media player. If…

3 days ago

The Best Google Docs Features 2024

🔔 SUBSCRIBE for more Tech Tips: https://www.youtube.com/tasiacustode?Sub_Confirmation=1 Support me here: https://ko-fi.com/tasiacustode Become a Patron: https://www.patreon.com/TasiaCustode…

4 days ago

15 New Gadgets 2024 | You Will Want To Buy

15 New Gadgets 2024 | You Will Want To Buy 🔗 LINKS Artemis - https://artemis.wonderfitter.com/…

5 days ago

NEW Razer Viper V3 Pro Review! 🐍

Razer just released the new Razer Viper V3 Pro mouse, another addition into their Viper…

6 days ago