Unable to boot from SD card when using Jetpack 4.3

Hi,

I tried to boot Jetson AGX Xavier from SD card by referring to the following URL.

https://devtalk.nvidia.com/default/topic/1044524/jetson-agx-xavier/how-to-boot-from-sd-card-/

But, it doesn’t work with Jetpack 4.3.
It works with Jetpack 4.2.3 in the same way.

Has the method of booting from SD card changed?

Hi Mamo_W,

For JetPack-4.3, please follow Topic-1060950 steps to flash on external device.

Hi carolyuu,

Thank you for your reply!
I tried the following steps, but failed to execute flash.sh.

1). Format my SD card with an Ext4 file system
$ sudo mkfs.ext4 /dev/sdb1
2). Get the UUID for the partition on the external device. For example, if the device partition is /dev/sda1, then execute ...
$ sudo blkid /dev/sdb1
/dev/sdb1: UUID="8c60a785-c617-4488-80ae-93d78a130a10" TYPE="ext4" PARTUUID="0004067a-01"
3). Write the PARTUUID shown from the previous command to the following file ...
$ echo '0004067a-01' > bootloader/l4t-rootfs-uuid.txt
4). Copy the rootfs folder to your sdcard (/dev/sdb1)
5). Flash the board:
$ sudo ./flash.sh jetson-xavier external
###############################################################################
# L4T BSP Information:
# R32 , REVISION: 3.1
###############################################################################
# Target Board Information:
# Name: jetson-xavier, Board Family: t186ref, SoC: Tegra 194, 
# OpMode: production, Boot Authentication: NS, 
###############################################################################
.
.
.
File <jetpack_download_folder>/Linux_for_Tegra/bootloader/l4t-rootfs-uuid.txt contains invalid UUID!

Are there any wrong steps?

If the disk/SD card is on your host PC, then what do you get for (assuming it is /dev/sdb for the SD card, but adjust to the whole disk for your case):

lsblk -f /dev/sdb

The UUID may end up being something other than what you see as the PARTUUID. At least it is easy to check.

Note that if you run “lsblk -f” with nothing else on a system with several disks that the “UUID” column from “lsblk -f” is listed per partition, which is what you want, versus an ID for an entire disk.

Hello linuxdev,

Thank you for your advice.

I’m sorry. I found my mistake.
My SD Card is “MBR Only”.

By following steps, I was able to boot Xavier from SD card.

1). Create GPT and partition
$ sudo gdisk /dev/sdb
GPT fdisk (gdisk) version 1.0.1

Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: not present


***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!
***************************************************************


Warning! Secondary partition table overlaps the last partition by
33 blocks!
You will need to delete this partition or resize it in another utility.

Command (? for help): <b>o</b>
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): <b>Y</b>

Command (? for help): <b>n</b>
Partition number (1-128, default 1): 
First sector (34-124735454, default = 2048) or {+-}size{KMGTP}: 
Last sector (2048-124735454, default = 124735454) or {+-}size{KMGTP}: 
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): 
Changed type of partition to 'Linux filesystem'

Command (? for help): <b>p</b>
Disk /dev/sdb: 124735488 sectors, 59.5 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 4A98C2A6-8A2A-4912-88C4-C543669BEDE8
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 124735454
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048       124735454   59.5 GiB    8300  Linux filesystem

Command (? for help): <b>x</b>

Expert command (? for help): <b>c</b>
Using 1
Enter the partition's new unique GUID ('R' to randomize): <b>R</b>
New GUID is BB365F5D-420B-4914-8E49-F2BC1E0C6C2B

Expert command (? for help): <b>w</b>

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): <b>Y</b>
OK; writing new GUID partition table (GPT) to /dev/sdb.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.

2). Remove the SD card from the host PC and insert it again.

3). Format the SD card with an Ext4 file system
$ sudo mkfs.ext4 /dev/sdb1

4). Get the UUID for the partition on the external device.
$ sudo blkid /dev/sdb1
/dev/sdb1: UUID="0e916beb-d223-4b7d-90d6-1318651af429" TYPE="ext4" PARTLABEL="Linux filesystem" PARTUUID="bb365f5d-420b-4914-8e49-f2bc1e0c6c2b"

5). Write the PARTUUID shown from the previous command to the following file ...
$ echo 'bb365f5d-420b-4914-8e49-f2bc1e0c6c2b' > bootloader/l4t-rootfs-uuid.txt

6). Copy the rootfs folder to your sdcard (/dev/sdb1)

7). Flash the board:
$ sudo ./flash.sh jetson-xavier external

Hello linuxdev, Mamo_W,

I am not able to get 16 digit PARTUUID.
I followed your procedure

SDcard is 32GB from Sandisk --> /dev/sdb1

lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
loop0 squashfs /snap/core/8268
loop1 squashfs /snap/gtk-common-themes/1353
loop2 squashfs /snap/core18/1288
loop3 ext4 0470dae8-8d1a-42d1-899f-77ebf30241e4 /home/parashuram/nvidia/nvidia_sdk/JetPack_4.3_Linux_P3310/Linux_for_Tegra/bootloader/mnt
sdb
└─sdb1 ext4 f4838935-2770-43ca-a7c7-f5460b54e4c3 /media/parashuram/f4838935-2770-43ca-a7c7-f5460b54e4c3
sdd
├─sdd1 vfat C481-64C5 /boot/efi
└─sdd2 ext4 887cd758-4e3f-4f01-ac7f-a5b2da1d34a2 /
sr0

parashuram@elma:~ sudo blkid /dev/loop0: TYPE="squashfs" /dev/loop1: TYPE="squashfs" /dev/loop2: TYPE="squashfs" /dev/sdd1: UUID="C481-64C5" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="ab159ff0-d6a2-4918-961e-f7cdd0c24fee" /dev/sdd2: UUID="887cd758-4e3f-4f01-ac7f-a5b2da1d34a2" TYPE="ext4" PARTUUID="64af4e6a-927a-4606-8ca4-3c2d0bb32245" /dev/sdb1: PTUUID="590d81a6-92d2-42f7-b3fd-139fcceab982" PTTYPE="gpt" PARTUUID="e9285a85-01" /dev/loop3: UUID="0470dae8-8d1a-42d1-899f-77ebf30241e4" TYPE="ext4" parashuram@elma:~ sudo gdisk /dev/sdb1
GPT fdisk (gdisk) version 1.0.3

Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): o
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): y

Command (? for help): n
Partition number (1-128, default 1):
First sector (34-62330846, default = 2048) or {±}size{KMGTP}:
Last sector (2048-62330846, default = 62330846) or {±}size{KMGTP}:
Current type is ‘Linux filesystem’
Hex code or GUID (L to show codes, Enter = 8300):
Changed type of partition to ‘Linux filesystem’

Command (? for help): p
Disk /dev/sdb1: 62330880 sectors, 29.7 GiB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 3EFB9BAA-3513-4332-BD3A-56822C21A1F5
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 62330846
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number Start (sector) End (sector) Size Code Name
1 2048 62330846 29.7 GiB 8300 Linux filesystem

Command (? for help): x

Expert command (? for help): c
Using 1
Enter the partition’s new unique GUID (‘R’ to randomize): R
New GUID is 330B35F6-EA11-4172-92CE-AA0ECAAF7C78

Expert command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sdb1.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
parashuram@elma:~ ls Airtel_bill.pdf cuda-workspace dongle.sh flash.sh imp_links.txt minicom.log nvidia Public tags toolchain.c Archer_T2UH_Linux Default_pinmux Downloads GPIO_DPSK jetson mozilla.pdf paytm_bill.pdf rtl8812au-1 Templates u-boot backup Desktop emmc_log.txt gpio_tca9539 kernel_panic mt7610u-linksys-ae6000-wifi-fixes personal.txt sd_acrd_diff_mmcbl2.txt test USB3.0 cscope.out Documents examples.desktop HOST.git l4t-gcc Music Pictures sdcard_bootlog.txt tets.txt Videos parashuram@elma:~ sync
parashuram@elma:~$ sudo mkfs.ext4 /dev/sdb1
mke2fs 1.44.1 (24-Mar-2018)
Found a gpt partition table in /dev/sdb1
Proceed anyway? (y,N) y
Creating filesystem with 7791360 4k blocks and 1949696 inodes
Filesystem UUID: 8d7961fe-4cce-4c23-8ba7-7eb802afbf4c
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

parashuram@elma:~ sudo blkid /dev/sdb1 /dev/sdb1: UUID="8d7961fe-4cce-4c23-8ba7-7eb802afbf4c" TYPE="ext4" PARTUUID="e9285a85-01" parashuram@elma:~ ls -l /dev/disk/by-partuuid/
total 0
lrwxrwxrwx 1 root root 10 Feb 20 11:31 64af4e6a-927a-4606-8ca4-3c2d0bb32245 -> …/…/sdd2
lrwxrwxrwx 1 root root 10 Feb 20 11:31 ab159ff0-d6a2-4918-961e-f7cdd0c24fee -> …/…/sdd1
lrwxrwxrwx 1 root root 10 Feb 20 11:48 e9285a85-01 -> …/…/sdb1
parashuram@elma:~$ blkid -s PARTUUID -o value /dev/sdb1
e9285a85-01

please help out me from this

Note: I need boot Jetson TX2 from SDcard

Hi parashuram.biradar,

Suggest you can delete all the /dev/sdb partition and format to ext4 first.
Then using gdisk to create new partition (/dev/sdb1), check the PARTUUID and try again.

Hello carolyuu,

we first formated sdcard to ext4 format using disks tool
after that we followed gdisk commands

parashuram@elma:~$ sudo gdisk /dev/sdb1
[sudo] password for parashuram:
GPT fdisk (gdisk) version 1.0.3

Partition table scan:
MBR: not present
BSD: not present
APM: not present
GPT: not present

Creating new GPT entries.

Command (? for help): 1
b back up GPT data to a file
c change a partition’s name
d delete a partition
i show detailed information on a partition
l list known partition types
n add a new partition
o create a new empty GUID partition table (GPT)
p print the partition table
q quit without saving changes
r recovery and transformation options (experts only)
s sort partitions
t change a partition’s type code
v verify disk
w write table to disk and exit
x extra functionality (experts only)
? print this menu

Command (? for help): o
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): y

Command (? for help): n
Partition number (1-128, default 1):
First sector (34-62330846, default = 2048) or {±}size{KMGTP}:
Last sector (2048-62330846, default = 62330846) or {±}size{KMGTP}:
Current type is ‘Linux filesystem’
Hex code or GUID (L to show codes, Enter = 8300):
Changed type of partition to ‘Linux filesystem’

Command (? for help): p
Disk /dev/sdb1: 62330880 sectors, 29.7 GiB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 9B63AB56-0D8B-4291-8914-4F19B8D0F0CE
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 62330846
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number Start (sector) End (sector) Size Code Name
1 2048 62330846 29.7 GiB 8300 Linux filesystem

Command (? for help): x

Expert command (? for help): c
Using 1
Enter the partition’s new unique GUID (‘R’ to randomize): R
New GUID is 3AEEBECC-4B19-44EC-B1FD-47DD3CF77CA7

Expert command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sdb1.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
parashuram@elma:~ sudo blkid /dev/sdb1 /dev/sdb1: PTUUID="9b63ab56-0d8b-4291-8914-4f19b8d0f0ce" PTTYPE="gpt" PARTUUID="0003c1e0-01" parashuram@elma:~ sudo blkid /dev/sdb1
parashuram@elma:~ sudo blkid /dev/sdb1 /dev/sdb1: PTUUID="9b63ab56-0d8b-4291-8914-4f19b8d0f0ce" PTTYPE="gpt" PARTUUID="0003c1e0-01" parashuram@elma:~ sudo mkfs.ext4 /dev/sdb1
mke2fs 1.44.1 (24-Mar-2018)
Found a gpt partition table in /dev/sdb1
Proceed anyway? (y,N) y
Creating filesystem with 7791360 4k blocks and 1949696 inodes
Filesystem UUID: 4eb0eedc-1410-487e-9bea-82f8ed3b1df4
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

parashuram@elma:~$ sudo blkid /dev/sdb1
/dev/sdb1: UUID=“4eb0eedc-1410-487e-9bea-82f8ed3b1df4” TYPE=“ext4” PARTUUID=“0003c1e0-01”

but still it’s same thing

Hi parashuram.biradar,

The argument of gdisk may be wrong.
Please try “sudo gdisk /dev/sdb”, not “sudo gdisk /dev/sdb1”.

Good catch @Mamo_W.

Thanks for you reply Mamo and linuxde,

I followed your steps it’s working fine.
Now i’m able boot TX2 from SD card.

Hello Mamo and linuxde,

I am successfully flashed and booted up (only UI is up) tx2 but unable to load the rootfs.
please find the attached boot log.

please help out me on this
SD_card_bootlog.txt (81.5 KB)

I am not sure where the error is on that, but how much modification is there to the device tree and kernel command line? Mostly what I see seems correct. In particular:

[    8.973087] EXT4-fs (mmcblk2p1): recovery complete
[    8.979842] EXT4-fs (mmcblk2p1): mounted filesystem with ordered data mode. Opts: (null)
[    8.990199] Rootfs mounted over mmcblk2p1

What this says is a prior mount was uncleanly umounted, but that recovery kept this filesystem from corruption. Then the rootfs, from mmcblk2p1, was correctly associated with the root filesystem. It is just after this the initrd does its pivot_root:

[    9.020937] Switching from initrd to actual rootfs

All is good up to this point.

I think this is a remount typical of switching from initrd to the fully running system:

[    9.952137] EXT4-fs (mmcblk2p1): re-mounted. Opts: (null)

Some of the “sdhci-tegra 3440000” output I see is something I don’t think will stop boot, but I could be wrong about that. In essence, from what I see, it seems there is some other issue going on. That issue may indirectly be related to the new rootfs device, but I have no proof one way or another.

Note: If you actual kernel “Image” file is updated, then there may be some mixing between the eMMC version, the initrd version, and the SD card “/boot” version in some incompatible way. On the other hand, if the default Image is in place in all cases, then I do not think this is an issue.

Thanks for your reply linuxdev,

the error was this (mount was uncleanly umounted, but that recovery kept this filesystem from corruption).

Now i’m able to load the rootfs.
I’m working on Jetson TX2 with Jetpack4.3 and tegra-l4t-r32.3.1,
After kernel Compilation Image, dtb and dtbo copying to /boot in the rootfs(SDcard) but changes not reflecting i am not flashing every with this command sudo ./flash jetson-tx2 external
only changing in rootfs(SDcard).
even i tired with applying binaries but not reflecting our changes
sudo ./apply_binaries.sh -r /media/user/sdcard

I tired with extlinux.conf adding FDT
FDT /boot/tegra186-quill-p3310-1000-c03-00-base.dtb

but kernel is getting struct up with this (## Flattened Device Tree blob at 82400000).

I don’t have usb port to program every with emmc and sdcard. one time we can program replace SOC with tx2(dev-kit)slot. after that will put soc to custom board and will change dtb and image in sdcard.

Note: Board is not Devkit it’s on our custom board and there is no USBO port.