After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 768031 - Impossible to format a partition which contains a partition table (notably distro live USBs) -- confusing user interface (especially from nautilus)
Impossible to format a partition which contains a partition table (notably di...
Status: RESOLVED OBSOLETE
Product: nautilus
Classification: Core
Component: Sidebar
3.22.x
Other Linux
: Normal minor
: 3.26
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 778821 786467 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-06-25 12:50 UTC by Hangman
Modified: 2021-06-18 15:53 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Hangman 2016-06-25 12:50:35 UTC
When you try to format a bootable USB you have the following error :

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

and it's impossible to format.

I think it's related to this bug : https://bugs.freedesktop.org/show_bug.cgi?id=76178

Here another bug details and temporary solution : http://askubuntu.com/questions/758219/how-can-i-delete-all-partion-of-my-pen-drive-and-create-a-single-volume
Comment 1 Michael Catanzaro 2016-06-25 16:05:07 UTC
(In reply to Hangman from comment #0)
> When you try to format a bootable USB you have the following error :
> 
> This partition cannot be modified because it contains a partition table;
> please reinitialize layout of the whole device. (udisks-error-quark, 11)
> 
> and it's impossible to format.

How did you create the bootable USB? The error message says you have a partition table *inside* the partition you're trying to delete. That's really weird; I didn't realize it was even possible. You will have to format the entire device (using the hamburger menu in the top-right) rather than attempting to format that particular partition.

I don't see a bug here (except in the Ask Ubuntu question I see there was some other error formatting the entire device, which looks like a bug).
Comment 2 Hangman 2016-06-26 11:09:29 UTC
I've created it whith Etcher. After trying to format the entire device included in hamburger menu it's working well. It would be great if error message could ask for this option instead of having no option...
Comment 3 Michael Catanzaro 2016-06-26 15:49:14 UTC
That's exactly what the error message told you to do. :) I'm afraid the nature of any disk partitioning tool is that some knowledge of partitioning is required to use it....
Comment 4 Hangman 2016-06-26 18:03:36 UTC
I understand but this message comes after a simple "right click / format" on usb drive in nautilus, so I think a beginner won't be able to solve this simple problem because it's quite hard to find correct solution (I wasn't able to do it...).

It's a suggestion but a simple click box that offers format whole drive option would be more convenient.
Comment 5 Michael Catanzaro 2016-06-26 22:00:10 UTC
(In reply to Hangman from comment #4)
> I understand but this message comes after a simple "right click / format" on
> usb drive in nautilus, so I think a beginner won't be able to solve this
> simple problem because it's quite hard to find correct solution (I wasn't
> able to do it...).

OK, I see your point... I didn't realize you could format the partition directly from nautilus, and from there it's much less clear how to handle the error. We can expect Disks users to understand such an issue, but we can't expect nautilus users to even know what a partition is, much less why formatting a single partition is different from formatting the entire USB stick.

I'm not sure what can be done about this, though. Probably the best option is to just hide the Format option, but that probably won't be easy....
Comment 6 Hangman 2016-06-27 08:11:48 UTC
Thanks for your answer. As I said an option in error dialog would be great.

//
This partition cannot be modified because it contains a partition table. (udisks-error-quark, 11)

Do you want to format whole disk instead ?

[Format whole disk] [Cancel]

//

It happens whith a bootable usb so user may not know what Etcher/Unetbootin does to his disk, so for him format whole drive is that what he wants
Comment 7 Prashant 2016-09-24 01:32:10 UTC
Hi. I created a bootable usb for gpart to shrink the Disk. Now, I am not able to format the USB. It gives the same error.
Error formatting volume.
This partition cannot be modified because it contains a partition table; please reinitialize layout of the whole device. (udisks-error-quark, 11)

Let me know if you want me to provide any other details.
Comment 8 Michael Catanzaro 2016-09-24 02:33:36 UTC
(In reply to Prashant from comment #7)
> Hi. I created a bootable usb for gpart to shrink the Disk. Now, I am not
> able to format the USB. It gives the same error.
> Error formatting volume.
> This partition cannot be modified because it contains a partition table;
> please reinitialize layout of the whole device. (udisks-error-quark, 11)
> 
> Let me know if you want me to provide any other details.

I'll repeat what we already discussed above -- no new information here -- but try to explain more cleanly:

You need to format the entire device, not a particular partition. Use the hamburger menu in the top right of Disks, not the partition menu in the center of the app nor from the nautilus sidebar. The bug is that the user interface in the nautilus sidebar is very confusing, because you see only a single partition there with no way to see the device, and naturally think it's the entire device -- but refusing to format is correct behavior: if you have a partition table inside a partition (needed to make live USBs reliable on different OSes) then formatting just that partition would break other partitions, so it only makes sense to format the entire device.

It's hard to think of how to improve the UI, because this is an important safety feature and we don't want to just remove it, but perhaps we could catch this particular error when encountered in the nautilus sidebar and display an explanation. I'm not actually sure if that's a Disks bug or GTK+ bug or a nautilus bug, though.
Comment 9 Michael Catanzaro 2016-10-25 16:28:36 UTC
csoriano:  mcatanzaro: the format menu item is done by nautilus, and it calls disk-utility on the command line

--> nautilus. Formatting a partition that contains a partition table is expected to fail.
Comment 10 wolf_volpi 2017-02-20 00:50:33 UTC
I had the same experience as Hangman.  So I tried the method described in Comment 8.  Now my system does not recognize the USB drive.

Here is what I did:
From Nautilus, right click USB device > click the hamburger menu in the top right of Disks > Format Disk
    Partitioning: Compatible with all systems (DOS).
    Click format (the blue rectangle format appeared to be successful).
    Close the partitioning menu.
From Nautilus, click up arrow to unmount USB drive.

Then pull the USB drive out and plug it back in.  The USB drive does not show up in Nautilus.
Comment 11 Michael Catanzaro 2017-02-20 00:56:46 UTC
(In reply to wolf_volpi from comment #10)
> I had the same experience as Hangman.  So I tried the method described in
> Comment 8.  Now my system does not recognize the USB drive.

You need to create a partition in order to store files on the USB drive again. In GNOME Disks, in the volumes grid, you should see the entire drive as free after having formatted it. It will say "Free Space" and show the size of the drive underneath. Look on the bottom left; there will be a plus button next to a icon with gears. If you hover over the plus button, it should display the tooltip "Create partition in unallocated space". Click that, then click "Create" in the bottom right (the defaults are probably fine for you). Now you should be able to save files on the USB drive again.
Comment 12 wolf_volpi 2017-02-20 01:44:29 UTC
(In reply to Michael Catanzaro from comment #11)
> (In reply to wolf_volpi from comment #10)
> > I had the same experience as Hangman.  So I tried the method described in
> > Comment 8.  Now my system does not recognize the USB drive.
> 
> You need to create a partition in order to store files on the USB drive
> again. In GNOME Disks, in the volumes grid, you should see the entire drive
> as free after having formatted it. It will say "Free Space" and show the
> size of the drive underneath. Look on the bottom left; there will be a plus
> button next to a icon with gears. If you hover over the plus button, it
> should display the tooltip "Create partition in unallocated space". Click
> that, then click "Create" in the bottom right (the defaults are probably
> fine for you). Now you should be able to save files on the USB drive again.

Thanks for the quick response Catanzaro.
But GNOME Disk does not see the USB drive.

I closed the GNOME Disks window after the entire drive was made free.
Then I pulled the USB drive out and plug it back in.
Now the USB drive does not show up in Nautilus nor GNOME Disks.
Is there some other way GNOME Disks can access the USB drive?

Thanks.
Comment 13 Michael Catanzaro 2017-02-20 05:16:20 UTC
I don't know how to help with that, sorry. I would ask the udisks developers at https://github.com/storaged-project/udisks. Let's keep this bug report focused on the confusing nautilus sidebar.
Comment 14 wolf_volpi 2017-02-20 15:01:57 UTC
(In reply to Michael Catanzaro from comment #13)
> I don't know how to help with that, sorry. I would ask the udisks developers
> at https://github.com/storaged-project/udisks. Let's keep this bug report
> focused on the confusing nautilus sidebar.

I submitted an issue at https://github.com/storaged-project/udisks/issues/207

I inserted the USB drive in Chrome OS, and it recognized and reformatted the USB drive.
Then I put the USB drive in Fedora 25 PC again and it worked with GNOME Disk without incident.
Comment 15 António Fernandes 2017-08-23 10:35:03 UTC
*** Bug 786467 has been marked as a duplicate of this bug. ***
Comment 16 António Fernandes 2017-08-23 10:36:22 UTC
*** Bug 778821 has been marked as a duplicate of this bug. ***
Comment 17 Strangiato 2017-08-23 13:02:18 UTC
Several times I got an error when I tried format bootable pen drives using nautilus. I did not know how to solve the issue until read comment 1 from bug 786467. Suggestion from comment 6 looks good to improve usability.
Comment 18 André Klapper 2021-06-18 15:53:32 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version of Files (nautilus), then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/nautilus/-/issues/

Thank you for your understanding and your help.