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

Re: Restore backup to KVM



Hi,

solitone wrote:
> > Partition Table: loop
> >  1      0.00B  96.6GB  96.6GB  ext4

Reco wrote:
> I'm curious to know how you'd achieve this.

The storage device (image file in this case) is unpartitioned.

If you have a MBR partition table ("msdos"), then you may achieve this
by deleting all partitions.

On byte level you may zeroize bytes 446 to 510 of the device or
image file:

  dd if=/dev/zero bs=1 seek=446 count=64 conv=notrunc of=...path...

If the partition editor stays stubbornly with msdos, delete the MBR
signature:

  dd if=/dev/zero bs=1 seek=510 count=2 conv=notrunc of=...path...

If it is a GPT, then the dd will make it invalid too (by removing the
MBR partition of type 0xee), but you have to expect that a partition
editor will try to restore it from the Backup GPT at the end of the
storage device.

The backup GPT header block is supposed to be in the last block of
the device. It begins by the text "EFI PART".
One would zeroize it by

  dd if=/dev/zero bs=512 seek=...byte.size.divided.by.512.minus.1... \
     count=1 conv=notrunc of=...path...

(Or hope that the partition editor knows how to deface GPT if you
 ask it to do so. Your milage may vary.)


Have a nice day :)

Thomas


Reply to: