sudo parted /dev/sda
Warning: Unable to open /dev/sda read-write (Read-only file system). /dev/sda has been opened read-only.
GNU Parted 3.6
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Error: The backup GPT table is corrupt, but the primary appears OK, so that will be used.
OK/Cancel? OK
Warning: Not all of the space available to /dev/sda appears to be used, you can fix the GPT to use all of the space (an
extra 106878524 blocks) or continue with the current setting?
Fix/Ignore? ignore
Model: SanDisk Ultra Fit (scsi)
Disk /dev/sda: 62,1GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 32,8kB 7361MB 7361MB ISO9660 hidden, msftdata
2 7361MB 7387MB 26,2MB Appended2 boot, esp
3 7387MB 7387MB 307kB Gap1 hidden, msftdata
(parted) mklabel
New disk label type? msdos
Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to
continue?
Yes/No? yes
Error: Can't write to /dev/sda, because it is opened read-only.
Filesystem corruption often causes a USB stick to mount as read-only. This can occur if we remove the USB stick without unmounting it or if a power failure causes an interruption.
To fix filesystem errors, we use the fsck command.
First, we need to unmount the USB stick:
$ sudo umount /dev/sda1
Here, we replace /dev/sda1 with the name of the USB stick.
Next, let’s check the USB stick for filesystem corruption. Since we’re using an exFAT-formatted USB stick, we employ fsck.exfat:
$ sudo fsck.exfat /dev/sda1
You can try this, if you know what filesystem is on the drive. then mount it and try again to remove everything with parted or Gparted and create a new filesystem.
It is pretty common for them to fail read-only but hard to say if that is the issue or not. dd should always be able to write no matter what the format is.
Same happend with my usb drive a few months ago. It was a pretty new one and i pulled it out without unmounting it. The usb locked it self out as what you have. I tried everything to format it and also used the commands above. In the end i destroyed the usb device and bought a new one.