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?
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**
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.
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.
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.
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.
[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?
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.
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.
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.