Read-Only USB Stick unable to format

Okay, So a little bit of back story my flatmate brought me his USB Stick to fix it as it's size on his PC was appearing only 8Mbs while the actual size is 16Gbs so I looked into it and the windows disk manager was also showing 8Mbs as well and no other partitions. I asked what he did with it and he told me that he gave it to a friend and got it back like this. I had EaseUS partition manager so I copied it my USB and installed it on his pc but that gave a read-only error so I brought it to my room to see if I can fix it on Linux. So I plugged it in and started Gparted and it gave me this error.
Error 1
this is what the info sign says
Error

Failed to read last sector (31275006): Invalid argument
HINTS: Either the volume is a RAID/LDM but it wasn't setup yet,
   or it was not setup correctly (e.g. by not using mdadm --build ...),
   or a wrong device is tried to be mounted,
   or the partition table is corrupt (partition is smaller than NTFS),
   or the NTFS boot sector is corrupt (NTFS size is not valid).
Failed to mount '/dev/sdb1': Invalid argument
The device '/dev/sdb1' doesn't have a valid NTFS.
Maybe you selected the wrong device? Or the whole disk instead of a
partition (e.g. /dev/hda, not /dev/hda1)? Or the other way around?

Failed to open '/dev/sdb1'.

Failed to read last sector (31275006): Invalid argument
HINTS: Either the volume is a RAID/LDM but it wasn't setup yet,
   or it was not setup correctly (e.g. by not using mdadm --build ...),
   or a wrong device is tried to be mounted,
   or the partition table is corrupt (partition is smaller than NTFS),
   or the NTFS boot sector is corrupt (NTFS size is not valid).
Failed to mount '/dev/sdb1': Invalid argument
The device '/dev/sdb1' doesn't have a valid NTFS.
Maybe you selected the wrong device? Or the whole disk instead of a
partition (e.g. /dev/hda, not /dev/hda1)? Or the other way around?

Unable to read the contents of this file system!
Because of this some operations may be unavailable.
The cause might be a missing software package.
The following list of software packages is required for ntfs file system support:  ntfs-3g / ntfsprogs.

When I tried to formate it.
It gives the same read-only error so I tried

[Yasir@Markhor ~]$sudo hdparm -r0 /dev/sdb
/dev/sdb:
 setting readonly to 0 (off)
 readonly      =  0 (off)

but the error doesn't go way same for /dev/sdb1 so what should I do please guide me a bit I'm not too good in this.
Error 2

Create a new partition table on it, then format it something else to test, for instance as ext4, then format it again to fat or ntfs ... :slight_smile:

No, Not Working

Then you can kiss goodby that stick. :slight_smile: Maybe your friends friend gave back a fake one :stuck_out_tongue:

When you hit that delete button what happens? I had similar problem when I remove HDD during creating partition. It was then only few MB big. It looks like similar problem. Then press the Nike symbol

What do you mean, how are you trying to put the new partition table on it? What error did you get?

I'll upload a video my writing skills are not so good, Just give me minute. :slight_smile:

So This What is happening. Gparted Log

Delete it first

You are formatting it.

You need to put a new partition table on it before you format it.

In gparted under "Device" menu, "Create partition table"

already tried but doesn't work

Same Error

Close gparted and try doing it from the command line:

sudo parted /dev/sdx -- mklabel gpt

Replace /dev/sdx with the correct device name. Importantly, don't use the wrong device name as that would make all your data inaccessible.

If that doesn't work, please share the full command you used as well the text output.

Here the output

[yasir@Markhor ~]$ sudo parted /dev/sdb -- mklabel gpt
[sudo] password for yasir: 
Warning: Unable to open /dev/sdb read-write (Read-only file system).  /dev/sdb
has been opened read-only.
Error: Can't write to /dev/sdb, because it is opened read-only.
Ignore/Cancel? C  

Does it have a physical write protect tab on the device?

What does the command mount | grep sdb return?

nothing

[yasir@Markhor ~]$ mount | grep sdb
[yasir@Markhor ~]$ 

So, the software flags don't show it is as read only, there is no physical switch on it to make it read only and it isn't currently mounted.

That seems bad. I am out of ideas.

Try
sudo hdparm -r0 /dev/sdb
to see if it removes the read-only. Perhaps it would.

I tried it already it's mentioned in my post.

Sorry, I overlooked it.
:blush:

1 Like

Forum kindly sponsored by