0

On 18.04 I've made a bootable pen drive. Now I don't need it. I want to remove the iso9660 partition.

sudo cfdisk /dev/sdb

I tried to delete (it makes) but when I want to save the changes, it fails.

Failed to write disklabel"

It isn't write protected (read-only is 0)

What else should I try?

Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83
  • 2
    dd if=/dev/zero of=/path/to/usb – j-money Feb 19 '19 at 16:29
  • 1
    @j-money In my opinion, this should be an answer, as it does not require anything that is not already installed and is desktop environment agnostic. – Bruni Feb 20 '19 at 08:29

4 Answers4

5

The non-interactive sfdisk can do this from the CLI:

sfdisk --delete /dev/sdb

See man sfdisk for details.

Seamus
  • 636
3

Use gnome-disks. That is the tool I use to remove, create and format partition in my USB drives.

You can easily install it with the command

sudo apt install gnome-disk-utility

Elder Geek
  • 36,023
  • 25
  • 98
  • 183
3

You can use mkusb with a graphical user interface. You can select

  • 'restore to a Standard storage device', or
  • 'Wipe the first mibibyte'.

There are more details at the following links to Ubuntu help wiki pages

If mkusb cannot solve the problem, you can analyze it, and if you are lucky solve it, according to the following link

sudodus
  • 46,324
  • 5
  • 88
  • 152
3

Rather than installing any extra software (and if you're comfortable with the command line), I would suggest using the dd command.

To wipe your USB fire up the gnome-terminal and type

sudo dd if=/dev/zero of=/path/to/usb

As was pointed out in the comments, you may be better off only wipe the MBR so as not to roast the USB

dd if=/dev/zero of=/dev/<path of data drive> bs=512 count=1 seek=0

Edit: Again as stated in comments MBR is in fact not 440 bytes :facepalm:

j-money
  • 2,382