Hi @hcvv ,
I connect (plug) the pendrive on the box. Please, note “Write Protect is off” in /var/log/messages
2024-09-18T13:11:50.040105-03:00 localhost kernel: [ 182.148868][ T147] usb 8-1: new high-speed USB device number 2 using ehci-pci
2024-09-18T13:11:50.208171-03:00 localhost kernel: [ 182.316862][ T147] usb 8-1: New USB device found, idVendor=058f, idProduct=6387, bcdDevice= 1.04
2024-09-18T13:11:50.208194-03:00 localhost kernel: [ 182.316877][ T147] usb 8-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
2024-09-18T13:11:50.208196-03:00 localhost kernel: [ 182.316880][ T147] usb 8-1: Product: Mass Storage
2024-09-18T13:11:50.208197-03:00 localhost kernel: [ 182.316882][ T147] usb 8-1: Manufacturer: Generic
2024-09-18T13:11:50.208198-03:00 localhost kernel: [ 182.316884][ T147] usb 8-1: SerialNumber: C927AB09
2024-09-18T13:11:50.214136-03:00 localhost mtp-probe: checking bus 8, device 2: "/sys/devices/pci0000:00/0000:00:1d.7/usb8/8-1"
2024-09-18T13:11:50.214284-03:00 localhost mtp-probe: bus: 8, device: 2 was not an MTP device
2024-09-18T13:11:50.228033-03:00 localhost kernel: [ 182.338871][ T2650] usb-storage 8-1:1.0: USB Mass Storage device detected
2024-09-18T13:11:50.228050-03:00 localhost kernel: [ 182.339033][ T2650] scsi host6: usb-storage 8-1:1.0
2024-09-18T13:11:50.228052-03:00 localhost kernel: [ 182.339114][ T2650] usbcore: registered new interface driver usb-storage
2024-09-18T13:11:50.232033-03:00 localhost kernel: [ 182.342547][ T2650] usbcore: registered new interface driver uas
2024-09-18T13:11:50.234089-03:00 localhost mtp-probe: checking bus 8, device 2: "/sys/devices/pci0000:00/0000:00:1d.7/usb8/8-1"
2024-09-18T13:11:50.234159-03:00 localhost mtp-probe: bus: 8, device: 2 was not an MTP device
2024-09-18T13:11:51.256032-03:00 localhost kernel: [ 183.367193][ T63] scsi 6:0:0:0: Direct-Access Generic Flash Disk 8.07 PQ: 0 ANSI: 4
2024-09-18T13:11:51.256054-03:00 localhost kernel: [ 183.367606][ T63] sd 6:0:0:0: Attached scsi generic sg2 type 0
2024-09-18T13:11:51.260038-03:00 localhost kernel: [ 183.369442][ T65] sd 6:0:0:0: [sdc] 15974400 512-byte logical blocks: (8.18 GB/7.62 GiB)
2024-09-18T13:11:51.260052-03:00 localhost kernel: [ 183.370615][ T65] sd 6:0:0:0: [sdc] Write Protect is off
2024-09-18T13:11:51.260054-03:00 localhost kernel: [ 183.370619][ T65] sd 6:0:0:0: [sdc] Mode Sense: 23 00 00 00
2024-09-18T13:11:51.260055-03:00 localhost kernel: [ 183.371726][ T65] sd 6:0:0:0: [sdc] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
2024-09-18T13:11:51.272083-03:00 localhost kernel: [ 183.383807][ T65] sdc:
2024-09-18T13:11:51.272093-03:00 localhost kernel: [ 183.383967][ T65] sd 6:0:0:0: [sdc] Attached SCSI removable disk
Then I try this command:
dd if=/dev/zero of=/dev/sdc count=10
10+0 records in
10+0 records out
5120 bytes (5.1 kB, 5.0 KiB) copied, 0.536356 s, 9.5 kB/s
And the output in /var/log/messages was this:
2024-09-18T13:18:05.248065-03:00 localhost kernel: [ 557.359852][ T2654] sd 6:0:0:0: [sdc] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=0s
2024-09-18T13:18:05.248080-03:00 localhost kernel: [ 557.359858][ T2654] sd 6:0:0:0: [sdc] tag#0 Sense Key : Not Ready [current]
2024-09-18T13:18:05.248082-03:00 localhost kernel: [ 557.359861][ T2654] sd 6:0:0:0: [sdc] tag#0 <<vendor>>ASC=0xff <<vendor>>ASCQ=0xff
2024-09-18T13:18:05.248083-03:00 localhost kernel: [ 557.359864][ T2654] sd 6:0:0:0: [sdc] tag#0 CDB: Write(10) 2a 00 00 00 00 00 00 00 10 00
2024-09-18T13:18:05.248093-03:00 localhost kernel: [ 557.359865][ T2654] I/O error, dev sdc, sector 0 op 0x1:(WRITE) flags 0x800 phys_seg 2 prio class 0
2024-09-18T13:18:05.248096-03:00 localhost kernel: [ 557.359874][ T2654] Buffer I/O error on dev sdc, logical block 0, lost async page write
2024-09-18T13:18:05.248097-03:00 localhost kernel: [ 557.359884][ T2654] Buffer I/O error on dev sdc, logical block 1, lost async page write
2024-09-18T13:18:05.252019-03:00 localhost kernel: [ 557.362129][ T538] sd 6:0:0:0: [sdc] Write Protect is on
2024-09-18T13:18:05.252026-03:00 localhost kernel: [ 557.362135][ T538] sd 6:0:0:0: [sdc] Mode Sense: 23 00 80 00
2024-09-18T13:18:05.260025-03:00 localhost kernel: [ 557.371382][ T538] sdc: sdc1 sdc2 sdc3
The system auto protect (EFI? isohybrid? iso9660?) and shows “Write Protect is on”.
I try change with hdparm:
localhost:/home/ # hdparm -v -r /dev/sdc*
/dev/sdc:
multcount = 0 (off)
readonly = 1 (on)
readahead = 1024 (on)
geometry = 7800/64/32, sectors = 15974400, start = 0
/dev/sdc1:
multcount = 0 (off)
readonly = 1 (on)
readahead = 1024 (on)
geometry = 7800/64/32, sectors = 7812, start = 276
/dev/sdc2:
multcount = 0 (off)
readonly = 1 (on)
readahead = 1024 (on)
geometry = 7800/64/32, sectors = 247912, start = 8088
/dev/sdc3:
multcount = 0 (off)
readonly = 1 (on)
readahead = 1024 (on)
geometry = 7800/64/32, sectors = 15718400, start = 256000
localhost:/home/ # hdparm -v -r0 /dev/sdc*
/dev/sdc:
setting readonly to 0 (off)
multcount = 0 (off)
readonly = 1 (on)
readahead = 1024 (on)
geometry = 7800/64/32, sectors = 15974400, start = 0
/dev/sdc1:
setting readonly to 0 (off)
multcount = 0 (off)
readonly = 1 (on)
readahead = 1024 (on)
geometry = 7800/64/32, sectors = 7812, start = 276
/dev/sdc2:
setting readonly to 0 (off)
multcount = 0 (off)
readonly = 1 (on)
readahead = 1024 (on)
geometry = 7800/64/32, sectors = 247912, start = 8088
/dev/sdc3:
setting readonly to 0 (off)
multcount = 0 (off)
readonly = 1 (on)
readahead = 1024 (on)
geometry = 7800/64/32, sectors = 15718400, start = 256000
None changes. The devices keeps in readonly.
Now, I umount the usb pendrive device:
2024-09-18T13:22:50.795735-03:00 localhost udisksd[1481]: Mounted /dev/sdc2 at /run/media/user/openSUSE-Leap-15.1-NET-x86_64470 on behalf of uid 1000
2024-09-18T13:22:50.796074-03:00 localhost kernel: [ 842.904892][ T3212] ISO 9660 Extensions: Microsoft Joliet Level 3
2024-09-18T13:22:50.796085-03:00 localhost kernel: [ 842.906643][ T3212] ISO 9660 Extensions: RRIP_1991A
2024-09-18T13:22:51.965851-03:00 localhost udisksd[1481]: Cleaning up mount point /run/media/user/openSUSE-Leap-15.1-NET-x86_64470 (device 8:34 is not mounted)
2024-09-18T13:22:51.965982-03:00 localhost udisksd[1481]: Unmounted /dev/sdc2 on behalf of uid 1000
2024-09-18T13:22:51.966547-03:00 localhost systemd[1]: run-media-user-openSUSE\x2dLeap\x2d15.1\x2dNET\x2dx86_64470.mount: Deactivated successfully.
2024-09-18T13:22:52.120027-03:00 localhost kernel: [ 844.228400][ T3233] sdc: detected capacity change from 15974400 to 0
2024-09-18T13:22:52.122271-03:00 localhost plasmashell[1661]: file:///usr/share/plasma/plasmoids/org.kde.plasma.devicenotifier/contents/ui/DeviceItem.qml:174:5: Unable to assign [undefined] to QString
2024-09-18T13:22:52.136064-03:00 localhost (udev-worker)[3215]: sdc1: Failed to remove '/dev/disk/by-label/openSUSE-Leap-15.1-NET-x86_64470', ignoring: No such file or directory
2024-09-18T13:22:52.136181-03:00 localhost (udev-worker)[3215]: sdc1: Failed to remove/update device symlink '/dev/disk/by-label/openSUSE-Leap-15.1-NET-x86_64470', ignoring: No such file or directory
2024-09-18T13:22:52.137025-03:00 localhost (udev-worker)[3241]: sdc3: Failed to remove '/dev/disk/by-label/openSUSE-Leap-15.1-NET-x86_64470', ignoring: No such file or directory
2024-09-18T13:22:52.137113-03:00 localhost (udev-worker)[3241]: sdc3: Failed to remove/update device symlink '/dev/disk/by-label/openSUSE-Leap-15.1-NET-x86_64470', ignoring: No such file or directory
2024-09-18T13:22:52.137443-03:00 localhost (udev-worker)[3240]: sdc2: Failed to remove '/dev/disk/by-label/openSUSE-Leap-15.1-NET-x86_64470', ignoring: No such file or directory
2024-09-18T13:22:52.137530-03:00 localhost (udev-worker)[3240]: sdc2: Failed to remove/update device symlink '/dev/disk/by-label/openSUSE-Leap-15.1-NET-x86_64470', ignoring: No such file or directory
2024-09-18T13:22:52.199522-03:00 localhost plasmashell[1661]: file:///usr/lib64/qt5/qml/org/kde/plasma/extras/ExpandableListItem.qml:291: TypeError: Cannot read property 'enabled' of null
2024-09-18T13:22:52.199974-03:00 localhost plasmashell[1661]: file:///usr/lib64/qt5/qml/org/kde/plasma/extras/ExpandableListItem.qml:291: TypeError: Cannot read property 'enabled' of null
2024-09-18T13:22:53.777780-03:00 localhost plasmashell[1661]: file:///usr/lib64/qt5/qml/org/kde/plasma/extras/PlaceholderMessage.qml:238:5: QML Heading: Binding loop detected for property "verticalAlignment"
2024-09-18T13:24:37.633546-03:00 localhost systemd[1]: Starting Cleanup of Temporary Directories...
2024-09-18T13:24:37.725576-03:00 localhost systemd[1]: systemd-tmpfiles-clean.service: Deactivated successfully.
2024-09-18T13:24:37.726047-03:00 localhost systemd[1]: Finished Cleanup of Temporary Directories.
2024-09-18T13:25:10.504106-03:00 localhost kernel: [ 982.615301][ T3249] usb 8-1: USB disconnect, device number 2
Then I with modprobe, unload the usb_storage module and specify the vendor:product of pendrive. Then I plug the pendrive on the box:
2024-09-18T13:26:06.938697-03:00 localhost sudo: root : TTY=pts/2 ; PWD=/home/user ; USER=root ; COMMAND=/usr/sbin/modprobe -r uas usb_storage
2024-09-18T13:26:06.944026-03:00 localhost kernel: [ 1039.054232][ T3271] usbcore: deregistering interface driver uas
2024-09-18T13:26:07.000152-03:00 localhost kernel: [ 1039.107704][ T3271] usbcore: deregistering interface driver usb-storage
[...]
2024-09-18T13:26:15.736030-03:00 localhost kernel: [ 1047.845476][ T3277] usbcore: registered new interface driver usb-storage
2024-09-18T13:26:15.740023-03:00 localhost kernel: [ 1047.849278][ T3277] usbcore: registered new interface driver uas
2024-09-18T13:26:33.560149-03:00 localhost kernel: [ 1065.667563][ T3249] usb 8-1: new high-speed USB device number 3 using ehci-pci
2024-09-18T13:26:33.724039-03:00 localhost kernel: [ 1065.834945][ T3249] usb 8-1: New USB device found, idVendor=058f, idProduct=6387, bcdDevice= 1.04
2024-09-18T13:26:33.724057-03:00 localhost kernel: [ 1065.834956][ T3249] usb 8-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
2024-09-18T13:26:33.724060-03:00 localhost kernel: [ 1065.834959][ T3249] usb 8-1: Product: Mass Storage
2024-09-18T13:26:33.724061-03:00 localhost kernel: [ 1065.834962][ T3249] usb 8-1: Manufacturer: Generic
2024-09-18T13:26:33.724067-03:00 localhost kernel: [ 1065.834964][ T3249] usb 8-1: SerialNumber: C927AB09
2024-09-18T13:26:33.724068-03:00 localhost kernel: [ 1065.835313][ T3249] usb-storage 8-1:1.0: USB Mass Storage device detected
2024-09-18T13:26:33.728037-03:00 localhost kernel: [ 1065.835933][ T3249] scsi host6: usb-storage 8-1:1.0
2024-09-18T13:26:33.733842-03:00 localhost mtp-probe: checking bus 8, device 3: "/sys/devices/pci0000:00/0000:00:1d.7/usb8/8-1"
2024-09-18T13:26:33.733946-03:00 localhost mtp-probe: bus: 8, device: 3 was not an MTP device
2024-09-18T13:26:33.746775-03:00 localhost mtp-probe: checking bus 8, device 3: "/sys/devices/pci0000:00/0000:00:1d.7/usb8/8-1"
2024-09-18T13:26:33.746906-03:00 localhost mtp-probe: bus: 8, device: 3 was not an MTP device
2024-09-18T13:26:34.744042-03:00 localhost kernel: [ 1066.853475][ T63] scsi 6:0:0:0: Direct-Access Generic Flash Disk 8.07 PQ: 0 ANSI: 4
2024-09-18T13:26:34.744062-03:00 localhost kernel: [ 1066.853931][ T63] sd 6:0:0:0: Attached scsi generic sg2 type 0
2024-09-18T13:26:34.744064-03:00 localhost kernel: [ 1066.855147][ T3263] sd 6:0:0:0: [sdc] 15974400 512-byte logical blocks: (8.18 GB/7.62 GiB)
2024-09-18T13:26:34.748095-03:00 localhost kernel: [ 1066.856226][ T3263] sd 6:0:0:0: [sdc] Write Protect is off
2024-09-18T13:26:34.748106-03:00 localhost kernel: [ 1066.856231][ T3263] sd 6:0:0:0: [sdc] Mode Sense: 23 00 00 00
2024-09-18T13:26:34.748111-03:00 localhost kernel: [ 1066.857343][ T3263] sd 6:0:0:0: [sdc] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
2024-09-18T13:26:34.760031-03:00 localhost kernel: [ 1066.869148][ T3263] sdc:
2024-09-18T13:26:34.760053-03:00 localhost kernel: [ 1066.869297][ T3263] sd 6:0:0:0: [sdc] Attached SCSI removable disk
2024-09-18T13:26:34.970154-03:00 localhost plasmashell[1661]: file:///usr/share/plasma/plasmoids/org.kde.plasma.devicenotifier/contents/ui/DeviceItem.qml:36:5: Unable to assign [undefined] to bool
2024-09-18T13:26:34.970248-03:00 localhost plasmashell[1661]: file:///usr/share/plasma/plasmoids/org.kde.plasma.devicenotifier/contents/ui/DeviceItem.qml:35:5: Unable to assign [undefined] to bool
I try change with hdparm the readonly status on each partition and this disk (pendrive).
localhost:/home/ # hdparm -v -r /dev/sdc
/dev/sdc:
multcount = 0 (off)
readonly = 1 (on)
readahead = 1024 (on)
geometry = 7800/64/32, sectors = 15974400, start = 0
localhost:/home/ # hdparm -v -r /dev/sdc*
/dev/sdc:
multcount = 0 (off)
readonly = 1 (on)
readahead = 1024 (on)
geometry = 7800/64/32, sectors = 15974400, start = 0
/dev/sdc1:
multcount = 0 (off)
readonly = 1 (on)
readahead = 1024 (on)
geometry = 7800/64/32, sectors = 7812, start = 276
/dev/sdc2:
multcount = 0 (off)
readonly = 1 (on)
readahead = 1024 (on)
geometry = 7800/64/32, sectors = 247912, start = 8088
/dev/sdc3:
multcount = 0 (off)
readonly = 1 (on)
readahead = 1024 (on)
geometry = 7800/64/32, sectors = 15718400, start = 256000
localhost:/home/ # hdparm -v -r0 /dev/sdc*
/dev/sdc:
setting readonly to 0 (off)
multcount = 0 (off)
readonly = 1 (on)
readahead = 1024 (on)
geometry = 7800/64/32, sectors = 15974400, start = 0
/dev/sdc1:
setting readonly to 0 (off)
multcount = 0 (off)
readonly = 1 (on)
readahead = 1024 (on)
geometry = 7800/64/32, sectors = 7812, start = 276
/dev/sdc2:
setting readonly to 0 (off)
multcount = 0 (off)
readonly = 1 (on)
readahead = 1024 (on)
geometry = 7800/64/32, sectors = 247912, start = 8088
/dev/sdc3:
setting readonly to 0 (off)
multcount = 0 (off)
readonly = 1 (on)
readahead = 1024 (on)
geometry = 7800/64/32, sectors = 15718400, start = 256000
Nothing yet. Now, I try fdisk but with the new “Write Protect is off”:
localhost:/home/ # date; fdisk /dev/sdc
wed 18 sep 2024 13:33:44 -03
Welcome to fdisk (util-linux 2.37.4).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
The device contains 'vfat' signature and it will be removed by a write command. See fdisk(8) man page and --wipe option for more details.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Read-only file system
The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or partx(8).
localhost:/home/ # sync
localhost:/home/ # partprobe
Warning: Unable to open /dev/sdc read-write (Read-only file system). /dev/sdc has been opened read-only.
Warning: Unable to open /dev/sdc read-write (Read-only file system). /dev/sdc has been opened read-only.
Warning: Unable to open /dev/sdc read-write (Read-only file system). /dev/sdc has been opened read-only.
Warning: Unable to open /dev/sdc read-write (Read-only file system). /dev/sdc has been opened read-only.
Warning: Unable to open /dev/sdc read-write (Read-only file system). /dev/sdc has been opened read-only.
Warning: Unable to open /dev/sdc read-write (Read-only file system). /dev/sdc has been opened read-only.