0

I have a USB that is stuck in read only. I can't format it or delete its partitions. I was wondering if anyone knows of a way to fix this. In the fdisk screenshot the size of the partitions and the sectors seemed really unusual so i included a screenshot.

Screenshot of fdisk partition list

Screenshot of gparted partition list

2
  • You need to unmount the file system at /dev/sdb1 before you can modify or recreate the partition table (safely). Does it work now? I don't recommend using GPT on external media. It reduces compatibility and has no advantages over MBR at the moment. Feb 29, 2016 at 9:52
  • Flash drives do wear out, when they do they enter read only mode to preserve data. Consider the possibility that the drive has seen better days and you should preserve anything valuable from the drive before it completely fails.
    – MacGuffin
    Jan 26, 2021 at 14:25

2 Answers 2

1

try mounting with read write options

sudo mount -t ntfs -o rw /dev/sdb1 /mnt

then try accessing it if doesn't work which is more likely cause i think you may have tried these obvious stuff then that unalloccated is weird just make a backup of all data , delete the partition from gparted ,delete the partition table just to be safe recreate a partition table and create an new healthy partition if none of these works then just bring out the legendary pokemon,the last resort which is a little slow but always works "ONLY DO IT AS LAST RESORT"

dd if=/dev/zero of=/dev/sdb

this will fill the whole thing with zeros any corruption will be overwritten . Good Luck

0

A few observations:

  1. As others have mentioned, you need to unmount the partition before you can edit the partition table.

  2. You need to run fdisk on the raw device and not a partition. i.e.:

    fdisk /dev/sdb
    

    The correct partition table should then be visible.

  3. To actually attempt to fix the filesystem run:

    fsck /dev/sdb1
    
  4. If all else fails, try mounting the disk on a Windows machine. This may repair any filesystem damage. (It might also end up wiping the disk; Windows has a nasty tendency to break things.)

    The reason this might work is that the Linux NTFS drivers are quite conservative about repairing filesystem damage and won't attempt a repair if they're not 100% sure the operation is safe (the driver docs specifically mention this but I don't have a reference readily at hand).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.