I have flashed the system with the standard flash partition table flash_l4t_t194_spi_emmc_p3668.xml:
<partition name="UDA" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 18432 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 0x808 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<description> **Required.** Automatically takes all remaining space on the device except that occupied by the `secondary_gpt` partition. Allocation attribute must be set to 0x808. May be mounted and used to store user data. </description>
</partition>
However after flashing I have 19 instead of 20 partitions in the list.
Disk /dev/mmcblk0: 14.69 GiB, 15758000128 bytes, 30777344 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: 51EB762B-6C6F-4B4D-B413-8828A2333E15
Device Start End Sectors Size Type
/dev/mmcblk0p1 40 27263015 27262976 13G Microsoft basic data
/dev/mmcblk0p2 27263016 27394087 131072 64M Microsoft basic data
/dev/mmcblk0p3 27394088 27394983 896 448K Microsoft basic data
/dev/mmcblk0p4 27394984 27461631 66648 32.6M Microsoft basic data
/dev/mmcblk0p5 29558784 29563903 5120 2.5M Microsoft basic data
/dev/mmcblk0p6 29563904 29564031 128 64K Microsoft basic data
/dev/mmcblk0p7 29564032 29566079 2048 1M Microsoft basic data
/dev/mmcblk0p8 29566080 29568127 2048 1M Microsoft basic data
/dev/mmcblk0p9 29568128 29570175 2048 1M Microsoft basic data
/dev/mmcblk0p10 29570176 29573247 3072 1.5M Microsoft basic data
/dev/mmcblk0p11 29573248 29575295 2048 1M Microsoft basic data
/dev/mmcblk0p12 29575296 29706367 131072 64M Microsoft basic data
/dev/mmcblk0p13 29706368 29707263 896 448K Microsoft basic data
/dev/mmcblk0p14 29707264 29773823 66560 32.5M Microsoft basic data
/dev/mmcblk0p15 29773824 29937663 163840 80M Microsoft basic data
/dev/mmcblk0p16 29937664 29938687 1024 512K Microsoft basic data
/dev/mmcblk0p17 29938688 30553087 614400 300M Microsoft basic data
/dev/mmcblk0p18 30553088 30684159 131072 64M EFI System
/dev/mmcblk0p19 30684160 30777310 93151 45.5M Microsoft basic data
p18 is the efi partition and p19 is the secondary gpt partition. It seems like the UDA partition had not been added.
What do I have to do so it is created?
I reduced my APP partition by 1GB and expected to find a partition with the size of 1GB+.
Why was partition 19 not resized to match the fs size? Is it done by some nvidia script?
I can’t mount it, seems broken:
mount PARTLABEL=UDA /tmp
[ 6176.246244] exFAT-fs (mmcblk0p19): invalid boot record signature
[ 6176.246429] exFAT-fs (mmcblk0p19): failed to read boot sector
[ 6176.246571] exFAT-fs (mmcblk0p19): failed to recognize exfat type
mount: /tmp: wrong fs type, bad option, bad superblock on /dev/mmcblk0p19, missing codepage or helper program, or other error.
Required. Automatically takes all remaining space on the device except that occupied by the secondary_gpt partition. Allocation attribute must be set to 0x808. May be mounted and used to store user data.
But you told me to change the size. I changed the size and it has no effect.
Is it required to create the img in the flash.sh? I’d prefer to not modify the nvidia scripts and work with configs.
could you please review the flash messages, and please double check which xml file it’s used.
are you able to mount the UDA partition directly by this command… $ sudo mount /dev/mmcblk0p19 /media/
afaik the last used flash config is in bootloader/flash.xml
It is edited as I expected. Please see this file: flash.xml (39.8 KB)
(It is the modified flash_l4t_t192_spi_emmc_p3668.xml with three added zeros to the default size of the UDA partition.)
No matter what I change there, the UDA partition looks like this:
/dev/mmcblk0p19 30684160 30777310 93151 45.5M Microsoft basic data
The test you suggested yields this:
root@localhost:~# sudo mount /dev/mmcblk0p19 /media
[ 245.826206] exFAT-fs (mmcblk0p19): invalid boot record signature
[ 245.826380] exFAT-fs (mmcblk0p19): failed to read boot sector
[ 245.826512] exFAT-fs (mmcblk0p19): failed to recognize exfat type
mount: /media: wrong fs type, bad option, bad superblock on /dev/mmcblk0p19, missing codepage or helper program, or other error.
Please have a look at the flash log, maybe you see anything wrong: flash.log (66.8 KB)
Just for reference, I only changed the size in flash.xml and did not edit anything in the flash.sh yet. The FS image should not relate to the created GPT partition on the device though? Usually I get errors when the images do not match the partition sizes.
After the test
On the flashed system I have tried to modify the existing GPT table and create an EXT4 filesystem. That works without issues, I can create a 1GB ext4 partition there, so the space is there. I see no reason why it should be capped at 45MB.
I think I have found an issue. I tried to format the disk with an sfdisk script and noticed that I get a 45MB Partition again, even if I set it to expand until the end, but I did not modify the start sector. I tried the same with fdisk by just deleting and auto creating and it succeeds creating a 1GB partition.
Device Start End Sectors Size Type
/dev/mmcblk0p1 40 27263015 27262976 13G Microsoft basic data
/dev/mmcblk0p2 27263016 27394087 131072 64M Microsoft basic data
/dev/mmcblk0p3 27394088 27394983 896 448K Microsoft basic data
/dev/mmcblk0p4 27394984 27461631 66648 32.6M Microsoft basic data
/dev/mmcblk0p5 29558784 29563903 5120 2.5M Microsoft basic data
/dev/mmcblk0p6 29563904 29564031 128 64K Microsoft basic data
/dev/mmcblk0p7 29564032 29566079 2048 1M Microsoft basic data
/dev/mmcblk0p8 29566080 29568127 2048 1M Microsoft basic data
/dev/mmcblk0p9 29568128 29570175 2048 1M Microsoft basic data
/dev/mmcblk0p10 29570176 29573247 3072 1.5M Microsoft basic data
/dev/mmcblk0p11 29573248 29575295 2048 1M Microsoft basic data
/dev/mmcblk0p12 29575296 29706367 131072 64M Microsoft basic data
/dev/mmcblk0p13 29706368 29707263 896 448K Microsoft basic data
/dev/mmcblk0p14 29707264 29773823 66560 32.5M Microsoft basic data
/dev/mmcblk0p15 29773824 29937663 163840 80M Microsoft basic data
/dev/mmcblk0p16 29937664 29938687 1024 512K Microsoft basic data
/dev/mmcblk0p17 29938688 30553087 614400 300M Microsoft basic data
/dev/mmcblk0p18 30553088 30684159 131072 64M EFI System
/dev/mmcblk0p19 27461632 29558783 2097152 1G Linux filesystem
Somehow the flash tool creates an empty space between mmcblk0p4 and mmcblk0p5 instead of moving the unused space at the end.
hi ,@seeky15
The UDA is a partition reserved by NV and not open to customers.
If the you need a new partition to store private data, it is recommended to increase the partition .
you can add partition as below, here is an example ,
you can also decrease the size of APP and increase the size of ADD1 you want.
Add reading and writing support for new added partition
modify the flash.sh
#
# Comment out sc7 support. It is found that sc7 sigheader is different and it needs special handling
# See 200617500
#
# sc7 | sc7_b) target_partfile="${wb0bootname}";
# need_sign=1;
# ;;
*spe-fw | spe-fw_b)
target_partfile="${spefilename}";
need_sign=1;
;;
ADD1 | ADD2 )
target_partfile="add1.bin";
need_sign=1;
;;
CPUBL-CFG)
target_partfile="${cbootoptionfilename}";
;;
*) echo "*** Update ${tmp_updateid} is not supported. ***";
exit 1; ;;
esac;
flash your device
check the partition of ADD1 after flash , by command
sudo gdisk -l /dev/mmcblk0
you will find ADD1 partition
you’re kidding me right? Why does it say “May be mounted and used to store user data.” as a comment for the UDA partition in the xml file then?
I do not need to initialize the data with an image.
I have an empty space created after mmcblk0p5 by the flash script. Can I simply create a partition on first boot in that place or do I need to expect that unused space will in the future be taken by some other partition?
I really prefer not to modify any nvidia files with patches as they might change any time, temporarily breaking our code.
You can not read UDA partition , you can take a try.
---->Can I simply create a partition on first boot in that place or do I need to expect that unused space will in the future be taken by some other partition?
The partition maybe influenced by OTA .