I have a USB stick which (for about 2 months) constantly gets mounted read-only. After a bit of research and testing I found out, that the block devices of the device itself (
/dev/sdc) and one of the partitions (
/dev/sdcX) always has read-only flags (
cat /sys/block/sdc/ro and
cat /sys/block/sdcX/ro is 1).
I'm not talking about mount options! I have to manually set the flag to 0 with
hdparm -r0 /dev/sdcX to be able to mount the partitions as read-write and to write at them (yes, writing works) every time I plug in the USB stick and after a reboot. The USB stick has no read-only hardware switch. I already formatted the partitions, re-created the partition table and even did
dd if=/dev/zero of=/dev/sdc to ensure that the old partition table gets destroyed completely, but nothing changed.
NOTE: Other devices however don't have this read-only flag set by default.
So how does the Linux kernel decide whether to set the read-only flag for a block device by default or not? And how can I change this behavior permanently and from early boot? (I actually boot my Raspberry Pi from this USB stick but the read-only behavior is the same on my laptop with different kernels...)?