Hi! I want to create an image of Jetson Nano system. I’m trying to do it by using the “dd” command. The problem is that this command copies the whole structure of the card. I need that the Gb of the image are less than the card capacity so that I can copy the image also on a different card or a card with less Gb. I used PiShrink on Raspberry Pi to do this but for Jetson Nano I don’t know how to do it. Thanks
I need that the Gb of the image are less than the card capacity so that I can copy the image also on a different card or a card with less Gb
Sorry that I don’t get the point of this line. Please describe more. It sounds like you don’t want to copy the whole cards.
Thank you and good day
So, probably the best way to do it would be to back up your changes from your existing SD card, copy what you need to the /rootfs/ folder under Linux_for_Tegra and use the script mentioned in the thread linked by Wayne (jetson-disk-image-creator.sh) to create a new sd card image from the /rootfs/ folder. That’s a good way to edit a system before first boot.
If you’re restoring to the exact same device, you can probably (from a Linux Desktop) use something like gnome-disks or gparted to resize the last partition on the SD card, make a disk image, resize it, then flash that to a smaller card. I’ve never done this, specifically, but others have and might give you some better advice.
The reason you might not want to restore the same image to another device is that once first boot happens, many unique things are set (machine-id, host ssh keys, hostname, etc…) which you do not want to share between machines. This applies to most OSes, if not all. Otherwise it can lead to network and security issues among other random, unexpected, problems.
I am one of those people who believe that it’s better to do it the “right way” or not at all. I feel it’s good to practice, even when it’s not strictly needed, so feel free to ignore me if you feel these concerns do not apply to your use case. Plenty of people have shrunk their system images for development/home use; however, it’s probably not a good idea for production. Here’s a thread with some details on the shrinking process:
Added note on naming conventions…
If you run “lsblk -f”, and you see the SD card as “mmcblk1”, then the first partition is “mmcblk1p1”, the second partition is “mmcblk1p2”, so on. “dd” will work with an entire device (e.g., “/dev/mmcblk1”), or any single partition (e.g., “/dev/mmcblk1p1”). Just name the specific partition and only that partition will be copied.
Do note that actual boot requires more than a rootfs, but it is the rootfs in need of backup since the other partitions are standardized.