0

I have a USB stick, and I just want to format it. But when I try to do it with Nautilus or Gparted, there is an error because the USB stick file system is read-only...

I found some posts about it, and I try commands like :

 mount -o remount,rw /dev/sdx
 hdparm -r0 /dev/sdx
 dosfsck -a /dev/sdx1
 mkfs.msdos -F 32 /dev/sdx1
 mkfs.msdos -F 32 /dev/sdx1

Replacing the x of /dev/sdx by the right letter of course.

But each time, I have a message telling me that the operation is not allowed because of read-only.

How can I format my USB stick and remove this read-only mode please ?

Rémi
  • 311
  • 5
    Are you sure the USB stick does not have a (hardware) switch that makes it read-only? Open gnome-disks and try to delete any partitions on the USB stick drive. – FedKad Jun 03 '19 at 09:34
  • 4
    That depends on the USB stick. Missing info: where is it from? If store bought does it have a switch on the side? If you got it from a convention or seminair: most of those USB sticks are -internally- set to read only and you can not use them for anything else. Also: if it has a windows filesystem that got corrupted linux will refuse to mount it writeable. – Rinzwind Jun 03 '19 at 09:35
  • Yes, I do not see any switch on the USB stick. With gnome-disks,all options like Format..., Edit partition..., Edit Filesystem..., etc... are disabled. The USB stick is coming from a Store, and I know that it was only used on a Windows computer... But the problem is the same on Windows : I can't remove the read-only mode. – Rémi Jun 03 '19 at 09:43
  • 2
    It's probably defective. Becoming read-only is the first indication it's about to fail. –  Jun 03 '19 at 10:06
  • 1
    Have you tried wiping the USB device completely with dd i.e. dd if=/dev/zero of=/dev/sdx Then attempt formatting with Gparted etc Worth a try before putting it in the bin – Nick Jun 03 '19 at 10:11
  • 1
    I just tried dd if=/dev/zero of=/dev/sdx, but I have an error : > dd: impossible to open '/dev/sdx' : read-only filesystem... There is no solution to reset the USB stick ? – Rémi Jun 03 '19 at 10:16
  • 1
    No, there isn't. Put it in the recycling bin for inorganics. –  Jun 03 '19 at 10:29
  • 2
    There are more details and tips in this link. – sudodus Jun 03 '19 at 11:59
  • If due to using as an installer with ISO9660 partition, unmount using Disks, then create new partition table using GParted. If other reason sudodus' comment worth a shot. Unfortunately GabrielaGarcia is probably correct. – C.S.Cameron Jun 03 '19 at 16:26
  • In the same way, I can't create a new partition table with GParted.. – Rémi Jun 03 '19 at 19:21

0 Answers0