13

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.

4
  • Have you tried to unmount the volume before trying to do anything on it ?
    – Videonauth
    Apr 17, 2016 at 4:23
  • 1
    Yes I unmount the drive and then format or delete it but the same message shown in the screen. Apr 17, 2016 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, 2016 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. Jul 19, 2016 at 10:42

3 Answers 3

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.

7
  • 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. Jul 19, 2016 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.
    – Enlico
    Sep 14, 2016 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, 2017 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, 2017 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? Sep 7, 2017 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
0
3

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.

2
  • tried gparted, and it gives me similar errors as the Disks app...
    – knocte
    Dec 18, 2016 at 7:58
  • Works great.... Sep 11, 2019 at 10:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .