jetson nano cloning and deployment of the image to other devices

Hi guys, sorry for the confusion, see this post regarding the MAC addresses:
https://devtalk.nvidia.com/default/topic/1055188/jetson-nano/mac-addresses/post/5348990/#5348990

1 Like

No, they both ended with 00:01, which should already have made me suspiciousā€¦

Thanks @dusty_nv for confirming this is not just a problem on my end.

I think I got one of the random units then (or from another batch).

Welp. That was confusing, and not something you see every day. Thanks again, Dusty.

@mdegans you were right about the /etc/network/interfaces stuff.
Thatā€™s a more stable solution than macchanger since it works before the network card is first connected.
otherwise it would do a short blip of connection before the init.d script is run.

To do this, I had to remove NetworkManager and ModemManager, which are installed by default on the image.
They seem to do some other config weirdness.
Then, set the config in /etc/network/interfaces, very similar to what you posted earlier, but including another line, where inet is replaced by inet6.

finally my nanos work as intended!

Many thanks to everyone in this thread who helped me figure stuff out.
Especially @mdegans for so much time you put into helping me

YW. Iā€™m glad you got it sorted out. That is some epic wierdness :) You now have two devices with the same mac address. Not many people can say that.

hi,

i want to create an image with specific environment that i setup on my current nano device, then use this image on other nano devices. is the quoted method above the way to go? because i have seen it only copies the main partition and i have seen that there are a total of 12 partitions on the SD card.

sorry i got confused about what is needed to be done, and i cant afford to have problems with my images.

thanks

Iā€™m interested in cloning my current nano as well. Iā€™m interested the solution Andrey1984 proposed but unsure if his theorectical exercise is still the way to go. Especially for deploying many nano devices and for the network issues aforementioned.

Does anyone have recommendations or should I do a blind copy with dd, re-add the boot scripts and patch the network collisions?

Hi All,

Iā€™m about to clone the currently working SD card to the similar or even a larger one. Could you confirm that dd /dev/oldcard to /dev/newcard or dd /dev/oldcard to image then dd image to /dev/newcard works?

Also could you tell me where to run the resize2fs script correctly? And what modification should be taken into consideration when running the image in new card, please ?

Thansk in advance for your help,
Khang

Khang,
I did a very similar thing using etcher on Windows, but thatā€™s essentially doing the same as dd.
I copied the sd to an img file, then from the img to the new sd.

As long as the new sd card is bigger (or at least the same size) than the old one, then you donā€™t need to shrink it.

You run resize2fs on the new install after booting it up and logging into it. So it should already boot fine without resize2fs, just not using all the space on the new sd.

Then there was a command in this thread for re-generating ssl keys and stuff so the new device doesnā€™t share crypto keys with the old one.

Also, using two cloned devices with the same hostname and network config might confuse your router, so be aware that might happen.

Correction: it was Win32DiskImager, not Etcher, but that will probably work fine too.

In this comment described my full procedure.
https://devtalk.nvidia.com/default/topic/1052070/jetson-nano/jetson-nano-cloning-and-deployment-of-the-image-to-other-devices/post/5348609/#5348609

Apart from the mac address weirdness, which was a hardware issue, that should work fine.

Many thanks to @Pyrestone for that. Iā€™ll give it a try this weekend.

I have one jetson nano sd card where the jetson image is flashed and some working modules,dependencies, libraries have been installed. It seems cloning of this sd card through dd clone is not possible. Even tried with commercial softwareā€™s,etcher and make the sd card as bin and copying to destination. The cloning is not done where in some cases it shows a static screen as bootable device not found continue where we are not able to do any operation. In other situation it shows nvidia icon and shows error as cannot set terminal process group (-1). How to make my sd card as a bootable one and clone it to destination card. (both sd cards are of 64 GB)

Iā€™ve said it before but I feel it needs reiteration. There is no safe way to clone a system image. Once the system is booted for the first time, certain irrevocable changes are made that would need to be made again on another system.

If you clone an image, your hostname would be the same, which would cause network conflicts. Your usernames and passwords would all be the same, raising security issues. Your ssh keys would all be the same, raising network and security issues. SSH will scream at you, for good reason. Your bash history will go along for the ride as well.

If you want a mostly exhaustive list of what must be reset, please see the virt-sysprep manpage. Virt-sysprep can probably also be used to clean a cloned image, returning it to itā€™s default state, but in the Nanoā€™s case you would also have to add certain Nvidia specific first boot scripts back into the image as well, since at least some of them (such as the fs resizing script) self delete after execution. Thereā€™s a lot more to be reset than you might think.

Your easiest option for deployment is to use Nvidiaā€™s tools to master your own image, modifying the rootfs directly before first boot. Instructions on how can be found in the Linux for Tegra documentation. For most, itā€™s a case of putting the scripts and packages you want in the rootfs folder within the Linux_for_Tegra folder installed by SDK Manager and running ā€œcreate-jetson-nano-sd-card-image.shā€ to master an image you can flash safely onto any number of devices.

I also have MAC as :

ether 00:e0:4c:68:00:01  txqueuelen 1000  (Ethernet).

Is it a hardware bug?

We are preparing a Jetson Nano SD card image containing specific software and libraries for the event, which method is best for this please give me suggestion?

I would disconnect microsdcard and use x86_64 ubuntu host pc with cardreader & dd;
it is a matter of taste, however, which method to use, in my opinion

Hi All,

Thereā€™s been a great deal of investigation in this thread over the course of a year, and some people have claimed success at using a copy of one nano image to build other devices, with all of the first boot changes being done that need to be.

Whatā€™s not here is a step-by-step set of instructions for how to do that, and given all of the exploration and slightly different circumstances of the posters, I donā€™t see a clearly defined path for:

  1. Taking an existing nano called A thatā€™s got everything you need on it to deploy many more of the same device
  2. Copying/cloning/ddā€™ing/etc the image of A to an image on a hard drive that is not the nano
  3. Running a script that updates the image of A with the necessary firstboot differences for SSH keys, MAC, whatever to create an image that can now be flashed to SD cards for nano B, C, D, ā€¦
  4. Etching that new image onto SD card(s)
  5. Booting those new image(s) in nano B, C, D, ā€¦ to have a fleet of edge device nanos for use

Does this set of steps (and the script/commands to run) exist somewhere in the nvidia forums or elsewhere? I donā€™t know linux well enough to pick and choose from among all of the entries on this important thread to piece together this how-to, but it sounds like some posters here have probably already done it. Any help would be greatly appreciated!

3 Likes

@mdegans @dusty_nv Thanks for the discussion in this post! I think many is sitting after reading this thread and recoginizes that just using dd, will result in several problems. But the thread could be closed by creating a walkthrough that nicely answers these 5 questions. Im also sitting here myself trying to figure out how to go about distributing my code to multiple jetsons for a production task, but the only answer I have from this thread is that dd is not enough to do it :)

Kind regards Mads

what makes it more complicated is that any solution needs to be maintaimed as they are getting continiously obsolete
so any described method would work only by the time its writing has been finished, but for further software releases it might turn out not supported or obsolete already

That is very true, but this is a really important feature for taking a product to production. @Andrey1984 have you been able to verify that your method described earlier off:

dd if=/dev/mmcblk0p1 of=testimage.raw
./mksparse -v --fillpattern=0 ~/testimage.raw system.img
sudo ./flash.sh -r jetson-nano mmcblk0p1

Works in practice also?

I have trained a custom ssd model, and implemented some other code, that I want to implement on another three jetsons ;)