Title: Why does gedit (Text Editor) switch to read only, and how can I undo it without reloading?
Tags: 18.04;gedit;read-only
Question: So, I have been using the gedit text editor for years, often with multiple files open at a time in tabs.

Today, I find that my two gedit sessions and all the files open in them are suddenly all in "[read only]" mode and won't let me edit the files I was editing earlier with that same loading of the program (but a couple of days ago, and the computer has been put to sleep and awakened a few times since).

I'm still logged in as my usual account, the files are owned by that account and the owner (me) has permissions to edit them.

Opening new files in a new gedit window also results in them being loaded read-only.

I have looked through the various menus I could find and see nothing that seems relevant.

None of what I have done is new to my experience, and I have used gedit for years in this sort of way without ever having seen this happen to me. What's it caused by and how could I get the files back to editable short of closing and reloading them?

Comment: Is your disk mounted read-only? See https://github.com/waltinator/pathlld.git - Bash script to answer "Why can't I read/write that file?"

Comment: What happened before this issue

Comment: @GeorgeUdosen Before this I have been using the computer about as usual. Firefox, gedit, compiling and running my OpenFrameworks C++ projects, running system updates, viewing PDFs. My file manager is PCManFM. The unusual things would be whatever the updates were (since an update is always something new, though I didn't pay attention this time), backing up my source code to an external drive by dragging files in PCManFM (I do remember pressing the Eject Media icon for it in PCManFM before closing the lid to sleep).

Comment: @waltinator I noticed after posting this last night that yes, it wasn't just gedit - the whole file system was in read only. My first symptom may actually have been GIMP, which I loaded and noticed it freaking out about not being able to make a temp file, but GIMP has done that before without being unable to save files, so I just thought it was GIMP.

Here is the accepted answer: After posting this last night, I noticed that gedit (Text Editor) was NOT to blame. The whole file system had been set to read-only somehow, so gedit was just behaving correctly.

Why the filesystem was read-only suddenly, I don't know. Could be my hard drive is dying, so I'll try to test for that.

Update: After running some analysis of the disk, there were some logical errors but no physical errors. Correcting the logical errors and restarting cleared up the problem, though I still don't know what the cause was. It clearly was not gedit, though.

Comment for this answer: Please remember to click the grey check mark next to your answer later on. This will let other users know it is the correct solution.
Comment for this answer: Well done for letting us know!


{'source': 'StackExchangeDataset', 'subset': 'askubuntu.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 4, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2018:00:06/24/18', 'FavoriteCount': 0.0, 'PostTypeId': 1, 'Tags': '<18.04><gedit><read-only>', 'Title': 'Why does gedit (Text Editor) switch to read only, and how can I undo it without reloading?', 'ViewCount': 1238, 'id': 1049209, 'user_AboutMe': '<p>Apparently, this user prefers to keep an air of mystery about them.</p>\n', 'user_AccountId': 216464.0, 'user_DisplayName': 'Dronz', 'user_Reputation': 311.0, 'user_Views': 77.0, 'user_id': 86850.0}}