[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Follow-up on last IRC meeting (ie: 12 Aug 2020)



On Thu, Aug 13, 2020 at 12:37:12AM +0200, Thomas Goirand wrote:
> # Finally, truncate the final disk
> truncate -s ${FINAL_IMAGE_SIZE}M disk.raw
> 
> After the parted + truncate, the partition 1 is broken, I don't
> understand why, but that's probably due to this weird layout.

I don't think it's the layout.  Here's a script that creates a raw image like
you suggest, but it is also affected:

rm -f disk.raw
truncate -s 2G disk.raw
/sbin/fdisk disk.raw <<EOF
g
n
1
2048
262143
t
1
n
2
262144
4194270
p
w
EOF

/sbin/kpartx -av disk.raw
/sbin/mkfs.ext4 /dev/mapper/loop0p2
/sbin/resize2fs /dev/mapper/loop0p2 910M
/sbin/kpartx -d disk.raw
/sbin/fdisk -l disk.raw
truncate -s 2047M disk.raw
/sbin/fdisk -l disk.raw


Could it be the GPT partition table at the end of the disk?  Even truncating
off 1M breaks it.  Nothing will use the copy at the start of the disk, I wonder
what the point of it is.

Ross


Reply to: