Results 1 to 5 of 5

Thread: after install, remove partitons and format usb pen drive

  1. #1

    after install, remove partitons and format usb pen drive

    I'm having problems removing the partitions so i can reformat my usb pen drive after using to install ubuntu. Is there some sort of how to that anyone can point me to. I can not seem to find one.

    using "Disks" I get this output when i try to delete the partitions

    Error deleting partition /dev/sdb2: Command-line `parted --script "/dev/sdb" "rm 2"' exited with non-zero exit status 1: Warning: /dev/sdb 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.
    (udisks-error-quark, 0)

    under gparted i get this error
    /dev/sdb 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?


    thank you

  2. #2
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,134
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: after install, remove partitons and format usb pen drive

    This brute-force force will wipe the partition table completely by overwriting with zeros, leaving you free to re-partition with your chosen tool:
    Code:
    sudo dd if=/dev/zero of=/dev/sdb bs=1M count=1
    Be very sure you get the right output device, not some internal disk drive! Recovery from an error will be very difficult.
    After writing, I would remove and re-insert the stick.

  3. #3
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: after install, remove partitons and format usb pen drive

    gpt also has a backup gpt partition table that is supposed to be at the end of drive.

    And that is often the issue, as Windows tools convert gpt to MBR, but leave backup partition table.
    Then Linux sees both MBR & gpt and assumes erasing & starting over is only choice.

    Best to also see what fixparts says.
    FixParts is the easiest way to remove the stray GPT data. GPT fdisk (gdisk or sgdisk) can do it, but the procedure's a bit more involved.
    http://www.rodsbooks.com/fixparts/
    sudo fixparts /dev/sdb
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  4. #4
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: after install, remove partitons and format usb pen drive

    You can also use the wipe menu of mkusb, which wraps a safety belt around dd, so it is the same method under the hood as the one described by The Cog. In addition there are 'short-cuts' to standard partitioning schemes on top of wiping the first megabyte.

  5. #5
    Join Date
    Jun 2007
    Location
    Hikkaduwa, Sri Lanka
    Beans
    3,309
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: after install, remove partitons and format usb pen drive

    Same thing happened to me a couple days ago.
    To fix I recall using gparted, going to Device and then Create Partition Table.
    Not exactly sure what I did in there, tried different things.
    I eventually made a new FAT32 partition and tried installing 16.04 beta2.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •