15

I can't format my pendrive (where ubuntu was loaded as live-usb) . Whenever I do , they say .

This partition cannot be modified because it contains a partition table; please reinitialize layout of the whole device. (udisks-error-quark, 11)

What to do ? I use Disks in Ubuntu 16.04

enter image description here

Nicolas Raoul
  • 11,603
  • 1
    Please update your comment with the software you have used to format and your operating system. – Archisman Panigrahi Oct 04 '16 at 10:52
  • You can use mkusb according to these links, https://help.ubuntu.com/community/mkusb , https://help.ubuntu.com/community/mkusb/wipe . The easy solution is to select 'Restore to a standard storage device', but you can also let mkusb wipe the first megabyte, and after that most partitioning tools (e.g. Disks and gparted) will work, if the drive's hardware is still healthy, so that it can be written to. – sudodus Jul 03 '17 at 21:57

5 Answers5

23

If you don't have any valuable data on that drive you can create a new partition table with Gnome Disks if it doesn't like the current one:

  1. Click on the cogwheel for drive operations and select “Format…”.

  2. Select a suitable partition table type and click on “Format…” again. For a USB flash drive you probably want “MBR/DOS” as the partition type like in the screenshot.

  3. Confirm that you want to overwrite the partition table and lose all data on the drive.

  4. Afterwards create a new partition and format it.

    1. Click on the button with the ✚ sign below the partition layout.

    2. Select

      • suitable partition boundaries (you probably want to cover the entire available space which is the default),
      • a file system (for a USB drive probably FAT, exFAT, or NTFS), and
      • optionally a name.

    3. Click on “Create”, wait a while for the file system creation to finish (can be in the range of minutes for a large but slow drive) and you’re done!

David Foerster
  • 36,264
  • 56
  • 94
  • 147
12

The best way to do is...

Open Terminal

sudo fdisk -l

This will list your all mounted/unmounted device..

Look for your USB device ... you can cross-verify it by from the Disk utility...It may list something like

/dev/sdb1 or /dev/sdc1...

sudo fdisk /dev/sdb --- if your USB is sdb

Command (m for help): d Partition number (1,2, default 2):

Partition 2 has been deleted.

Command (m for help): d Selected partition 1 has been deleted.

Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks.

That's it.

Now go back to Disk utility and then format the drive as you wish!...

  • EngineSense - Your answer worked perfectly. Personally, I prefer to work with the system in it's prime state before adding any additional programs. Failing that, I prefer to add the programs before I decide to any additional repositories/ppa's. I add the repository ONLY as a last ditch effort to solve the issue, and I am VERY CAUTIOUS about the repos/ppa's I add. –  Aug 26 '21 at 20:34
5

I had this problem before and i fix it like this:

  1. install GParted and open it.
  2. from upper-right part select your USB Flash Memory.
  3. select your storage from list box and create a partition table (menu bar: device -> create partition table).
  4. create one or some partitions and format them by GParted or any other partition programs.

good luck

MH314K
  • 51
  • 1
  • 5
1

Here is what did the trick for me:

  1. Select all partitions of the USB stick and for each of them press the "Stop" button, then the "Minus" button
  2. When there is only one partition left, select it
  3. Press the "Gears" button
  4. Click "Format Partition..." and format. This times it works, somehow.
Nicolas Raoul
  • 11,603
0

Ubuntu 18.04:

Similar to nicolas's answer

  1. click super
  2. type and open disks
  3. on left corner go to device you want to reformat
  4. Important:

You have to remove the middle partition with the - icon before you can reformat the device.

enter image description here

________/\

  1. click on the cog-wheels and press format partition
  2. choose what the options you want for your reformating