Qengineering / Jetson-Nano-Ubuntu-20-image

Jetson Nano with Ubuntu 20.04 image
https://qengineering.eu/install-ubuntu-20.04-on-jetson-nano.html
BSD 3-Clause "New" or "Revised" License
702 stars 74 forks source link

can I install it in external SSD and run it from there ? #32

Open RamaManohar5 opened 1 year ago

RamaManohar5 commented 1 year ago

can I install it in external SSD and run it from there ?

Qengineering commented 1 year ago

Unfortunately not. I've tried several different approaches and never succeeded. Please let me know if you have more luck

RamaManohar5 commented 1 year ago

Hi, thanks for the response. I've found the solution to run this ubunut 20.04 image from SSD. we just need to copy data to SSD using bootfromUSB and then mount it. we have to make changes in SD card boot extlinux.conf (set SSD partuuid as root). and don't remove the SD card. I am able to boot from SSD.

podfrogs commented 1 year ago

I am running on a USB stick. Requires a few tricky configurations and reboots. 1) After connecting the USB stick, create fs and mount it (say /mnt/usb1). Then update etc/fstab (on the SD card which is mounted as /) to automatically mount the USB stick. sudo blkid can be used to get the UUID for this. Also not the device (example: /dev/sda1) Then Reboot. 2) The USB stick should be automatically mounted to mnt/usb1. At this point, run sudo rsync -axv / /mnt/usb1 that copies all files from SD card to the USB stick After the copy completes, reboot. There may be errors, ignore and reboot. 3) After rebooting, repeat the command again sudo rsync -axv / /mnt/usb1 . Any remaining file will be incrementally copied. At this point, there should no errors. Edit /boot/extlinux/extlinux.conf Copy all lines under LABEL primary into another section and rename it as LABEL sdcard Edit the APPEND line on the "primary" section and change the root device to root=/dev/sda1 (instead of sdcard root=/dev/mmcblk0p1) Save. DO NOT REBOOT at this time. Edit /etc/fstab and mount the USB to / and mount the SD Card to /mnt/sdcard (make sure this directory exists) Save. DO NOT REBOOT at this time. Check fstab with sudo findmnt --verify If no errors, copy /boot/extlinux/extlinux.conf to /mnt/usb1/boot/extlinux/extlinux.conf and also copy /etc/fstab to /mnt/usb1/etc/fstab At this point, the extlinux.conf & fstable on SD Card and USB will be the same. Reboot. Jetson Nano will run on usb. Check the mounts. USB will be mounted to / and SD card will be mounted to /mnt/sdcard . You may rsync files directly from /mnt/sdcard to another USB if you want to change the drive

trx1138 commented 1 year ago

@RamaManohar5 @Qengineering

Unfortunately not. I've tried several different approaches and never succeeded. Please let me know if you have more luck

I made it to boot straight to a usb without a sdcard. following is just a log of what I did to make it work and ended repeated trials. some of these could be irrelevant.

  1. flash pre-built image TWICE. once to the usb drive and another to the sdcard.
  2. boot to sdcard then format usb root(/dev/sda1) with ext4, write down uuid of the newly formatted patition then mount. (/mnt/usb1)
  3. rsync clone sdcard's root to usb like @podfrogs mentioned. reboot and clone again to make sure. >> sudo rsync -axv / /mnt/usb1
  4. edit /mnt/usb1/extlinux.conf like the example in this post. https://collabnix.com/how-to-boot-nvidia-jetson-nano-from-usb-instead-of-sd-card/
  5. remove sdcard then reboot. voila!

interesting part which draws attention is extlinux.conf edit in step #4. there's TWO entry blocks, one labeled as primary with uuid and another labeled as sdcard with device path but in fact both entries are pointing the same device. and it's a bit weird too to make it default to boot sdcard, but... anyways it works.

I'm suspecting #1 and #4 could be the key elements which affected the result but not sure.

ps. thanks for great works including this prebuilt img. got helped many times so far. ;D

replicatesyndicate commented 11 months ago

One convenient approach that I've found modifies @trx1138 's method:

gth-42 commented 9 months ago

Another take on the instructions:

"Flash" to device:
I use Ubuntu's Startup Disk Creator {usb-creator-gtk}, or equivalent. No need for pre-partitioning, formatting, or other rituals. SDC creates a GPT partition and dumps the contents correctly regardless of what's on the drive.

To access the newly created filesystem from the same host, you may need to make yourself owner or find another way get RW permissions. This is where plugging the drive into a working Nano (e.g. w/SD) might be helpful in some cases.

From the mount point (or removable drive in browser), open /boot/extlinux/extlinux.conf in a text-ONLY editor (e.g. mousepad). Make a copy of that whole "LABEL primary" block. Change the LABEL on one of them to "backup" or equivalent. What we need is the partition UUID rather than the one for the disk. "Disks", to my knowledge, doesn't give you the PARTUUID. I use: blkid /dev/sdb1 copy the whole "PARTUUID="..." block, and paste it next to "root=" in place of /dev/mmcblk0p1, then remove the quotes. My resulting file looks something like:

TIMEOUT 30 DEFAULT primary

MENU TITLE L4T boot options

LABEL primary MENU LABEL primary kernel LINUX /boot/Image INITRD /boot/initrd APPEND ${cbootargs} quiet root=PARTUUID=5ac8Od7c-40fb-47x6-bd56-4110q389819b rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0

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

Save the file, safely eject, and hang on to your hat. 1TB NVME in a USB enclosure works great with a proper-spec cable. I haven't tried a key adapter for the slot under the card -- yet.

Optionally, resize the partition prior to first boot while the drive is still plugged in to the host.

If extlinux.conf is still read-only, figure out how to get permissions. I suspect the big kicker with online "tutorials" is confusion about drive vs partition UUID and syntax.

I'm not sure about jetpack version 4.5+ and flashing the "QSPI-NOR" first. Trying Nvidia's image with 4.6.x first (going through setup), getting irritated, and trying @Qengineering's image with a change to extlinux.conf worked great for me. I don't know the state of my QSPI-NOR prior to the aforementioned.

mitchross commented 7 months ago

Another take on the instructions:

"Flash" to device: I use Ubuntu's Startup Disk Creator {usb-creator-gtk}, or equivalent. No need for pre-partitioning, formatting, or other rituals. SDC creates a GPT partition and dumps the contents correctly regardless of what's on the drive.

To access the newly created filesystem from the same host, you may need to make yourself owner or find another way get RW permissions. This is where plugging the drive into a working Nano (e.g. w/SD) might be helpful in some cases.

From the mount point (or removable drive in browser), open /boot/extlinux/extlinux.conf in a text-ONLY editor (e.g. mousepad). Make a copy of that whole "LABEL primary" block. Change the LABEL on one of them to "backup" or equivalent. What we need is the partition UUID rather than the one for the disk. "Disks", to my knowledge, doesn't give you the PARTUUID. I use: blkid /dev/sdb1 copy the whole "PARTUUID="..." block, and paste it next to "root=" in place of /dev/mmcblk0p1, then remove the quotes. My resulting file looks something like:

TIMEOUT 30 DEFAULT primary

MENU TITLE L4T boot options

LABEL primary MENU LABEL primary kernel LINUX /boot/Image INITRD /boot/initrd APPEND ${cbootargs} quiet root=PARTUUID=5ac8Od7c-40fb-47x6-bd56-4110q389819b rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0

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

Save the file, safely eject, and hang on to your hat. 1TB NVME in a USB enclosure works great with a proper-spec cable. I haven't tried a key adapter for the slot under the card -- yet.

Optionally, resize the partition prior to first boot while the drive is still plugged in to the host.

If extlinux.conf is still read-only, figure out how to get permissions. I suspect the big kicker with online "tutorials" is confusion about drive vs partition UUID and syntax.

I'm not sure about jetpack version 4.5+ and flashing the "QSPI-NOR" first. Trying Nvidia's image with 4.6.x first (going through setup), getting irritated, and trying @Qengineering's image with a change to extlinux.conf worked great for me. I don't know the state of my QSPI-NOR prior to the aforementioned.

this worked great!

pete-789 commented 5 months ago

Another take on the instructions:

"Flash" to device: I use Ubuntu's Startup Disk Creator {usb-creator-gtk}, or equivalent. No need for pre-partitioning, formatting, or other rituals. SDC creates a GPT partition and dumps the contents correctly regardless of what's on the drive.

To access the newly created filesystem from the same host, you may need to make yourself owner or find another way get RW permissions. This is where plugging the drive into a working Nano (e.g. w/SD) might be helpful in some cases.

From the mount point (or removable drive in browser), open /boot/extlinux/extlinux.conf in a text-ONLY editor (e.g. mousepad). Make a copy of that whole "LABEL primary" block. Change the LABEL on one of them to "backup" or equivalent. What we need is the partition UUID rather than the one for the disk. "Disks", to my knowledge, doesn't give you the PARTUUID. I use: blkid /dev/sdb1 copy the whole "PARTUUID="..." block, and paste it next to "root=" in place of /dev/mmcblk0p1, then remove the quotes. My resulting file looks something like:

TIMEOUT 30 DEFAULT primary

MENU TITLE L4T boot options

LABEL primary MENU LABEL primary kernel LINUX /boot/Image INITRD /boot/initrd APPEND ${cbootargs} quiet root=PARTUUID=5ac8Od7c-40fb-47x6-bd56-4110q389819b rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0

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

Save the file, safely eject, and hang on to your hat. 1TB NVME in a USB enclosure works great with a proper-spec cable. I haven't tried a key adapter for the slot under the card -- yet.

Optionally, resize the partition prior to first boot while the drive is still plugged in to the host.

If extlinux.conf is still read-only, figure out how to get permissions. I suspect the big kicker with online "tutorials" is confusion about drive vs partition UUID and syntax.

I'm not sure about jetpack version 4.5+ and flashing the "QSPI-NOR" first. Trying Nvidia's image with 4.6.x first (going through setup), getting irritated, and trying @Qengineering's image with a change to extlinux.conf worked great for me. I don't know the state of my QSPI-NOR prior to the aforementioned.

Excuse my ignorance, but are you editing the extlinux.conf file that is on the original Nano, or the one on the new external SSD?

Many thanks!