Merge lp://staging/~yuningdodo/usb-creator/usb-creator.lp1424915-check-for-iso9660 into lp://staging/usb-creator
Proposed by
Yu Ning
Status: | Needs review |
---|---|
Proposed branch: | lp://staging/~yuningdodo/usb-creator/usb-creator.lp1424915-check-for-iso9660 |
Merge into: | lp://staging/usb-creator |
Diff against target: |
80 lines (+34/-9) 2 files modified
bin/usb-creator-helper (+32/-8) usbcreator/backends/udisks/backend.py (+2/-1) |
To merge this branch: | bzr merge lp://staging/~yuningdodo/usb-creator/usb-creator.lp1424915-check-for-iso9660 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mathieu Trudel-Lapierre | Needs Fixing | ||
Review via email: mp+250718@code.staging.launchpad.net |
Description of the change
To format an usbstick, which was previously dd'ed with an isohybrid ISO image, we need to format the whole drive instead of any partition. (LP: #1424915)
To post a comment you must log in.
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 14.04.1- desktop- amd64.iso: x86 boot sector
ubuntu-
$ parted --script -- ubuntu- 14.04.1- desktop- amd64.iso print 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?
Warning: /home/yun/
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.