Failure in creating image through imager script

Required Information

  • DietPi version | latest beta
  • Distro version | Armbian-23.11.0-trunk
  • Kernel version | ### Creating a bug report/issue
    6.5.5
  • Architecture | ARMv8
  • SBC model | Orangepi 3B
  • Power supply used | PD65W via dual type-c cable
  • SD card used | SanDisk Ultra 32G

The imager creating script in Dietpi Docs cannot create a functional image.

root@Diet5A:/mnt/samba/pi#  sgdisk -e DietPi_OPi3B-ARMv8-Trixie.img

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!
Main header: OK
Backup header: ERROR
Main partition table: OK
Backup partition table: ERROR

****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************

Warning! Secondary partition table overlaps the last partition by
287 blocks!
Try reducing the partition table size by 1148 entries.
(Use the 's' item on the experts' menu.)
Aborting write of new partition table.

I’ve also uploaded dietpi bug report, with Reference code: afafe62d-0473-4be3-9a4b-fb5312cc0fa7

It seems the GPart cannot support the kernel file system?

ping @MichaIng

First of all, this is a purely visual warning about the “backup” GPT partition table, which is expected to be at the end of the device resp. file. If the main partition table is “OK”, it is not needed.

Furthermore, in the moment you flash the image to any disk, the backup GPT table is again at the wrong location, since the end of the image file is not the same as the end of the disk. Hence on first boot of any image generated with dietpi-imager, the dietpi-fs_partition_resize.service runs and re-creates the GPT backup table at the end of the disk (via sgdisk -e as well). So the warning has no purpose for an image file.

However, we do actually address it and do add 34 sectors to the end of the image file and run sgdisk -e at the very end of the script, as purely visual step, to mute exactly these warnings. Do you still have the log of the dietpi-imager run? You should see one line near the end:

[ OK ] Moving GPT backup partition table to end of drive

Reading it, “drive” is the wrong word here, as this runs on the image file :smile:.

Your error message indicates that this step should have been missing or failed, and furthermore that the image is too small to create it. Strange is that is indicates an overlap of 287 blocks, which is some magnitudes of orders larger then the 34 sectors (each 512 bytes) needed. So the last partition of the within the image file must be much larger than the image itself, which should have led to errors within dietpi-images as well. The full output of the script would be indeed helpful to debug this.

Thanks Michalng!
I am sorry that i was sicked since last weekend so missed your reply.
Where is the log file or full output of the script place? Let me get it out asap

It does not create a log file, so what you see on console is all logs it creates.