Boot From USB ! - Jetson Nano

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello it's jim from jetsanax.com on today's show we are setting up our jets and nano to boot from a usb drive [Music] jetpack 4.5 introduces a new much requested feature for the jetson nano line the ability to boot from a usb drive this video is broken into sections if you are only interested in the instructions to set up your jetson skip ahead it's tech talk time there are a couple of reasons to boot from usb first it is more reliable over the long term than using the microsd card sd cards aren't really designed to handle the files of an operating system and tend to be less reliable than usb drives in general the second reason is that usb is much faster than sd card speed usually between 4 to 10 times faster depending on the application this makes things much snappier usb drives are available in various flavors you'll see them as ssd which stands for solid state drive hdd which stands for hard disk drive and flash drive which are sometimes referred to as thumb drives for this application hdd is the most reliable long term ssd is an excellent alternative and is faster flash drives aren't as suitable to this application for much of the same reason as sd cards but some people still use them people also like the extra storage that many usb drives afford this makes it easy to store lots of programs and large amounts of data such as video files and large data models you will find some affiliate links in the description below to a couple of devices i use in this video we are using the venerable 250gb samsung t5 let's talk about formatting your usb drive here are some terms that you will see when we talk about drives on linux partitions gpt and ext4 sometimes the terms are jumbled together making them hard to understand physical devices consist of a collection of sectors these are the physical bits where data are stored software creates something known as a partition which maps and groups sectors together in that way each region of the device can be managed independently partition descriptions are stored in a partition table a physical drive can have one or more partitions because the partition is treated as a separate logical volume drives with multiple partitions appear as though they are multiple physical drives partitions are handy for storing things like file systems swap disks and so on you have heard the term format the drive before when we talk about formatting a drive for linux this is a two-step process first we format the drive to define the partition layout and then we format partitions for a specific use linux uses gpt for the layout of a partition table on a physical storage device using globally unique identifiers or guids it is the linux preferred partitioning system for drives larger than two terabytes this results in a table at a known location which tells the system where partitions are physically located on the drive in other words it's a map once the drive is partitioned we are ready to format a partition for the linux file system different partitions can have different format types this is how you might set up a dual boot windows and linux machine on a pc for example one partition for the windows file system and another for the linux file system for our jetson we want to format a partition as ext4 ext4 is a format for a journaling file system for linux we will put the root fs of the jetson on this partition root fs is simply the root file system we usually think about this as all of the files on the system now that we understand partitions let's talk about the changes that jetpack 4.5 brings in previous versions the system boots from information stored on specific partitions on the sd card you may have wondered why there are so many partitions on a jetson sd card that's part of the puzzle for you for jetpack 4.5 this changes somewhat on the jetsam module there is flash memory typically you will see this referred to as qspynor nor is a type of flash memory q-spy stands for quad serial protocol interface which is how you get data from the jets integra chip to the nor flash memory when jetpack goes through the setup process it transfers information to boot the system from the sd card to the q spy noir now the jetson module knows how to boot the system without having to read the sd card explicitly there are a couple more things to know if there is no sd card then the jetson will look to the usb drive for a root fs there are other devices which the jetson may be able to boot if they are set up correctly such as the nvme drive in our case we will just concern ourselves with the usb drive also there's a special file in the boot directory which tells linux where the root file system is located we will need to modify this file it's named ext linux.conf to point to the new location of the root in case you want to create your bootable usb drive on your host pc you can follow the instructions from nvidia here we are going to create the drive from the jetson itself this is a three-step process format the usb drive copy the contents of the root fs to the usb drive and then we will modify the ext linux configuration file to point to the usb drive partition which contains our root fs i set up the jetson with jetpack 4.5.1 which installs l4t 32.5.1 on the jetsonhacks nano account on github there is a repository named boot from usb let's clone that repository grab the address and switch over to that repositories directory [Music] clear that off let's read the instructions that's always useful we're on step two already let's prepare the usb drive i'll plug in the usb drive and let's open the disks app [Music] and here's our drive 250 gb we can see that i use master boot record for the partitioning this is typical of pc formatted disks let's format the disk and we will use compatible with modern systems and hard disks greater than two terabytes this is gpt format are you sure you want to format the disk yes please now we have our guid partitioning table let's create a partition we'll hit the plus here let's create a partition of 240 gbs we'll leave some space in case you want to have a swap partition next volume name jetson 2 250 that sounds fast and we want to make sure that we set the type to ext4 internal disk for use with linux systems only create okay so we see that we have a device that slash dev sda1 and we have a partition it's formatted ext4 on to step three copy the root fs to the usb drive so now we're getting ready to copy all our files over to the usb drive here's an important note it says make sure that your usb drive is mounted before running the script or the script will complain at you okay first let's take a look at our drive we can see that there's two devices here sda is the entire drive and sda1 is our partition if you don't see the sda1 that means that your partition has not been created correctly okay let's copy the route over to usb and give it a path unable to find the mount point just as predicted so let's mount the drive we can do this by opening up the file browser okay let's try it again i'll hit the up arrow give me my last command password you can see our drive is starting to populate it'll take a few minutes to copy over the entire contents of the sd card to the usb drive copy complete okay now we are ready to move on to the next step [Music] step four modify ext linux dot configuration for the boot sequence this is the tricky part pay attention we go to our usb drive which is jetson 250. we can tell because it sounds fast open up the boot folder open up the ext linux folder and now we are going to open a terminal [Music] let's make a copy of our original file we are in a system space so we need to use sudo and let's copy it over to dot original password and let's edit it we need sudo again g edit and here's our file so here's the key this is where we set up our root address let's make a copy of this and we'll call this sd card this is how we boot from the sd card we are going to default to primary which is here now we could say slash dev sda1 and that will work if we only have one usb drive however we want to be a little bit more specific in case we forget a flash drive or two in the usb slots so we are going to set this to be something a little bit different we are going to use part uuid which is the identifier from the partition table we have a little convenience script in the repository to help us [Music] so here's the part uuid it's this big string here if it's not some big string like this then something's wrong and you'll probably need to re-partition it so let's grab this entry copy and we'll paste it in here and let's save it okay so we should be good to go i'll shut down the jetson remove the sd card and reboot it and like magic it should boot from the usb drive wish me luck no microsd card what will happen next this is a good sign the cursor showed up jetson hacks password and here we are on our desktop running from the usb drive let's open up a terminal we will take a look at our block devices and we can see sda1 is slash which indicates the root fs will wonders never cease now we are running from our usb drive let's insert the sd card now you can see that it shows up here in the sidebar just remember that you have to have your usb drive plugged into the jetson when you boot it it's not a hot swap type of deal hey if you like this video give it a thumbs up and if you have not already please subscribe thanks for watching oh and stay safe [Music]
Info
Channel: JetsonHacks
Views: 11,604
Rating: undefined out of 5
Keywords:
Id: 53rRMr1IpWs
Channel Id: undefined
Length: 15min 3sec (903 seconds)
Published: Wed Mar 10 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.