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.
2 Answers
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
- 1,070
A few observations:
As others have mentioned, you need to unmount the partition before you can edit the partition table.
You need to run
fdiskon the raw device and not a partition. i.e.:fdisk /dev/sdbThe correct partition table should then be visible.
To actually attempt to fix the filesystem run:
fsck /dev/sdb1If 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).
- 143

