

10:11 pm
May 14, 2015

Run Retropie from USB Hard Drive WITHOUT the need for SD card at all! You might want to back up your SD card before doing this!
My method will allow you to take one of your existing Retropie images that you use and love and transfer it to a USB drive – which will give you more space for more roms!
From the Retropie command line type the following:
sudo apt-get update && sudo apt-get install rpi-update
sudo BRANCH=next rpi-update
echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt
reboot
From a command line again:
vcgencmd otp_dump | grep 17:
** Make sure it returns 17:3020000a
Keep in mind in the next few steps you are going to modify the files that let you boot up from your SD card and it will not boot from it anymore unless you re-image it. This is to you can create a USB bootable image and save it to your hard drive in Windows while retaining all your Retropie settings and roms. You might want to back up your SD card before continuing.
From a command line in Retopie type the following:
sudo sed -i "s,/dev/mmcblk0p2,/dev/sda2," /etc/fstab
sudo sed -i "s,/dev/mmcblk0p,/dev/sda1," /etc/fstab
You are basically changing mmcblk0p1 to sda1 and mmcblk0p2 to sda2 in /etc/fstab.
sudo sed -i "s,root=/dev/mmcblk0p2,root=/dev/sda2," /boot/cmdline.txt
You are basically changing root=/dev/mmcblk0p2 to root=/dev/sda2 in /boot/cmdline.txt
Now that your OS and firmware are updated and you have toggled OTP bit on your Pi to allow it to boot from USB, shutdown Retropie and take out the MicroSD card and then copy via Win32diskimager to your Windows hard drive. Once that is done remove your MicroSD card from WIndows and plug in your USB drive into your Windows PC, and use Win32diskimager to write that image you just saved onto your USB drive. Once it's done remove the USB drive from Windows and plug it into your Pi via a USB hub into a USB port.
Once booted you will have to resize to get all the space of the new drive.
You will have to do this manually via the command line in Retropie because the built-in tools to do so in Retropie do not like the USB hard drive. It may work with a USB flash drive as I did not test this. Anyhow here is how you do it manually. Log into Retropie via ssh or by going into the program and exiting Emulation Station which will put you at the command line:
1.) sudo fdisk -l
Look at the bottom of the output and pay attention to the very last line which contains /dev/sda2. The second column of this line shows the starting sectors for this parition (for example, in my case it was 124928 – it will be different depending on your hard drive. Remember or write down this number – it is very important!
2.) fdisk /dev/sda
3.) Press d <Enter>
4.) Press 2 <Enter>
Now re-create it:
5.) Press n <Enter>
6.) Press p <Enter>
7.) Press 2 <Enter>
8.) Enter the First sector and the same value as the original /dev/sda2 partition (124928 from the above example).
9.) For the Last sector just press enter to use the maximum value.
10.) Now press 'p' > Enter to see the new partition setup.
11.) Finally press 'w' > Enter to write it
12.) type sudo reboot
13.) After reboot finishes and your are back in Retropie go back to the command line using ssh method or by shutting down Emulation Station method.
14.) sudo resize2fs /dev/sda2
This could take a little while. Let it complete. When you get your command line prompt back type in
df -h
and look at the size of /dev/root. You should see all your new space available. I started out with a 128 GB image and SAD card and now this is what it looks like since I upgraded to a 1 TB hard drive:
Filesystem Size Used Avail Use% Mounted on
/dev/root 918G 205G 685G 23% /
NOTE: My USB hard drive works with and without a USB hub but it is recommended to use a hub since the drive will draw too much current from the Pi and possible wreck it.
SOURCE : Tom Gellert
1:44 pm
Arcade Punk
February 28, 2018

9:07 am

Ken
June 17, 2018

Quote from xyz0n on February 28, 2018, 1:44 pmHello, thanks the tutorial, but I miss a passage, how to format the hard disk and then copy the image with win32diskimager ?? ntfs? fat32? the program I use to format the micro sd does not see the hard disk …
Yes the drive needs to be formatted fat32. If win32diskimager doesn't see it after that you could try etcher to copy the image.
3:26 pm
Ken
October 23, 2018

Hi Guys…. I'm looking at using one of the 128Gb images that are available for download… some of them look really good… BUT… I don't have a 128Gb SD Card. I do however have a self powered USB Hard Drive. So can this method be used to put one of the downloaded images onto the hard drive? will that work, or does it have to be transfered from an SD card.  I'm a bit clueless about linux. I didn't see an answer to this anywhere else in the forum.
All The Best… Mr Bear.
EDIT: Scratch that dumb question… I just found the answer in the Resources/Guides section…. written by Madlittlepixel
I'm good at asking dumb questions…. LOL
1:56 pm
Arcade Punk
June 18, 2018

Quote from TheBear on October 23, 2018, 3:26 pmHi Guys…. I'm looking at using one of the 128Gb images that are available for download… some of them look really good… BUT… I don't have a 128Gb SD Card. I do however have a self powered USB Hard Drive. So can this method be used to put one of the downloaded images onto the hard drive? will that work, or does it have to be transfered from an SD card.  I'm a bit clueless about linux. I didn't see an answer to this anywhere else in the forum.
All The Best… Mr Bear.
EDIT: Scratch that dumb question… I just found the answer in the Resources/Guides section…. written by Madlittlepixel
I'm good at asking dumb questions…. LOL
Hi, which guide are u talking about? I see a guide to use an Hard Disk via USB, but you need however a microsd, even if small…
Also, If you download a 128GB image, how you manage to install on the external disk IF you don't write It on a 128GB microsd before?
10:20 am
Ken
October 23, 2018

Hello vatastala,      Yes that's the right guide…. the one in the Resources section of this web site.
1) Once you download the 128Gb image on a PC… you burn it to the USB hard drive from the PC with a free program called "Win32 Disk Imager" Google it!  Then reboot your PC.
2) Once you've done that, you format a small SD card as FAT32…..
3) Still on the PC, open the hard drive you burnt and copy everything you see, to the SD card….. The PC can only see the Fat32 partition, it cant see the linux ext4 partition.
4) Edit the cmdline.txt as instructed in the guide…..
attch the hard drive and the SD card to the Raspberry Pi….. you should now be able to boot that image…. Follow the instructions above to make the Pi boot from USB instead of booting from SD. Assuming that you are using a Pi3 or Pi3B it will not boot from USB if you are not on a version 3.
All the best…
Mr Bear.
1:13 pm
Ken
December 20, 2018

Hi, I'm wondering if anyone can help, complete noob but learning, my install was a bit different from the guide and after a certain point just fails.
I did an install of an image to a Pi 3 B+ (with etcher)Â and straight off the bat added the program_usb_boot_mode=1 to the config file, so didn't need the extra steps, so I skipped forward to…
1.) sudo fdisk -l   I get the info and the 'starting sectors for this partition', then do 2.) fdisk /dev/sda   and this is where it fails, fdisk: cannot open /dev/sda : permission denied.
7:58 am
Arcade Punk
January 14, 2019

Hey, I got the 256GB Virtualman 4.4.4 onto an usb-ssd, and after changing to boot/sda1 etc… it boots up just fine but none of the other usb ports are working… so I can't configure controller (X360-wired) and my keyboard isn't working…
I've tried externally powered drives, but when booting from usb, the only port working is the one where the disk sits…
my pi is the 3 B+ and 2,5 A powersupply
10:44 pm
Arcade Punk
July 1, 2019

Ninja UK, you have no idea how much I love you right now! <3 <3
I have tried for days to get my pi to boot solely from USB SSD and I tried the "rsync" method described on a few sites and YouTube vids but kept running into problems (rsync got "broken pipe" error or was killed by the Kernel, I presume due to memory problem). Your method worked FIRST TIME, so thank you!
I did spot a mistake in your instructions:
sudo sed -i "s,/dev/mmcblk0p,/dev/sda1," /etc/fstab
should be sudo sed -i "s,/dev/mmcblk0p1,/dev/sda1," /etc/fstab
1 Guest(s)
