Wols Lists wrote:
On 07/05/17 15:57, Bjoern Voigt wrote:
What is the best way to wipe a GPT partition table completely from an USB key?
(Background: My USB key contains a GPT partition table, probably from an OS installation (FreeNAS, openSUSE installation media ...). Parted, fdisk, gdisk have functions to create a new MSDOS partition table, but they do not wipe the GPT completely. gdisk
*X*pert menu
*Z*ap gpt. Thanks. But it probably does not work. I called "z zap (destroy) GPT data structures and exit", re-created a MSDOS partition table and re-inserted the USB key (so that Linux scans the new partition table). But gdisk still complains about an invalid GPT:
mybox:~ # gdisk /dev/disk/by-id/usb-General_UDisk_1502050001210883950005-0:0 GPT fdisk (gdisk) version 1.0.1 Partition table scan: MBR: MBR only BSD: not present APM: not present GPT: not present *************************************************************** Found invalid GPT and valid MBR; converting MBR to GPT format in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by typing 'q' if you don't want to convert your MBR partitions to GPT format! *************************************************************** Warning! Secondary partition table overlaps the last partition by 33 blocks! You will need to delete this partition or resize it in another utility. Command (? for help): x Expert command (? for help): z About to wipe out GPT on /dev/disk/by-id/usb-General_UDisk_1502050001210883950005-0:0. Proceed? (Y/N): y GPT data structures destroyed! You may now partition the disk using fdisk or other utilities. Blank out MBR? (Y/N): y mybox:~ # parted /dev/disk/by-id/usb-General_UDisk_1502050001210883950005-0:0 GNU Parted 3.2 Using /dev/sdc Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) mklabel msdos (parted) quit Information: You may need to update /etc/fstab. mybox:~ # sync [... manually re-inserted the USB key ...] mybox:~ # gdisk /dev/disk/by-id/usb-General_UDisk_1502050001210883950005-0:0 GPT fdisk (gdisk) version 1.0.1 Partition table scan: MBR: MBR only BSD: not present APM: not present GPT: not present *************************************************************** Found invalid GPT and valid MBR; converting MBR to GPT format in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by typing 'q' if you don't want to convert your MBR partitions to GPT format! *************************************************************** Command (? for help): Greetings, Björn -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org