4

My USB is a Sandisk Cruzer 8 GB drive with USB 2.0. It says it's write protected when I try to format it.

Is there a way to force format it ?

I try'd some of this ways :

varun@varun-pc ~ $ sudo fdisk -l
[sudo] password for varun:
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x616d49a5

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      718847      358400    7  HPFS/NTFS/exFAT
/dev/sda2          718848   204799999   102040576    7  HPFS/NTFS/exFAT
/dev/sda3       204800000   567169023   181184512    7  HPFS/NTFS/exFAT
/dev/sda4       567174886   976768064   204796589+   f  W95 Ext'd (LBA)
Partition 4 does not start on physical sector boundary.
/dev/sda5       567174888   575753534     4289323+  82  Linux swap / Solaris
/dev/sda6       630197883   976768064   173285091    7  HPFS/NTFS/exFAT
Partition 6 does not start on physical sector boundary.
/dev/sda7       575754240   630196223    27220992   83  Linux

Partition table entries are not in disk order

Disk /dev/sdb: 8004 MB, 8004304896 bytes
19 heads, 5 sectors/track, 164562 cylinders, total 15633408 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000570f2

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048    15632383     7815168    7  HPFS/NTFS/exFAT
varun@varun-pc ~ $ umount /dev/adb1
umount: /dev/adb1 is not mounted (according to mtab)
varun@varun-pc ~ $ sudo fsck.vfat -f -p /dev/sdb1
dosfsck 3.0.13, 30 Jun 2012, FAT32, LFN
Currently, only 1 or 2 FATs are supported, not 0.

varun@varun-pc ~ $ sudo fsck.vfat -f -v /dev/sdb1
dosfsck 3.0.13 (30 Jun 2012)
dosfsck 3.0.13, 30 Jun 2012, FAT32, LFN
Currently, only 1 or 2 FATs are supported, not 0.
Thomas Ward
  • 74,764
user226580
  • 41
  • 1
  • 1
  • 2
  • 1
    Sometimes this is the sign of a dying USB flash drive. I wouldn't trust it with anything important. – Marc Jul 08 '15 at 01:58

1 Answers1

2

You can use GParted to format partitions.

Unmount all the partitions on the USB stick, and then delete them. You can then create partitions as you like - creating a new partition table first (under Device) may also help. The is some documentation here if you need any.

This should effectively wipe any partitions and any data in them. - remember to click this green button, or it won't do anything smiley:

Be sure what you are formatting - the computer's primary hard drive is usually sda, and may contain important things (e.g. dual booted windows)

Wilf
  • 30,194
  • 17
  • 108
  • 164
  • does not work on exfat – dman Jun 25 '18 at 00:46
  • @dman - It does in my experience - except creating and modifying exfat requires special drivers AFAIK (probably https://askubuntu.com/a/374627/178596), though support is still a bit limited – Wilf Jun 25 '18 at 08:36
  • gparted read only error. – dman Jun 27 '18 at 02:12
  • @dman - that my be due to it being corrupted or a write protection (especially if it does not normally work in other programs). You could ask a question (you would need to supply device info, and errors that occur like in dmesg. – Wilf Jun 27 '18 at 15:49
  • Or it may be tagged as in use by another system (or the system itself if its a live install) – Wilf Jun 27 '18 at 15:56