Method under test :
Commands to execute In the directory where is located (a copy of) easy-5.0-amd64.img to enlarge it to 1G
- (optional) fdisk -l easy-5.0-amd64.img display informations on the partitions on the drive image
Disque easy-5.0-amd64.img : 825 MiB, 865075200 octets, 1689600 secteurs
Unités : secteur de 1 × 512 = 512 octets
Taille de secteur (logique / physique) : 512 octets / 512 octets
taille d'E/S (minimale / optimale) : 512 octets / 512 octets
Type d'étiquette de disque : dos
Identifiant de disque : 0x07c66c81
Périphérique Amorçage Début Fin Secteurs Taille Id Type
easy-5.0-amd64.img1 * 2048 16383 14336 7340032 ef EFI (FAT-12/16/
easy-5.0-amd64.img2 16384 1687551 1671168 855638016 83 Linux
- truncate -s 1G easy-5.0-amd64.img (extend the size to 1GB)
- fdisk easy-5.0-amd64.img (to modify the partition table)
then type d, type enter to delete the partition 2
then type n, type enter 4 times to create the partition 2 with maximum size
fdisk asks if we want to delete the signature. Reply N
(optional) type p for verify the table partions after the modification
Périphérique Amorçage Début Fin Secteurs Taille Id Type
easy-5.0-amd64.img1 * 2048 16383 14336 7340032 ef EFI (FAT-12/16
easy-5.0-amd64.img2 16384 2097151 2080768 1065353216 83 Linux
type w to save the new table and quit fdisk.
We can now verify the size of easy-5.0-amd64.img (1024MB -> OK)
We click on easy-5.0-amd64.img to mount it read-only
The 2nd partition is probably mount with dev/loop2 (cat /etc/mtab to verify , it's the line /dev/loop2 /tmp/mount-img-2-ext4-loop2 ext4 ro,relatime 0 0)
blkid /dev/loop2
/dev/loop2: LABEL="easy2" UUID="328ed5c2-b561-11ed-ae4d-287fcfeb4376" BLOCK_SIZE="4096" TYPE="ext4"
The UUID has not changed
I'll test the img file in ventoy.