Ajeet Raina Docker Captain, ARM Innovator & Docker Bangalore Community Leader.

How to Boot NVIDIA Jetson Nano from USB instead of SD card

3 min read

 

Booting from a SD card is a traditional way of running OS on NVIDIA Jetson Nano 2GB model and it works really great. But what if you’re running out of disk space. Say, you are running AI-based heavy-duty container workloads on your 16GB SD card and suddenly, you find that these gigs of container images are eating up your disk space. Ask Nvidia support team and they might suggest to get the new SD card with the larger disk space. But I have got a workaround for you with the existing SD card and here goes the story…

But Wait… What is NVIDIA Jetson Nano 2GB?

The NVIDIA Jetson Nano 2GB Developer Kit is the ideal platform for teaching, learning, and developing AI and robotics applications. It uses the same proven NVIDIA JetPack Software Development Kit (SDK) used in breakthrough AI-based products. The new developer kit is unique in its ability to utilise the entire NVIDIA CUDA-X™ accelerated computing software stack including TensorRT for fast and efficient AI inference — all in a small form factor and at a significantly lower price.

Hardware

  • Jetson Nano
  • A Camera Module
  • A 5V 4Ampere Charger
  • 32GB SD card

Software

Preparing Your Jetson Nano

1. Preparing Your Raspberry Pi Flashing Jetson SD Card Image

  • Unzip the SD card image
  • Insert SD card into your system.
  • Bring up Etcher tool and select the target SD card to which you want to flash the image.
My Image

Once the flashing is done, just insert SD card into Jetson Nano SD card slot and let it boot the OS.

 

Preparing the USB

Insert the 64GB USB storage device to the Jetson Nano device.

Formatting the USB Drive using Linux Command

To simplify the steps for formatting the USB drive using command line, make sure that you only have one USB drive being connected to the Jetson Nano. Firstly, we need to search for the device path of the USB drive by entering the command in the terminal:

$ sudo parted -l

We have to obtain the optimal IO size and physical block size of the USB drive by entering the 2 commands below (you have to change the term “sda” into the device path as obtained from the previous step):

$ cat /sys/block/sda/queue/optimal_io_size
$ cat /sys/block/sda/queue/physical_block_size

After obtaining the number of sector, it’s time to format the USB drive. Make sure that there are no important files inside before proceeding to the next step!

$ sudo parted /dev/sda
$ mklabel gpt

You might be prompted to confirm the formatting, just enter “y” for confirmation. After formatting, we need to create the partition in the USB drive. Replace the  variable with the number of sector which we calculated earlier.

$ mkpart primary ext4 s 100%

Press ctrl + D to exit the parted command line. Then, we have to properly format the partition we created earlier to ext4 file system. Make sure that you change the term “sda” into the device path being obtained previously.

$ mkfs.ext4 /dev/sda1
$ sudo parted -l

Look for the device path of the USB drive, in this case it is “/dev/sda”. Search for the USB drive again. If all of the steps are taken correctly, you will see that the Partition Table is set to “gpt” and the file system for the partition is “ext4” as shown in the image above.

ajeetraina@ajeetraina-desktop:~$ sudo mount /dev/sda1 /mnt/usbboot
[sudo] password for ajeetraina: 
ajeetraina@ajeetraina-desktop:~$ sudo df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p1   15G   12G  2.6G  82% /
none            947M     0  947M   0% /dev
tmpfs           986M  4.0K  986M   1% /dev/shm
tmpfs           986M   27M  960M   3% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           986M     0  986M   0% /sys/fs/cgroup
tmpfs           198M  4.0K  198M   1% /run/user/121
tmpfs           198M     0  198M   0% /run/user/1000
/dev/sda1        29G   12G   16G  43% /mnt/usbboot

Cloning the repository

git clone https://github.com/jetsonhacks/bootFromUSB

 

ajeetraina@ajeetraina-desktop:~/bootFromUSB$ ./copyRootToUSB.sh -p /dev/sda1
Device Path: /dev/sda1
Target: /mnt/usbboot
..
Setting up rsync (3.1.2-2.1ubuntu1.2) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for systemd (237-3ubuntu10.50) ...
 11,511,169,692  95%   17.93MB/s    0:10:12 (xfr#142716, to-chk=0/205797)   
ajeetraina@ajeetraina-desktop:~/bootFromUSB$ 

Copy the below content and put it in extlinux.conf file as shown below:

ajeetraina@ajeetraina-desktop:/mnt/usbboot/boot/extlinux$ cat extlinux.conf
TIMEOUT 30
DEFAULT sdcard

MENU TITLE L4T boot options
# Sample extlinux.conf file for booting from USB
# You will need to set the root environment variable to match your system
#
# You can set the root to various levels of specificity
# If you have multiple USB storage devices, the PARTUUID approach is very useful
# PARTUUID is the PARTUUID of the USB device; most exact - recommended
# LABELNAME is a little more specific; root=LABEL=jetson_drive
# /dev/sda1 is the most general; root=/dev/sda1
# Note: The UUID options seems to have some issues on the Jetson
LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/Image
      INITRD /boot/initrd
      APPEND ${cbootargs} quiet root=PARTUUID=32a76e0a-9aa7-4744-9954-dfe6f353c6a7 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 

# When testing a custom kernel, it is recommended that you create a backup of
# the original kernel and add a new entry to this file so that the device can
# fallback to the original kernel. To do this:
#
# 1, Make a backup of the original kernel
#      sudo cp /boot/Image /boot/Image.backup
#
# 2, Copy your custom kernel into /boot/Image
#
# 3, Uncomment below menu setting lines for the original kernel
#
# 4, Reboot

LABEL sdcard
      MENU LABEL primary kernel
      LINUX /boot/Image
      INITRD /boot/initrd
      APPEND ${cbootargs} quiet root=/dev/sda1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 

That’s it. Now remove the SD card and let your Jetson nano boot from USB drive

ajeetraina@ajeetraina-desktop:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        29G   12G   16G  43% /
none            947M     0  947M   0% /dev
tmpfs           986M   40K  986M   1% /dev/shm
tmpfs           986M   27M  960M   3% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           986M     0  986M   0% /sys/fs/cgroup
tmpfs           198M  8.0K  198M   1% /run/user/1000
ajeetraina@ajeetraina-desktop:~$ 

Yay! I was able to boot Jetson Nano from USB instead of SD card

Further Read:

Have Queries? Join https://launchpass.com/collabnix

Ajeet Raina Docker Captain, ARM Innovator & Docker Bangalore Community Leader.

57 Replies to “How to Boot NVIDIA Jetson Nano from USB instead…”

  1. Woah! I’m really enjoying the template/theme of this blog. It’s simple, yet effective. A lot of times it’s hard to get that “perfect balance” between usability and visual appeal. I must say that you’ve done a amazing job with this. In addition, the blog loads very quick for me on Safari. Exceptional Blog!

  2. Hi there! This post couldn’t be written any better! Reading through this post reminds me of my previous room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thank you for sharing!

  3. Once I originally commented I clicked the -Notify me when new feedback are added- checkbox and now every time a remark is added I get four emails with the identical comment. Is there any way you can take away me from that service? Thanks!

  4. Hey! This is kind of off topic but I need some advice from an established blog. Is it very hard to set up your own blog? I’m not very techincal but I can figure things out pretty fast. I’m thinking about setting up my own but I’m not sure where to begin. Do you have any points or suggestions? Thank you

  5. Wow! This could be one particular of the most useful blogs We have ever arrive across on this subject. Actually Great. I’m also a specialist in this topic therefore I can understand your hard work.

  6. Hiya very nice web site!! Guy .. Beautiful .. Superb .. I will bookmark your website and take the feeds also?KI am happy to find a lot of useful information here within the post, we’d like develop extra strategies in this regard, thank you for sharing. . . . . .

  7. Thanks for another informative blog. The place else may just I am getting that type of info written in such an ideal means? I have a mission that I’m simply now operating on, and I’ve been at the glance out for such info.

  8. Hello very cool site!! Guy .. Excellent .. Superb .. I’ll bookmark your blog and take the feeds also?KI am glad to find numerous helpful information right here within the post, we want develop more strategies in this regard, thanks for sharing. . . . . .

  9. Do you mind if I quote a couple of your articles as long as I provide credit and sources back to your website? My blog is in the very same niche as yours and my visitors would truly benefit from a lot of the information you provide here. Please let me know if this alright with you. Regards!

  10. I really like your writing style, excellent information, appreciate it for posting :D. “In every affair consider what precedes and what follows, and then undertake it.” by Epictetus.

  11. You have remarked very interesting details! ps decent internet site. “Mediocrity knows nothing higher than itself, but talent instantly recognizes genius.” by Conan Doyle.

  12. I would like to thnkx for the efforts you have put in writing this blog. I am hoping the same high-grade blog post from you in the upcoming as well. In fact your creative writing abilities has inspired me to get my own blog now. Really the blogging is spreading its wings quickly. Your write up is a good example of it.

  13. I’m really enjoying the design and layout of your site. It’s a very easy on the eyes which makes it much more enjoyable for me to come here and visit more often. Did you hire out a designer to create your theme? Superb work!

  14. I¦ve been exploring for a little bit for any high quality articles or weblog posts in this kind of house . Exploring in Yahoo I finally stumbled upon this website. Studying this information So i¦m glad to exhibit that I’ve an incredibly excellent uncanny feeling I came upon just what I needed. I such a lot surely will make sure to do not overlook this site and provides it a glance regularly.

  15. Thanks for the sensible critique. Me & my neighbor were just preparing to do some research about this. We got a grab a book from our local library but I think I learned more clear from this post. I’m very glad to see such excellent information being shared freely out there.

  16. Please let me know if you’re looking for a writer for your weblog. You have some really great posts and I think I would be a good asset. If you ever want to take some of the load off, I’d absolutely love to write some articles for your blog in exchange for a link back to mine. Please send me an email if interested. Kudos!

  17. Great ?V I should certainly pronounce, impressed with your website. I had no trouble navigating through all the tabs as well as related information ended up being truly simple to do to access. I recently found what I hoped for before you know it in the least. Quite unusual. Is likely to appreciate it for those who add forums or something, web site theme . a tones way for your client to communicate. Nice task..

  18. Nice blog here! Also your web site rather a lot up fast! What web host are you the use of? Can I get your associate hyperlink for your host? I wish my site loaded up as quickly as yours lol

  19. Results for travestiti. Similar searches crossdresser sissy travest french trav travesti travestis teen crossdresser sissy centoxcento crossdressing husband chicks with dicks crossdresser orgy
    shemalle travestis crossdresser sex crossdresser russian sissy crossdressers crossdresser transex amador crossdressing sissy crossdresser
    girls with.

  20. Good – I should certainly pronounce, impressed with your site. I had no trouble navigating through all tabs and related information ended up being truly simple to do to access. I recently found what I hoped for before you know it in the least. Reasonably unusual. Is likely to appreciate it for those who add forums or something, site theme . a tones way for your customer to communicate. Excellent task..

  21. Hi there, I discovered your site by the use of Google at the same time as searching for a similar matter, your web site came up, it seems to be great. I have bookmarked it in my google bookmarks.

  22. Hello there, just become alert to your weblog through Google, and found that it’s truly informative. I’m gonna watch out for brussels. I will be grateful if you happen to continue this in future. A lot of other folks will probably be benefited out of your writing. Cheers!

  23. Just about all of what you articulate is supprisingly legitimate and it makes me wonder the reason why I had not looked at this with this light before. This particular piece truly did turn the light on for me as far as this topic goes. However there is one factor I am not really too comfortable with and whilst I make an effort to reconcile that with the actual central idea of your point, allow me see just what all the rest of your visitors have to point out.Well done.

  24. Hello there, just become alert to your blog thru Google, and found that it is really informative. I’m going to be careful for brussels. I’ll appreciate in the event you continue this in future. Numerous other folks will likely be benefited from your writing. Cheers!

  25. F*ckin’ remarkable things here. I’m very satisfied to peer your post. Thanks a lot and i’m taking a look forward to touch you. Will you kindly drop me a e-mail?

  26. This is the right blog for anyone who wants to find out about this topic. You realize so much its almost hard to argue with you (not that I actually would want…HaHa). You definitely put a new spin on a topic thats been written about for years. Great stuff, just great!

Leave a Reply

Your email address will not be published.

© Copyright Collabnix Inc

Built for Collabnix Community, by Community