Unable to REinstall `openSUSE-13.2-Rescue on previously used USB stick

I had previously successfully installed openSUSE-13.2-Rescue-CD-x86_64.iso on a USB stick. It worked just fine - for a while. Somehow, something must have corrupted the data because I can no longer boot from it. So I’m trying to reinstall it using commandline tools following the directions at https://en.opensuse.org/Live_USB_stick#Using_commandline_tools.

It won’t install, I get an error message saying

dd: **failed to open** ‘/dev/sdb’: **Read-only file system**

So I followed all the instructions under “How to recover the USB stick for “normal” use again”, but no joy.

QUESTION: How can I make this USB stick writable so I can reinstall a bootable rescue disc on it again?

More info:

russ:/home/russ/SOFTWARE/ISO-Files # **grep -Ff <(hwinfo --disk --short) <(hwinfo --usb --short)**
disk:
  /dev/sdb             SanDisk Cruzer Facet
russ:/home/russ/SOFTWARE/ISO-Files # **umount /dev/sdb**
umount: /dev/sdb: not mounted
russ:/home/russ/SOFTWARE/ISO-Files # **dd if=/dev/zero of=/dev/sdb count=100**
dd: **failed to open** ‘/dev/sdb’: **Read-only file system**
russ:/home/russ/SOFTWARE/ISO-Files # **parted /dev/sdb **                     
Warning: **Unable to open** /dev/sdb read-write (**Read-only file system**).  /dev/sdb has been opened read-only.
Warning: **Unable to open** /dev/sdb read-write (**Read-only file system**).  /dev/sdb has been opened read-only.
GNU Parted 3.1                                                            
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) quit
russ:/home/russ/SOFTWARE/ISO-Files #** fdisk /dev/sdb**

Welcome to fdisk (util-linux 2.25.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

fdisk: **cannot open** /dev/sdb: **Read-only file system**

Addendum: There is no physical switch to write-protect this USB drive, so that’s not the problem.

When something complains about permissions, the first thing I dois checking the permissions:

ls -l /dev/sdb

And please do NOT change anything in what you copy/paste between the CODE tags. That will make it untrustworthy for many. We want to see exactly what you see, no adaption of it.

russ:/home/russ/SOFTWARE/ISO-Files # ls -l /dev/sdb
brw-rw---- 1 root disk 8, 16 Jul  4 18:10 /dev/sdb
russ:/run/media/russ # pwd
/run/media/russ
russ:/run/media/russ # ls -la
total 18
drwxr-x---+ 4 root root   80 Jul  4 18:10 .
drwxr-xr-x  3 root root   60 Jul  3 18:39 ..
drwxr-xr-x  1 root root  162 May 13 02:11 hybrid
dr-x------  4 russ users 512 Oct 27  2014 openSUSE 13.2 Live

Right. The permissions on /dev/sdb are as they should be.

Strange enough the error is a bout a file system, while you do not treat /dev/sdb as a file system, but as a file.

You do not show a

mount | grep "/dev/sdb"

but I assume that

dr-x------  4 russ users 512 Oct 27  2014 openSUSE 13.2 Live

is the device /dev/sdb (or maybe /dev/sdb1?) mounted as file system. The directory is not writable for anybody (including root) as you can see. But your dd command is not trying that. :\

I am (like you) wondering.

Let us try something simple like (as root of course):

echo "trial" > /dev/sdb

Also it maybe better to have the device unmounted. Apparently it is mounted by some action through the desktop.

russ:/run/media/russ # mount | grep "/dev/sdb"
/dev/sdb2 on /run/media/russ/openSUSE 13.2 Live type udf (ro,nosuid,nodev,relatime,uid=1000,gid=100,umask=77,iocharset=utf8,uhelper=udisks2)
/dev/sdb3 on /run/media/russ/hybrid type btrfs (ro,nosuid,nodev,relatime,space_cache,uhelper=udisks2)

I am (like you) wondering.

Let us try something simple like (as root of course):

echo "trial" > /dev/sdb

Yes, I’m logged is as root to deal with this problem. I don’t usually do that for reasons probably needless to mention.

russ:/run/media/russ # echo "trial" > /dev/sdb
bash: /dev/sdb: Read-only file system

Also it maybe better to have the device unmounted. Apparently it is mounted by some action through the desktop.

Ok, lets umount again just to be sure…

russ:/run/media/russ # !329
umount /dev/sdb
umount: /dev/sdb: not mounted
russ:/run/media/russ # echo "trial" > /dev/sdb
bash: /dev/sdb: Read-only file system

This is absolutely maddening. It gives all the symptoms of a hardware write-protect switch, but there is none.

Then again, permissions for /dev/sdb did change when messed with it - but I still can’t write to it.

On 2015-07-04 12:56, hcvv wrote:
> Also it maybe better to have the device unmounted. Apparently it is
> mounted by some action through the desktop.

It should not matter, dd would not care, if you are root. You can
happily destroy your running system that way if you so wish :slight_smile:


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

On 2015-07-04 12:36, rwbehne1 wrote:
>
> Code:
> --------------------
> russ:/home/russ/SOFTWARE/ISO-Files # ls -l /dev/sdb
> brw-rw---- 1 root disk 8, 16 Jul 4 18:10 /dev/sdb
> --------------------
>
>
>
> Code:
> --------------------
> russ:/run/media/russ # pwd
> /run/media/russ
> russ:/run/media/russ # ls -la
> total 18
> drwxr-x—+ 4 root root 80 Jul 4 18:10 .
> drwxr-xr-x 3 root root 60 Jul 3 18:39 …
> drwxr-xr-x 1 root root 162 May 13 02:11 hybrid
> dr-x------ 4 russ users 512 Oct 27 2014 openSUSE 13.2 Live
> --------------------

Wait. You are running the rescue system stick that you want to erase,
when you run the above commands?

Using another Linux system, and with your usb stick on the table, run in
a terminal “demsg -Tw”, press enter two times after the text ends
flowing, plug in your stick, and finally paste here the new text that
appears on the terminal.

Then try to erase the stick with dd, and if new text appears in the
dmesg terminal appears, paste that into another code tags block.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

No, I’m booted onto my regular Linux box.

Using another Linux system, and with your usb stick on the table, run in
a terminal “demsg -Tw”, press enter two times after the text ends
flowing,

russ:/run/media/russ # demsg -Tw
demsg: command not found
russ:/run/media/russ # 
russ:/run/media/russ # 
russ:/run/media/russ #

I think you meant dmesg -Tw so I redid it using that.

plug in your stick, and finally paste here the new text that
appears on the terminal.


Sat Jul  4 19:43:15 2015] SFW2-INext-DROP-DEFLT IN=p2p1 OUT= MAC=b0:83:fe:70:ac:28:90:61:0c:1f:94:5f:08:00 SRC=192.168.1.1 DST=192.168.1.200 LEN=250 TOS=0x00 PREC=0x00 TTL=4 ID=15470 DF PROTO=UDP SPT=1900 DPT=63191 LEN=230 
[Sat Jul  4 19:43:15 2015] SFW2-INext-DROP-DEFLT IN=p2p1 OUT= MAC=b0:83:fe:70:ac:28:90:61:0c:1f:94:5f:08:00 SRC=192.168.1.1 DST=192.168.1.200 LEN=248 TOS=0x00 PREC=0x00 TTL=4 ID=15472 DF PROTO=UDP SPT=1900 DPT=63191 LEN=228 
[Sat Jul  4 19:43:15 2015] SFW2-INext-DROP-DEFLT IN=p2p1 OUT= MAC=b0:83:fe:70:ac:28:90:61:0c:1f:94:5f:08:00 SRC=192.168.1.1 DST=192.168.1.200 LEN=248 TOS=0x00 PREC=0x00 TTL=4 ID=15474 DF PROTO=UDP SPT=1900 DPT=63191 LEN=228 
[Sat Jul  4 19:43:19 2015] usb 3-9: new high-speed USB device number 15 using xhci_hcd
[Sat Jul  4 19:43:19 2015] usb 3-9: New USB device found, idVendor=0781, idProduct=5576
[Sat Jul  4 19:43:19 2015] usb 3-9: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Sat Jul  4 19:43:19 2015] usb 3-9: Product: Cruzer Facet
[Sat Jul  4 19:43:19 2015] usb 3-9: Manufacturer: SanDisk
[Sat Jul  4 19:43:19 2015] usb 3-9: SerialNumber: 4C532000040816123004
[Sat Jul  4 19:43:19 2015] usb-storage 3-9:1.0: USB Mass Storage device detected
[Sat Jul  4 19:43:19 2015] scsi12 : usb-storage 3-9:1.0
[Sat Jul  4 19:43:20 2015] scsi 12:0:0:0: Direct-Access     SanDisk  Cruzer Facet     1.26 PQ: 0 ANSI: 6
[Sat Jul  4 19:43:20 2015] sd 12:0:0:0: Attached scsi generic sg2 type 0
[Sat Jul  4 19:43:20 2015] sd 12:0:0:0: [sdb] 31266816 512-byte logical blocks: (16.0 GB/14.9 GiB)
[Sat Jul  4 19:43:20 2015] sd 12:0:0:0: [sdb] Write Protect is on
[Sat Jul  4 19:43:20 2015] sd 12:0:0:0: [sdb] Mode Sense: 43 00 80 00
[Sat Jul  4 19:43:20 2015] sd 12:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[Sat Jul  4 19:43:20 2015]  sdb: sdb1 sdb2 sdb3
[Sat Jul  4 19:43:20 2015] sd 12:0:0:0: [sdb] Attached SCSI disk
[Sat Jul  4 19:43:20 2015] BTRFS info (device sdb3): disk space caching is enabled
[Sat Jul  4 19:43:20 2015] UDF-fs: warning (device sdb2): udf_load_vrs: No anchor found
[Sat Jul  4 19:43:20 2015] UDF-fs: Rescanning with blocksize 2048
[Sat Jul  4 19:43:20 2015] UDF-fs: INFO Mounting volume 'openSUSE 13.2 Live', timestamp 2014/10/27 23:37 (11e0)
[Sat Jul  4 19:43:21 2015] SFW2-INext-DROP-DEFLT IN=p2p1 OUT= MAC=b0:83:fe:70:ac:28:00:90:a9:f3:b4:08:08:00 SRC=192.168.1.3 DST=192.168.1.200 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=63488 DF PROTO=TCP SPT=54830 DPT=63191 WINDOW=5840 RES=0x00 SYN URGP=0 OPT (020405B40402080A005905DC0000000001030304) 
[Sat Jul  4 19:43:25 2015] SFW2-INext-DROP-DEFLT IN=p2p1 OUT= MAC=b0:83:fe:70:ac:28:90:61:0c:1f:94:5f:08:00 SRC=43.249.199.4 DST=192.168.1.200 LEN=365 TOS=0x00 PREC=0x00 TTL=49 ID=36076 PROTO=ICMP TYPE=3 CODE=3 [SRC=192.168.1.200 DST=43.249.199.4 LEN=337 TOS=0x00 PREC=0x00 TTL=51 ID=36871 DF PROTO=UDP SPT=37381 DPT=41840 LEN=317 ]

Then try to erase the stick with dd, and if new text appears in the
dmesg terminal appears, paste that into another code tags block.

Ok, I think you meant to say leave dmesg running, then run DD in another root terminal, so that’s what I did. Here’s the additional text:

Sat Jul  4 19:48:15 2015] SFW2-INext-DROP-DEFLT IN=p2p1 OUT= MAC=b0:83:fe:70:ac:28:90:61:0c:1f:94:5f:08:00 SRC=192.168.1.1 DST=192.168.1.200 LEN=250 TOS=0x00 PREC=0x00 TTL=4 ID=18136 DF PROTO=UDP SPT=1900 DPT=63191 LEN=230 
[Sat Jul  4 19:48:15 2015] SFW2-INext-DROP-DEFLT IN=p2p1 OUT= MAC=b0:83:fe:70:ac:28:90:61:0c:1f:94:5f:08:00 SRC=192.168.1.1 DST=192.168.1.200 LEN=248 TOS=0x00 PREC=0x00 TTL=4 ID=18138 DF PROTO=UDP SPT=1900 DPT=63191 LEN=228 
[Sat Jul  4 19:48:15 2015] SFW2-INext-DROP-DEFLT IN=p2p1 OUT= MAC=b0:83:fe:70:ac:28:90:61:0c:1f:94:5f:08:00 SRC=192.168.1.1 DST=192.168.1.200 LEN=248 TOS=0x00 PREC=0x00 TTL=4 ID=18140 DF PROTO=UDP SPT=1900 DPT=63191 LEN=228 
[Sat Jul  4 19:48:15 2015] usb 3-10: new high-speed USB device number 16 using xhci_hcd
[Sat Jul  4 19:48:15 2015] usb 3-10: New USB device found, idVendor=0781, idProduct=5576
[Sat Jul  4 19:48:15 2015] usb 3-10: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Sat Jul  4 19:48:15 2015] usb 3-10: Product: Cruzer Facet
[Sat Jul  4 19:48:15 2015] usb 3-10: Manufacturer: SanDisk
[Sat Jul  4 19:48:15 2015] usb 3-10: SerialNumber: 4C532000040816123004
[Sat Jul  4 19:48:15 2015] usb-storage 3-10:1.0: USB Mass Storage device detected
[Sat Jul  4 19:48:15 2015] scsi13 : usb-storage 3-10:1.0
[Sat Jul  4 19:48:16 2015] scsi 13:0:0:0: Direct-Access     SanDisk  Cruzer Facet     1.26 PQ: 0 ANSI: 6
[Sat Jul  4 19:48:16 2015] sd 13:0:0:0: Attached scsi generic sg2 type 0
[Sat Jul  4 19:48:16 2015] sd 13:0:0:0: [sdb] 31266816 512-byte logical blocks: (16.0 GB/14.9 GiB)
[Sat Jul  4 19:48:16 2015] sd 13:0:0:0: [sdb] Write Protect is on
[Sat Jul  4 19:48:16 2015] sd 13:0:0:0: [sdb] Mode Sense: 43 00 80 00
[Sat Jul  4 19:48:16 2015] sd 13:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[Sat Jul  4 19:48:16 2015]  sdb: sdb1 sdb2 sdb3
[Sat Jul  4 19:48:16 2015] sd 13:0:0:0: [sdb] Attached SCSI disk
[Sat Jul  4 19:48:17 2015] UDF-fs: warning (device sdb2): udf_load_vrs: No anchor found
[Sat Jul  4 19:48:17 2015] UDF-fs: Rescanning with blocksize 2048
[Sat Jul  4 19:48:17 2015] UDF-fs: INFO Mounting volume 'openSUSE 13.2 Live', timestamp 2014/10/27 23:37 (11e0)
[Sat Jul  4 19:48:17 2015] BTRFS info (device sdb3): disk space caching is enabled
[Sat Jul  4 19:48:21 2015] SFW2-INext-DROP-DEFLT IN=p2p1 OUT= MAC=b0:83:fe:70:ac:28:00:90:a9:f3:b4:08:08:00 SRC=192.168.1.3 DST=192.168.1.200 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=16938 DF PROTO=TCP SPT=50149 DPT=63191 WINDOW=5840 RES=0x00 SYN URGP=0 OPT (020405B40402080A00597B0E0000000001030304)

Your mount | grep /dev/sdb statement showed that /dev/sdb2 and /dev/sdb3 are mounted. An udf and a btrfs file system. Both read-only. It is useless to umount /dev/sdb as that is not mounted (as the error says). It is /dev/sdb2 and /dev/sdb3. No idea about /dev/sdb1 though.

fdisk -l /dev/sdb

gives us a better idea on how it is partitioned.

But all of this does not help me to understand why a write by a user that is permited to write to /dev/sdb is refused whith a message talking about a file system.

From your dmesg:

[Sat Jul  4 19:43:20 2015] sd 12:0:0:0: [sdb] Write Protect is on

It is detected that some write protection on the device is ON. You already told that you do not see any switch. But nevertheless it is detected by the system.

How old is the stick have you used it for a lot of things (ie lots of writes?? Flash memory has a very finite erase write cycle. Perhaps you have reached end of life and the firmware can no longer swap out blocks?

On 2015-07-04 13:56, rwbehne1 wrote:

> I think you meant dmesg -Tw so I redid it using that.

Yep, sorry.

> Code:
> --------------------

> [Sat Jul 4 19:43:19 2015] usb 3-9: Product: Cruzer Facet

> [Sat Jul 4 19:43:20 2015] sd 12:0:0:0: [sdb] Write Protect is on

> --------------------

There you have it! :slight_smile:

If it is not a hardware switch, it has to be software.

> Ok, I think you meant to say leave dmesg running, then run DD in another
> root terminal, so that’s what I did. Here’s the additional text:

Yes, but no need. The culprit is already shown above.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

It is detected that some write protection on the device is ON. You already told that you do not see any switch. But nevertheless it is detected by the system.

And still no hardware switch exists. I can’t manually switch a non-existent switch. I have no idea why it’s detecting something that doesn’t exist, but I do know that it’s wrong.

Age: about 6 months.
Writes: once using dd to install the OS.
Booted from it about 6 or so times.

Hardly ever used, eh? I have others here, smaller ones that I use for files. I’ve had them many years and can’t imagine how many times I’ve written to them. So I doubt it’s anywhere near the end of its rewrite life.

I have the vague idea that something like this was already discussed in a thread here, not more then a few monthes ago. Maybe some searching might reveal the thread.

It seems that some manufactures see obliged to put “artificial stupidness” on their devices.

Ok, I’ve reached a conclusion now.

Fact 1: I can no longer boot from this USB stick, indicating data corruption or damage of some kind.
Fact 2: I can’t write anything to this USB stick, indicating that it may be damaged and useless.
Fact 3: I just tried to re-write to another USB stick using dd, and had no problem overwriting an existing OS.
Conclusion: The uncooperative USB stick is HOSED.
Solution: Trash it. Nothing else to do.

Thanks to everyone who tried to help, your assistance helped me resolve this problem quickly enough.

I am afraid I have to argee with you.

You are welcome.

It may have been. I think the search function in this forum isn’t very user friendly. I always try to search for previous discussions on a topic before posting, but rarely find anything useful or apropos.

It seems that some manufactures see obliged to put “artificial stupidness” on their devices.

I agree!


One last question: Is there a way for me to mark this thread as closed?

According to Google this problem seems to be quite common with SanDisk devices.

One comment I found states that they apparently have some “virus protection” that makes the stick write protected automatically if it thinks it is getting infected with a virus.

Maybe this would help?
http://musbfixer.in/
A Windows-only tool, but still.
Never used it myself though, as I had no need to yet.