Code review comment for lp:~yuningdodo/usb-creator/usb-creator.lp1424915-check-for-iso9660

Revision history for this message
Yu Ning (yuningdodo) wrote :

If we attempt to print the disk layout of an isohybrid ISO image with parted, we'll get below error messages:

$ file ubuntu-14.04.1-desktop-amd64.iso
ubuntu-14.04.1-desktop-amd64.iso: x86 boot sector

$ parted --script -- ubuntu-14.04.1-desktop-amd64.iso print
Warning: /home/yun/Downloads/iso/ubuntu-14.04.1-desktop-amd64.iso contains GPT signatures, indicating that it has a GPT table. However, it does not have a valid fake msdos partition table, as it should. Perhaps it was corrupted -- possibly by a program that doesn't understand GPT partition tables. Or perhaps you deleted the GPT table, and are now using an msdos partition table. Is this a GPT partition table?
Error: Both the primary and backup GPT tables are corrupt. Try making a fresh table, and using Parted's rescue feature to recover partitions.

We'll get the same error from an usbstick if it's dd'ed with the ISO.

In such a case most operations will fail or result in incorrect result, that's why we get the error messages in bug #1424915.

To fix this issue we should check if the usbstick is dd'ed with isohybrid ISO images. One possible way is checking for the drive's partition type since the isohybrid ISO image has type iso9660 for the drive.

In my own test this patch works on utopic and vivid. For trusty we also need to do some extra tricks due to the util-linux/wipefs bugs, we can discuss it later.

« Back to merge proposal