Use Flash Drive to Boot RaspberryPi4 - NO MORE SD CARDS! 4K TUTORIAL

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right how's it going y'all today we're going to be talking about how to boot a raspberry pi 4 off of a flash drive instead of the usual micro sd card that you normally boot off of all right so first off why would you want to do this well micro sd cards are notoriously prone to failures at the end of the day it's not really a question of if but really when if you run one long enough and while this is really not that big of a deal when you're using a raspberry pi for testing and setting up your own things and stuff like that however where it does become a really big deal is if you want a long-term automation process that is resilient so one of the biggest reasons is say you want to set up a raspberry pi as an off-site backup well if that sd card fails you're going to have to go in and re-format the entire thing and rebuild it instead you can boot that exact same operating system off of a flash drive which are far more resilient or you could even use an actual ssd which is going to give you even longer resiliency so this is a really good solution if you'd like to use your pi for more long-term projects and really don't want to have the failure rate of the micro sd cards affecting your pi another thing is ease of use and speed honestly i've got a ton of flash drives lying around and they're a lot easier to throw in my computer than a micro sd card is plus they're generally a lot faster and you can get much larger sizes so i do this because i'm constantly formatting and so i'm going to be using flash drives which are way easier to identify and store than those little micro sd cards which go everywhere so this is currently only available on raspberry pi 4s if you'd like to do a true boot just off of the flash drive if you have a previous model of a raspberry pi and you'd like to be able to do this there's different tutorials on how to do that but essentially what you do is you still have that micro sd card in there however basically what it does is it tells the operating system as it's booting up to okay as soon as it loads this program it starts to load off of the flash drive instead of that micro sd card this means you don't have nearly as many writes to that micro sd card so it's less likely to fail but if it fails it's still not going to be able to boot up due the fact that it has that command to boot up so that's just one thing to note but with a new raspberry pi bootloader software you can just do it straight without even a micro sd card in your raspberry pi 4. and so that's what i'm going to go ahead and show you all right and so for this tutorial all you're going to need is a raspberry pi power supply a flash drive and you still do need a micro sd card to set up the very first time and network access because we're going to have to update our raspberry pi all right so i've got my pi here and i've already got raspberry pi os loaded on here and so we're going to go ahead and boot it up and i'm going to go ahead and ssh into it so i'm just going to set that up now all right so the first thing we're going to need to do is go ahead and update the package links on our raspberry pi so i've gone ahead and ssh as you can see here so i'm just going to run a sudo apt update and this is going to update the package links this is not going to actually update any software it's just going to update the links for where software exists on the internet and so it's a good thing to run every couple of days whenever you're updating packages because that way you know you're getting the most recent version of everything all right and so now what we're going to do is we're going to do a sudo apt full upgrade to fully upgrade our operating system on our raspberry pi and this could take a little while and this is really important to make sure that we get the new bootloader which was released only about a month ago all right so that took quite a while but now our raspberry pi operating system has now been fully upgraded that means we're going to have that new bootloader so what we're going to do is we're going to set up the raspberry pi to first look for a micro sd card to boot off of and if it doesn't find one or if it fails it will then boot to the flash drive and so the way we're going to do that is we're going to do a sudo raspi that config and so all we're going to do here is go into advanced options go down to boot order and we're going to select usb boot and it'll say boot from usb device if sd card boot fails and we're just going to click on that and click enter alright and so now we've got that done so now we can just go ahead and click finish and we'll just go ahead and reboot now so now it's going to go ahead and reboot and once it boots back in i'll ssh back in all right and so now our raspberry pi is booted back up and i've ssh back in and now what we're going to do is we're going to make sure that the ee prompt gets updated by editing it but not actually editing it we're just going to say that we added it so make sure to flash the new eeprom to there and to do that we're going to type sudo dash e rat rpi dash we're going to edit it and so this right here is the eeproms configuration file essentially and all the inputs we have into it and really what we're looking at right here is this right here the all boot order so if you read the documentation boot order f41 means that first we're going to look for a appropriate micro sd card to boot off of and then if that fails we will look for a flash drive to boot off of which is exactly what you want if you wanted additional customization here you could do that but it's really not necessary for what we're doing and so to do that we're just going to hit ctrl x to exit and now it's going to make sure that the eeprom gets updated so we're just going to do a pseudo reboot and this will make sure to update the eeprom and so now all we need to do is hook up our flash drive to our computer and load the raspberry pi operating system on it so i'm going to do that now and so all we're going to do here is i'm going to select the raspberry pi os light and i'm going to choose this flash drive that i just plugged in my computer right here and we're going to write to it and it's going to take quite a while as it normally does but it will generally go faster than if you're writing to a micro sd card which is good all right so now it's finally verified the software and it automatically ejected it so i just plugged it back in and now i'm just going to write ssh to it that way it has a file in there called ssh so when it boots up it will automatically enable ssh to have a fully headless setup so now i'm just going to eject it and we're going to go ahead and plug it into our pi all right so i've got my raspberry pi right here and as you can see i've currently got the sd card in there and i'm just going to go ahead and pull it out and instead i'm going to plug in the flash drive directly into one of the usb ports if it's usb 3 you should plug in the blue ports as it'll be faster but it's really not that big of a deal it will be considerably faster and now i'm just going to go ahead and turn it on i will also say it's sometimes nice to have a monitor with this because sometimes it does fail to boot and it will tell you that it's doing that but right now i just have to trust it and hope that i see it on the network all right it appears to be up so that means it's worked let's go ahead and ssh in and it's going to drop an error because i've got signing turned off i really just need to turn sign turned off basically what this is saying is hey you've ssh in this before last time it had a different host key which is done to make sure that nobody switches out the machine and steals my password or anything like that but it's quite annoying if you're somebody like me who's constantly flashing new raspberry pi's and always having to delete this file so i just do a pseudo rm and the file path and then it forgets that it ever existed and now just enter the first time login which is raspberry and we're in we are now booting completely off of a flash drive without a micro sd card plugged in at all and so now this is just going to work and it's going to be a much more resilient solution if you want to have long term projects all right well really that's all there is to that video go ahead and leave any other raspberry pi tutorials you like see me make in the comments below and have a good one bye [Music] you
Info
Channel: SpaceRex
Views: 30,791
Rating: undefined out of 5
Keywords:
Id: NdhfZEzu1DY
Channel Id: undefined
Length: 8min 41sec (521 seconds)
Published: Sun Nov 22 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.