Score:0

How to reset file permissions to default in ubuntu 20.04 system

cn flag

While working in eclipse I realised that my pom.xml file had read-only permissions. In order to change that I ran

sudo chmod +rwx '/home/babi-b/eclipse-workspace/TodoApp' 

To change permissions in the entire directory (TodoApp) where the file is found. However, permissions of the entire system has been changed to read-only.

chmod: changing permissions of '/home/babi-b/eclipse-workspace/TodoApp': Read-only file system

I tried restarting the system. While booting it got stuck here

Screen image

Please, how do I reset the system to default?

I am working on ubuntu 20.04 This is what my screen now looks like

Screen image

Is there a way to recover from this without losing data?

guiverc avatar
cn flag
If a file-system flips to RO (from RW), it's usually because corruption has been detected, the flipped to RO prevents data loss until the operator/owner of the system can explore the issue & correct it. It's a symptom that should not be ignored (which you appear to be doing), and exploring logs to see what is wrong & correct. Checking disk health, mistakes made (*wrong commands executed that did damage*), faulty power etc...
Babi B avatar
cn flag
Hello @guiverc, could you help me with any resource to guide me. I'm not very versed with the Linux OS
guiverc avatar
cn flag
`sudo dmesg` gives you messages from boot time (shows in system or secs from boot); `journalctl` will show systemd journal logs (actual dates are used here so if you know when it flipped it's easier to jump to a time) ; both can be searched using keyboard commands as per any unix (now posix, but well before linux was created). You should be trying to boot the system until cause has been detected & corrected. Use *live* media (Start Lubuntu, Try Ubuntu etc) https://help.ubuntu.com/community/Smartmontools https://manual.lubuntu.me/lts/3/3.1/3.1.7/kde_partitionmanager.html
Nmath avatar
ng flag
If your system is dropping to a buybox initramfs prompt you should run `fsck` on your file system at the prompt. For example if your root file system is on `sda2` you would run `fsck /dev/sda2` - if this keeps happening and your file system keeps reverting to read only, this is often a sign of a failing hard drive. You may still be able to access the contents of your hard drives in a live session (Try Ubuntu when booting installation media)
guiverc avatar
cn flag
I would boot a *live* system & backup any data from there that has changed since your last normal backup. If you need network shares with credentials on your installed system, you should still be able to login via text terminal & perform your backups (via command).
Babi B avatar
cn flag
@guiverc thanks. Did that
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.