Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sdb 1.8T 747G 1.0T 43% /media/disk
# id
uid=0(root) gid=0(root) groups=0(root)
# ll /media/disk
ls: cannot access /media/disk/nvidia-installer.log: No such file or directory
ls: cannot access /media/disk/opensuseurl.txt: No such file or directory
ls: cannot access /media/disk/packman.txt: No such file or directory
ls: cannot access /media/disk/q1.txt: No such file or directory
ls: cannot access /media/disk/q1.txt~: No such file or directory
ls: cannot access /media/disk/read-only,txt: No such file or directory
ls: cannot access /media/disk/remove.txt: No such file or directory
ls: cannot access /media/disk/repos.txt: No such file or directory
ls: cannot access /media/disk/rpmlist.log: No such file or directory
ls: cannot access /media/disk/to-remove: No such file or directory
ls: cannot access /media/disk/x: No such file or directory
ls: cannot access /media/disk/zgl: No such file or directory
ls: cannot access /media/disk/lost_name_2a:73746200000000:3f1ed: No such file or directory
ls: cannot access /media/disk/pub_linux_utils_fs_reiser4_libaal.html: No such file or directory
total 180
drwx------ 4 root root 4 Sep 5 15:42 .Trash-0
lrwxrwxrwx 1 root root 55 Jul 5 2009 NVIDIA-Linux-x86_64-185.18.14-pkg2.run -> nvidia/laptop-7x/NVIDIA-Linux-x86_64-185.18.14-pkg2.run
The filesystem on that disk is damaged, and the kernel will refuse to make it writable until it has been repaired by fsck. Judging from what you have shown, fsck might result in losing a lot of data. If that data is important, you should use ddrescue to copy as much of the image as can be recovered to a new 2TB (or larger) disk drive before you play with it.
Fix the filesystem. Although read-only so you can fix it while "using" it, semi-safely. Otherwise push the I'm feeling lucky button. Systemd will default to read-only for / if / isn't listed in /etc/fstab.
$ sudo mount -o remount,rw /
Where / is the mount point that is (ro,...) in the output of mount without parameters, that you want to change.
As soon as the kernel detects an error in the filesystem it will be remounted read-only again. There is an "error behavior" field in the filesystem super block. It is typically set to "remount-ro". You can use tune2fs to change it. The other options are "continue" and "panic". Changing it to "continue" is not recommended. Writing to a corrupted filesystem is like using a rotary lawnmower in a meadow where there are cow droppings. Cr*p gets spread around and makes the problem much worse.
File permissions have absolutely nothing to do with a "Read-only filesystem" error. And anyway, attempting to change permissions on such a filesystem would just fail with a "Read-only filesystem" error.
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 13,596
Rep:
@BW-userx, you seem to have formed a pattern of posting snide, sarcastic and off-topic remarks in a variety of threads. This isn't acceptable at LQ. Please refrain from this behavior moving forward. If you have any questions, feel free to contact a mod or myself privately. Thanks.
File permissions have absolutely nothing to do with a "Read-only filesystem" error. And anyway, attempting to change permissions on such a filesystem would just fail with a "Read-only filesystem" error.
I would suggest censoring/removing that chmod command from this thread as it is very dangerous and destructive and wrong. A beginner might happen upon it and run it. I'm reporting it as such to the mods.
Last edited by szboardstretcher; 02-23-2017 at 12:15 PM.
still a terrible idea to actually run of course but at least you can actually do things in directories and don't lose all of your executes on all of your commands. Of course this doesn't fix a certain issue I once had to deal with where somebody did (ANOTHER ONE TO NEVER RUN)
c.h.a.t.t.r. +i /
Needless to say I think this has gone off topic enough now.
Last edited by r3sistance; 02-23-2017 at 01:16 PM.
Reason: making things more clear
It seems that many have seen my answer and not my recommendations to same said answer, beginner or not one has to learn this eventually. that being so then when? the person then will always be in the dark about that command, then perhaps one day find out the hard way, by actually doing that to his or her system.
I explicitly said "But I'd not recommend that."
which then raises a question.
why not?
which promotes what?
thinking.
which does what, especially if one asks more questions or seek the answers to these questions?
gains knowledge.
If one keeps treating a child as a child he will always act like a child.
If one treats a child like an adult (within that child limits) he will become an adult.
and even adults act like children sometimes, that is called regression.
How some people love to take things out of content so they can fire up their torches and scream burn him burn him...
Another situation where you can encounter a read-only filesystem is when you boot a "rescue" DVD or USB-stick, and when you boot into single-user mode. The file system, although undamaged, might be initially be purposely mounted Read/Only so that it requires a conscious act ("remounting it") to subject its content to change. (Think: "the safety on a gun.")
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,363
Rep:
Quote:
Originally Posted by rknichols
The filesystem on that disk is damaged, and the kernel will refuse to make it writable until it has been repaired by fsck. Judging from what you have shown, fsck might result in losing a lot of data. If that data is important, you should use ddrescue to copy as much of the image as can be recovered to a new 2TB (or larger) disk drive before you play with it.
Glenn - if, in fact, there is damage to the file system on the medium in question, the above-quoted recommendation is the best one so far, in my opinion, for the reason mentioned by rknichols. I wouldn't recommend any other file-system repair commands until you have made an image of the disk with ddrescue.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.