0

I have an USB flash drive which is a gift from a company event. It was formatted into two partitions and one of it is locked to read-only. The company includes advertising documents in this partition. I would like to unlock it and return it into one good usb. I tried disk management utility, diskpart in cmd, but failed.

First I tried right-click format disk, and windows repond with "unable to complete the format".

Then I tried disk management utility but failed because of "write-protected usb".

Then I enter diskpart tried "clean", "create partition primary", "attributes disk clear readonly", "format FS=NTFS label=Data quick". "attribute disk" still tells me disk is in "read-only state" and "format" command failed due to media is write-protected.

2
  • 2
    Under the hood it may be a USB hub with a flashdrive and (emulated) CD-ROM. Or the firmware of the memory controller inside may not allow you to alter certain areas of the memory. What exact commands/actions did you try? What was the output? How did it fail? Any error messages? Please respond by editing the question. Commented Sep 2, 2019 at 10:49
  • 1
    Does this answer your question? What can I do if my USB flash drive is write-protected or read-only? Commented Jun 25 at 10:59

2 Answers 2

0

As long as you don't have any sensitive information on the drive, you can boot into a Linux LiveCD, and image the disk with zeros if you want to be hardcore about it with:

sudo dd if=/dev/zero of=/dev/sdX bs=4M status=progress

Where X is the number of your USB drive.

It's also simpler to just format it from a Linux LiveCD using a utility like GParted. Sometimes that does not work, if it doesn't, then it is best to just do the above.

If you do decide to format the drive with zeros, create a new partition table (GPT is the best) and create a new FAT32 (best for portability) partition or a new NTFS (if you're only using it for Windows) partition.

14
  • tried GParted, it says "cant write because opened read only"
    – mrr010
    Commented Sep 3, 2019 at 13:52
  • Then try dd'ing the entire drive; that works on read-only partitions
    – user962725
    Commented Sep 3, 2019 at 14:03
  • dd:failed to open '/dev/sdf': Read-only file system
    – mrr010
    Commented Sep 3, 2019 at 14:21
  • Run mount, then unmount any partitions on the drive shown, then dd it again: maybe also use sudo if you haven't been
    – user962725
    Commented Sep 3, 2019 at 14:23
  • GDisk doesn't really care too much about mounted partitions, so you may want to use that as well
    – user962725
    Commented Sep 3, 2019 at 14:28
-1

if it's ready only, you can't format in anyway, but there's a trick and that's your chance if it works or not. I tried it and it worked for me on my Sony 16GB flash drive.most times usb get "ready only" if it's pulled out without ejecting properly or safely removing it from your OS.this enables hardware write protection of your usb. To remove this, plug usb and unplug it fast! yeah same wrong action should be repeated! remove not safely.hope in this way the write protection will be disabled.then go to formatting process through command line! good luck

1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Sep 23, 2022 at 4:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .