12

I have 8GB pendrive. The current configuration of my pendrive in shown in image. It shows 6.9 GB as a free space, 2.3 MB as a FAT drive which is shown when i open it.

I want to format drive but when I am going to format it, it shows an error message which is shown in Message.

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

I also tried to delete the volume and create a new volume but the message shows is

Please help me to delete all partion of my drive and create a single volume with 8 GB partion.

  • Have you tried to unmount the volume before trying to do anything on it ? – Videonauth Apr 17 '16 at 4:23
  • 1
    Yes I unmount the drive and then format or delete it but the same message shown in the screen. – Puneet Dixit Apr 17 '16 at 4:31
  • Here is a bug report : bugs.launchpad.net/ubuntu/+source/gnome-disk-utility/+bug/… Hope to be fixed soon – Hangman Jun 24 '16 at 12:09
  • This is driving me nuts, you practically just can't use your pen drive with latest Ubuntu. I'm saying even though I'm pretty good with terminal and stuff like that, but no, I'm not willing to use the terminal in 2016 for formatting a pen drive. – Attila Fulop Jul 19 '16 at 10:42
7

Well my proposed solution might sound harsh and will definitively delete everything on that pen-drive so make sure you use the right path. I write my answer now on that setup seen on your screen-shots.

Open a terminal by pressing ctrl+alt+t.

Then

# like said make sure you use the right path to your stick !! 
sudo umount /dev/sdd1
sudo dd if=/dev/zero of=/dev/sdd1 bs=4MB

Let this run for a while (it will take a moment to write zero on 8 GB doing 4 MB steps).

after that nothing should be on that drive anymore and you should be able to start over fresh.

  • 2
    I did this and afterwards the dongle wasn't recognized by Ubuntu at all. Fortunately we just has a windows laptop in the office that did this very complex thing in 30 secs. Bleh. – Attila Fulop Jul 19 '16 at 10:55
  • It worked for me (it took more then a couple of minutes, but I went away during the process, so I don't know how much time it took effectively). Then I had to create the partition table and then the partition (both with Gparted). Even so, the pendrive was not writable anymore. So I solved eleminating the partition table sudo dd if=/dev/zero of=/dev/sdd1 in Ubuntu and formatting in Windows. – Enrico Maria De Angelis Sep 14 '16 at 14:04
  • Can we increase the value of parameter bs for reducing the time? For me, it took a lot of time. – sv_jan5 Jun 17 '17 at 12:09
  • 1
    @sv_jan5 You could but you have to make sure the block size fits the size of the stick, 4098 bytes (or 4M) is the usual safe size, this is why I put it here in my answer. – Videonauth Jun 18 '17 at 6:00
  • After applying this solution I had to format the pen drive using Windows because it could not be detected on Ubuntu even after rebooting. Is this how it is supposed to get resolved? – Snehasish Karmakar Sep 7 '17 at 20:23
6

This problem is caused caused by a low-level device tools writing blocks at the wrong size directly onto the device.

To fix this, you will have to re-write the device blocks to the appropriate size. To do this open terminal(Ctrl+Alt+T) and enter the following command

sudo dd if=/dev/zero of=/dev/sdX bs=2048 && sync

Rember to replace sdX with the actual device for your flash drive.
After doing this you can create a new partition using gparted or by terminal using
To format as fat32

sudo mkfs.vfat /dev/sdX1

To format ad ntfs

sudo mkfs.ntfs /dev/sdX1

To format as EXT4

sudo mkfs.ext4 /dev/sdX1
2

STEP 1: install GParted Partition Editor.

sudo apt-get install gparted 

STEP 2: open gparted and insert pendrive. Then click on Gparted > devices and select your device.

STEP 3: delete all partitions and submit.

  • tried gparted, and it gives me similar errors as the Disks app... – knocte Dec 18 '16 at 7:58

protected by Community Jul 1 '18 at 1:58

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.