To set up a flash drive manually for booting

Hello,

I am trying to flash a USB drive(64G) by following the instructions in the URL below.
https://docs.nvidia.com/jetson/archives/r35.4.1/DeveloperGuide/text/SD/FlashingSupport.html#to-set-up-a-flash-drive-manually-for-booting

It fails with the message below. Can you tell me the solution?

*************************************************************
*                                                           *
*  Step 1: Start the host connected device flashing process *
*                                                           *
*************************************************************
blockdev: cannot open /dev/mmcblk0boot0: No such file or directory
[ 0]: l4t_flash_from_kernel: Starting to create gpt for external device
Active index file is /media/aiserver/data1/manage_jetpack_version/Orin/R35_4_1/Linux_for_Tegra/tools/kernel_flash/images/external/flash.idx
Number of lines is 17
max_index=16
writing item=1, 9:0:primary_gpt, 512, 19968, gpt_primary_9_0.bin, 16896, fixed-<reserved>-0, 4522fe0ea7c48ea302f850daba64ae40f23468d3
Writing primary_gpt partition with gpt_primary_9_0.bin
Offset is not aligned to K Bytes, no optimization is applied
dd if=/media/aiserver/data1/manage_jetpack_version/Orin/R35_4_1/Linux_for_Tegra/tools/kernel_flash/images/external/gpt_primary_9_0.bin of=/dev/sdc bs=1 skip=0  seek=512 count=16896
16896+0 records in
16896+0 records out
16896 bytes (17 kB, 16 KiB) copied, 0.053988 s, 313 kB/s
Writing primary_gpt partition done
Error: Invalid argument during seek for read on /dev/sdc
[ 1]: l4t_flash_from_kernel: Error: partprobe failed. This indicates that:
 -   the xml indicates the gpt is larger than the device storage
 -   the xml might be invalid
 -   the device might have a problem.
 Please make correction.
Cleaning up...

I saw the following instructions and learned that I could edit the num_sectors field, but I don’t know how to edit the xml. Can you tell me how?
By default, Linux_for_Tegra/tools/kernel_flash/flash_l4t_external.xml only supports a 64GiB SD card and above. If you want to flash a 32GiB SD card, you will need to modify the num_sectors field in Linux_for_Tegra/tools/kernel_flash/flash_l4t_external.xml so that num_sectors * 512 = 32GiB. The command to run is:

$ sudo BOARDID=3701 BOARDSKU=0000 FAB=TS4 ./tools/kernel_flash/l4t_initrd_flash.sh -c tools/kernel_flash/flash_l4t_external.xml -S 20GiB --external-device sda1 --direct sdb jetson-agx-orin-devkit external

full flash log
flash_log.txt (46.5 KB)

Thank you.

Hi,

How does your Linux_for_Tegra/tools/kernel_flash/flash_l4t_external.xml look now?
Is it kept as the default one?

This should only be required on 32GB devices, so ideally you don’t need it.

You said sdb here, but the log showed sdc. Which one is appearing on your host PC?
Have you tried other USB drives or formatting it into a single ext4 partition before flashing?

1 Like

sdc

Have you tried other USB drives or formatting it into a single ext4 partition before flashing?
yes

I don’t think you need -S 20GiB here.

1 Like

I tried it without the -S 20GiB option because it didn’t work, but I think I’ll try again without this option.

It’s currently a USB drive. Shall we try formatting it?

See if that makes any difference.
I just verified on my host PC and the workflow was working fine.

1 Like

I formatted the USB and tried flashing it using the command below, but I still got an error.

sudo BOARDID=3767 BOARDSKU=0003 FAB=300 ./tools/kernel_flash/l4t_initrd_flash.sh -c tools/kernel_flash/flash_l4t_external.xml --external-device sda1 --direct sdc jetson-orin-nano-devkit external


  •                                                       *
    
  • Step 1: Start the host connected device flashing process *
  •                                                       *
    

blockdev: cannot open /dev/mmcblk0boot0: No such file or directory
[ 0]: l4t_flash_from_kernel: Starting to create gpt for external device
Active index file is /media/aiserver/data1/manage_jetpack_version/Orin/R35_4_1/Linux_for_Tegra/tools/kernel_flash/images/external/flash.idx
Number of lines is 17
max_index=16
writing item=1, 9:0:primary_gpt, 512, 19968, gpt_primary_9_0.bin, 16896, fixed--0, 85f4f134e8a5e9dd3c81b2bc4e6857583814fc43
Writing primary_gpt partition with gpt_primary_9_0.bin
Offset is not aligned to K Bytes, no optimization is applied
dd if=/media/aiserver/data1/manage_jetpack_version/Orin/R35_4_1/Linux_for_Tegra/tools/kernel_flash/images/external/gpt_primary_9_0.bin of=/dev/sdc bs=1 skip=0 seek=512 count=16896
16896+0 records in
16896+0 records out
16896 bytes (17 kB, 16 KiB) copied, 0.0147588 s, 1.1 MB/s
Writing primary_gpt partition done
Error: Invalid argument during seek for read on /dev/sdc
[ 1]: l4t_flash_from_kernel: Error: partprobe failed. This indicates that:

  • the xml indicates the gpt is larger than the device storage
  • the xml might be invalid
  • the device might have a problem.
    Please make correction.
    Cleaning up…

Can you tell me the workflow you followed? Just like the command

I just ran this:

sudo BOARDID=3701 BOARDSKU=0000 FAB=TS4 ./tools/kernel_flash/l4t_initrd_flash.sh -c tools/kernel_flash/flash_l4t_external.xml --external-device sda1 --direct sdd jetson-agx-orin-devkit external

So if you don’t make any modification to Linux_for_Tegra/tools/kernel_flash/flash_l4t_external.xml, then I can only suggest grabbing more flash drives for testing.

Can you test it with jetson-orin-nano-devkit?

I don’t think that’d make any difference.

This is what I got on AGX Orin:

Disk /dev/mmcblk0: 59.29 GiB, 63652757504 bytes, 124321792 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 39383D1B-E2FE-4C7E-B1E4-917BB812D65F

So looks like your disk size is slightly smaller than this, and the flashing script may be looking for a larger disk and failed.
You may try editing the variable NUM_SECTORS to match the real value.

1 Like

Can you tell me how to change the NUM_SECTORS value in xml?

<partition_layout version="01.00.0000">
    <device type="external" instance="0" sector_size="512" num_sectors="NUM_SECTORS">
        <partition name="master_boot_record" type="protective_master_boot_record">
            <allocation_policy> sequential </allocation_policy>
            <filesystem_type> basic </filesystem_type>
            <size> 512 </size>
            <file_system_attribute> 0 </file_system_attribute>
            <allocation_attribute> 8 </allocation_attribute>
            <percent_reserved> 0 </percent_reserved>
            <description> **Required.** Contains protective MBR. </description>
        </partition>

‘<size 512 /size>’

Can I change number in '<size , /size> 'tag?

Most disk should by default use a block size of 512 bytes, so don’t change it.
You can get the sector size of all available disks with sudo fdisk -l, and put the value in num_sectors="WHAT YOU HAVE".

1 Like
Disk /dev/sdc: 58.2 GiB, 62495129600 bytes, 122060800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 4CB09C6D-D3C5-460C-83FC-877DDCBC3158

Device     Start       End   Sectors Size Type
/dev/sdc1   2048 113281023 113278976  54G Linux filesystem

Then you should use 122060800.
Is that clear?

1 Like

@DaveYYY

Thank you.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.