1

How can I reformat a Flash drive to be not partitioned and ext4? The Disks utility does not work for me.

enter image description here This drive has no partitions currently and I have no need for Master Boot Record and it is not > 2TB which is supported by GPT, so I selected no partitioning.

I am using the More Actions cog wheel from where I select Format.

enter image description here

Here is the error: enter image description here

Selecting no partitioning is not the only way to get this error. Selecting Master Boot Record or > 2TB GPT results in the same error.

I am of course presuming that More Actions > Format is a necessary step before adding a partition. If it is not, then why not?

Edit:

Proceeding to try random things tolerating Ubuntu far more than I should, I tried to create a new partition with the + icon.

Create a new partition

Here's the error:

Similar error

H2ONaCl
  • 9,693

1 Answers1

1

This is a longstanding (reported October, 2012), incredibly overlooked bug: see https://askubuntu.com/a/629043/16395. It will be fixed in the next release.

The solution is to use gparted, or format the device with command-line:

mkfs.ext4 /dev/device 

(necessary sudo and device name omitted for obvious reasons).

Anyway, I strongly advise against using a whole, unpartitioned device. It will probably not automount or misbehave in a lot of cases. Create a partition table, one big partition, and format it --- you'll lose a couple of megabytes but you'll have a much more standard device.

To use gparted (short guide because How to format a USB flash drive? has a video --- I hate that...)

After started gparted, remember to (1) choose the right device (triple check, and then again) and (2) unmount it if mounted (you can say it's mounted because then option like partition, format, etc are dimmed):

gparted1

then create a partition table if needed:

gparted2

and create a big partition with Partition->New. Choose (1) a primary partion, the (2) right type, and if you add a label in (3) this will be the name of the device when automounted.

gparted3

...and then format it:

gparted4

Notice that gparted will not do all the operation instantly. It will create a list in the bottom window...:

gparted5

...and to really do it you have to choose Edit->Apply all.. :

gparted6

... you're done!

And a final note. If you format your filesystem as ext4, you have to change the ownership of its root directory after the formatting --- otherwise it will be owned by root.

For vfat and msdos-like filesystems this is not a problem, because the auto-mounter will force the ownership to you anyway. In the case of unix-like filesystem this will not happen. So after you mount your new device, you have to

 sudo chown $USER /media/$USER/newdevice/.

...and then be sure that you have the same UID on all the machines you use.

Rmano
  • 31,947
  • 1
    Ok. I was not aware of the distinction between no partitioning and "one big partition". I don't mind losing a small amount of space to be more standard. I will try gparted and one big partition. – H2ONaCl Oct 02 '15 at 17:30
  • I found gparted needs to be run by the root. Later the device is owned by root, so if your label is Flash and your name is jack you would sudo chown -R jack:jack /media/jack/Flash. Perhaps chmod might be better. – H2ONaCl Oct 02 '15 at 19:14
  • Checking my other Flash drives, they seem to be owned by me and not root. Root ownership seems to have been a result of how gparted was used so if permissions is an issue, chown might be better than a liberal application of chmod. – H2ONaCl Oct 02 '15 at 20:41
  • @H2ONaCl --- right you are. I've added a bit to the answer. – Rmano Oct 02 '15 at 21:06
  • I think your chown command has an unnecessary dot at the end. – H2ONaCl Oct 07 '15 at 04:15