Im not getting any error during all the process. I used gparted and loopback to resize the APP partition so that it only occupies 34.6G. Otherwise, it will be 64G in total.
Use
gdisk -l
on original system image:
GPT fdisk (gdisk) version 1.0.1
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk JetsonNano23Aug.img: 124735488 sectors, 59.5 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): xxxxxx-xxxx-xxxxxx-xxxxxxx
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 52147613 sectors (24.9 GiB)
Number Start (sector) End (sector) Size Code Name
1 24576 72605695 34.6 GiB 8300 APP
2 2048 2303 128.0 KiB 8300 TBC
3 4096 4991 448.0 KiB 8300 RP1
4 6144 7295 576.0 KiB 8300 EBT
5 8192 8319 64.0 KiB 8300 WB0
6 10240 10623 192.0 KiB 8300 BPF
7 12288 13439 576.0 KiB 8300 TOS
8 14336 14463 64.0 KiB 8300 EKS
9 16384 17663 640.0 KiB 8300 LNX
10 18432 19327 448.0 KiB 8300 DTB
11 20480 20735 128.0 KiB 8300 RP4
12 22528 22687 80.0 KiB 8300 BMP
gdisk display after I truncate or dd the .img to smaller .img file:
GPT fdisk (gdisk) version 1.0.1
Warning! Disk size is smaller than the main header indicates! Loading
secondary header from the last sector of the disk! You should use ‘v’ to
verify disk integrity, and perhaps options on the experts’ menu to repair
the disk.
Caution: invalid backup GPT header, but valid main header; regenerating
backup header from main header.
Warning! Error 25 reading partition table for CRC check!
Warning! One or more CRCs don’t match. You should repair the disk!
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: damaged
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
Disk new.img: 81920000 sectors, 39.1 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): xxxxxxxx-xxxx-xxxx-xxxx-xxxxxx
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 52147613 sectors (24.9 GiB)
Number Start (sector) End (sector) Size Code Name
1 24576 72605695 34.6 GiB 8300 APP
2 2048 2303 128.0 KiB 8300 TBC
3 4096 4991 448.0 KiB 8300 RP1
4 6144 7295 576.0 KiB 8300 EBT
5 8192 8319 64.0 KiB 8300 WB0
6 10240 10623 192.0 KiB 8300 BPF
7 12288 13439 576.0 KiB 8300 TOS
8 14336 14463 64.0 KiB 8300 EKS
9 16384 17663 640.0 KiB 8300 LNX
10 18432 19327 448.0 KiB 8300 DTB
11 20480 20735 128.0 KiB 8300 RP4
12 22528 22687 80.0 KiB 8300 BMP
There is a header issue here, it seems this is causing the problem?