0

Ok so here's what happened.

I had been using a USB stick to re-install Windows 10 and quickly reformat my dads laptop. Now I used the existing Windows 10 to create the live USB drive and I guess it write protected the stick.

Now I've been trying a bunch of things to get my stick back:

  • Bootice
  • Gparted (Format to, Delete)
  • Windows Disk Utility
  • Linux (Cinnamon?) Disk Utility
  • Dispart (clean, recover)
  • Windows quick format

So I pretty much am just getting errors

Unable to format because of I/O Error

Unable to open drive read-write. Drive opened read-only

Unable to format because it's opened read-only

If you have any suggestions on what to do. I have a Linux and a Windows 10 installation so I can try both :)

4
  • Is it possible that the USB stick hardware got corrupted?
    – Yaron
    Commented Jul 16, 2017 at 12:21
  • Sure but I noticed right after installing Win10 with it. Commented Jul 16, 2017 at 12:42
  • I had a similar issue with an external usb hdd. Not sure if it'll help with yours but using Ubuntu 14.04 as root not sudo worked. For sudo I kept getting permission error so as root I chmod 777 the entire usb hdd then formatted as root and all was well. Commented Jul 17, 2017 at 15:32
  • Analyze the problem according to this link and if you are lucky, solve it.
    – sudodus
    Commented Nov 2, 2019 at 17:46

3 Answers 3

2

Your USB stick is in read-only mode because it is failing. All attempts at low-level manipulation (fdisk etc) will mysteriously fail.

Recover your data. SD cards provide the same feature before absolute failure, it’s very handy. If only Windows/etc reported the failure... wouldn’t that be great?

See https://superuser.com/a/543116

0

"Clean" the partition table and file allocation tables.

1: Zero out partition table... and a little more

dd if=/dev/zero of=/dev/sdx bs=2048 count=4

2: Create partitions (use cli "fdisk" or gui "gparted")

Create partition table "msdos"

Create partition(s) (NTFS fat32 ext3 ...)

Format partitions. (gparted does the partition creation and format in 1 step when you choose the partition type)

3: test USB

Tools:

  • "live" OS is perferred but not required.
  • partition creation program like gparted or fdisk
  • PC to work on. A virtual machine will do.

Example:

Boot from the "live" ISO parted magic in a virtual machine. I prefer PartedMagic because everything I need is there in one ISO.

Pass through the USB to the virtual machine. /dev/sdx

Using this live ISO, remember that you are root and please verify that the correct drive is passed through to the virtual machine because if you inadvertently erase the wrong drive there is no undo.

Proceed with step 1.

6
  • I'm getting "failed to open /dev/sdb: Read-only file system" Commented Jul 19, 2017 at 9:43
  • Not good. What command, and OS is giving you this error? Are you able to delete the partitions with gparted?
    – jc__
    Commented Jul 19, 2017 at 15:42
  • the exact commands would be: "sudo dd if=/dev/zero of=/dev/sdb1 bs=2048 count=4" and "sudo dd if=/dev/zero of=/dev/sdb bs=2048 count=4". I am using Antergos. I am not able to do anything with gparted. Commented Jul 19, 2017 at 21:05
  • sudo dd if=/dev/zero of=/dev/sdb bs=2048 count=4 would be the one you want because it is "outside" of the partitions. The drive must not be mounted at this time.
    – jc__
    Commented Jul 19, 2017 at 21:13
  • Could you paste the output of sudo fdisk -l /dev/sdb, or sudo fdisk -l. Also if no gparted you could attempt to delete a partition with sudo fdisk /dev/sdb. If you could zero out the partition table there would not be any partitions to delete, but you could create them with fdisk.
    – jc__
    Commented Jul 19, 2017 at 21:16
0

jc__'s answer regarding zeroing the drive first & recreating the partitions first would be my first go-to, I don't have enough reputation to comment though, that if that's still not doing anything you might want to try

hdparm -r 0 [device]

and

blockdev --setrw [device]

to change hard drive parameters

You must log in to answer this question.

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