Can't format Ubuntu installation stick

222,867

Solution 1

I got this fixed by doing the following

  1. On your unity dash, type gnome-disks and launch the Disks application

  2. Select the disk or drive you want to format

  3. Press CTRL+F

  4. Click format.

After formatting, the disk or drive would be unallocated, therefore you'll have to create a partition by using the plus button on the screen. Then insert the name you'll like to use as the drive or disk name then click on create.

Solution 2

Make sure you have GParted installed. In a terminal window, run

sudo apt install gparted

Then open GParted as root (still in the terminal window):

sudo gparted

Select your USB stick from the GParted > Devices dropdown menu. Then click the "Device" tab > Create Partition Table...

This will erase all the data from the stick, so be sure you don't have anything valuable in it.

There will be an unallocated space left, double click it to create a new partition with your settings, such as disk label and filesystem (you'll probably want it to be NTFS).

Don't forget to apply your configuration by clicking the green "check" button in GParted.

Solution 3

You can use the terminal:

1. Find device ID:

df -h

2. Now unmount the device:

sudo umount /dev/sdb1

(change sdb1 with your device id)

3.Format USB

Choose a file system:

Ext4

sudo mkfs.ext4 /dev/sdb1

Fat

sudo mkfs.vfat /dev/sdb1

Ntfs

sudo mkfs.ntfs /dev/sdb1

Solution 4

If the standard tools cannot restore the USB installer stick alias pendrive to a standard storage device, you can use mkusb-dus, which has a menu option to do it automatically,

  • wipe the first megabyte and restore the drive to a standard storage device (with the MSDOS partition table and a partition with the FAT32 file system).

See these links

There is a more general description of what to do, if you have problems with a USB pendrive in the following link,

enter image description here

enter image description here

Solution 5

Check disk by issuing below command

sudo fdisk -l

You can find the usb disk, usually it would be /dev/sdb or /dev/sdc. Check if any of the partitions of the disk is not being used.

sudo df -h

If you find any of the disk partitions like /dev/sdb1 or /dev/sdc1 then you need to unmount it first:

sudo umount /dev/sdb1

Now format the USB stick with desired file system like fat (general), ext4 (Linux) or ntfs (Windows):

sudo mkfs.ext4 /dev/sdb
sudo mkfs.fat /dev/sdb
Share:
222,867

Related videos on Youtube

Random Person
Author by

Random Person

I am not much active because of personal stuff. If you really wanna contact me; I don't think that anyone would really wanna talk to me.. anyway; just ping me in AUGR.. I might respond late.

Updated on September 18, 2022

Comments

  • Random Person
    Random Person over 1 year

    I've made an USB installer stick from Windows with Ubuntu 16.04 LTS , now I'm trying to format it from Ubuntu. When I try to format I get this error :

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

    • Admin
      Admin over 4 years
      I had this problem because I had the physical read-only tab set on the sd card.
    • Admin
      Admin about 4 years
      I know it's too late but I will add the solution anyway. You can follow the instructions here, it works for me and very easy: itsfoss.com/cant-format-usb-disk
  • Alan Jameson
    Alan Jameson about 7 years
    This is the Best answer. OP can do what he needs easily.
  • wadie
    wadie about 7 years
    dus is awesome and easy to use! I love this
  • David Foerster
    David Foerster about 7 years
    This won't help because it appears there is no partition table and hence no partitions to format on the device in question in the first place.
  • David Foerster
    David Foerster almost 7 years
    You're missing the point: there are no partitions to format according to the question. Your explanation how to format partition is correct but not helpful here.
  • Sebastian Wozny
    Sebastian Wozny almost 7 years
    this should be the accepted answer. everything else is too complicated.
  • ChaosPredictor
    ChaosPredictor over 6 years
    After it i got: "The destination is read-only." run: "sudo killall nautilus" to solve it
  • Bunjip
    Bunjip about 6 years
    This almost does the trick. I needed to press ALT+F instead of CTRL+F though
  • saubhik
    saubhik almost 6 years
    Works on Fedora 28 Workstation too with Gnome 3.28.2!
  • Suraj
    Suraj over 5 years
    I did this now, suddenly, my laptop is not reading the USB drive.
  • Malik A. Rumi
    Malik A. Rumi about 5 years
    @Suraj I got the same result, but there is a dark triangle right next to the gear icon. It looks like those play buttons on audio and video. Anyway, I hovered over it and it said 'mount this device', so I clicked it (I already knew it was unmounted) and presto! we are back in business. Hope this helps you!
  • mitchus
    mitchus over 4 years
    Thanks, this worked, but I thought I had been trying that all along! :)
  • Bobbi Bennett
    Bobbi Bennett over 4 years
    Neither ALT or CTRL worked now. Instead, in Disks, find 'Drive Options' on the task bar, where Format is.
  • Sachin Kumar
    Sachin Kumar over 4 years
    This answer has worked for me twice. thanks, alot.
  • noname
    noname almost 4 years
    "In Ubuntu 19, now it has been changed to CTRL+D to format a drive and CTRL+P to format a partition in a drive." comment on a related thread: askubuntu.com/questions/283545/…
  • Heisenberg
    Heisenberg over 3 years
    Thanks, that worked
  • Ermanas
    Ermanas about 3 years
    I was trying to format a usb stick which I was using for to install ubuntu, it was bootable. When I check the disk partitions, there were 3 parts and I was trying to format one by one like sudo mkfs.vfat /dev/sdb1 but it didn't work for me. I tried without one by one like, First I unmounted with sudo umount /dev/sdb and I formatted with sudo mkfs.vfat /dev/sdb I hope it might work for you.
  • user345394
    user345394 over 2 years
    Did not work on my Ubuntu 20.04 (latest at this time) computer.