0

I dual booted my laptop and used a memory stick to do this. Now that I am finished, I am in ubuntu, and want to be able to reuse said memory stick. Just clicking format and changing it brings up an error. How do I do this? Thanks in advance.

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)

PolkaDot
  • 103

4 Answers4

3

If your USB stick was made using Startup Disk Creator, the partition format is read only ISO9660.

Some formatting utilities do not handle ISO9660 very well.

The easiest method I have found to recover such drives is by using the Wipe function in mkusb.

mkusb / wipe | Ubuntu Community Help Wiki

I generally wipe the first MB then create a new MSDOS partition table and a partition with the FAT32 file system.

C.S.Cameron
  • 20,530
  • 12
  • 78
  • 125
2

Open the Disks Application and select the drive in questions then in the upper right hand corner click on the dropdown menu and it should give you the option to reformat and erase the drive. You will need to create a new partition during this process.

Alternatively you can download and install GParted to do the same thing.

sudo apt-get install gparted

You will need to create a new partition on the drive after erasing it if you used GParted or Disks (Credit to Yamboy1)

Please be sure that you are selecting the correct drive when doing this, you do not want to accidentally reformat your hard drive.

Robby1212
  • 910
  • 1
  • 10
  • 28
0

Try gparted first as others have suggested. If that doesn't work, you can try what I've written below, which will reformat your USB as a single partition.

Type lsblk -p. This will give you a list of all of the partitions Ubuntu sees along with the full path to where they're mounted. It should look like this: enter image description here In my case, the USB corresponds to /dev/sdb. Yours may differ. Note that at the end of mount point line for the USB is the USB's name. You can verify this by opening Nautilis ('Files' in Ubuntu) and checking your USB's name. Note that in my screenshot /dev/sda contains branches to /dev/sda1, /dev/sda2, etc. These branches are partitions. You should unmount these before continuing. You can do so by typing umount /dev/sdxx, where the first x is the letter after sd and the second x is the partition number. Once all of the partitions have been unmounted type mkfs.vfat /dev/sdx. NOTE: Substitute x with the letter that you used when unmounting the partitions. This process should reformat your USB as a single partition with the vFAT file system. vFAT is an improved version of FAT and is backward compatible.

0

Using the Disks utility or fdisk command to clean the partition table and format the USB flash drive:

A. Using the Disks utility:

  1. Open Disks utility, select the USB flash drive, and from the 3 dots select Format Disk. using the Disks utility 1
  2. Select the erase and partitioning method, and click Format. using the Disks utility 2

using the Disks utility 3

  1. Create a new partition by clicking on +.

using the Disks utility 4

using the Disks utility 5

  1. Select the appropriate format type, and click Create.

using the Disks utility 6

  1. Flag the partition as bootable

enter image description here

B. Using the fdisk command:

Assuming the USB flash drive is sdc (check with lsblk command)

  1. Apply the flowing command: sudo fdisk /dev/sdc.

  2. write o and press Enter to create a new DOS (MBR) disklabel with disk identifier.

  3. Write n and press Enter to create a new partition.

  4. Write p and press Enter to create a primary partition.

  5. Accepting defaults by press Enter.

  6. Write a and press Enter to flag the partition as bootable.

  7. Write w and press Enter to save the changes.

  8. Disconnect and reconnect the USB flash drive.

  9. Format partition using mkfs command : sudo mkfs.ntfs /dev/sdc1 or sudo mkfs.ext4 /dev/sdc1 or sudo mkfs.fat -F 32 /dev/sdc1.

Talaat Etman
  • 1,340