How should i do to undo this? I tried running fsck to solve my "Read only filesystem" before but it didn't help me much. It only solve the situation for a while and then it comes back again. So, i did this after reading a post.
Meanwhile, i am getting thousands of lines like this:
chown: changing group of '/usr/share/doc/distro-info-data': Read-only file system
chown: changing group of '/usr/share/doc/software-properties-common/copyright': Read-only file system
chown: changing group of '/usr/share/doc/software-properties-common/changelog.gz': Read-only file system
chown: changing group of '/usr/share/doc/software-properties-common': Read-only file system
chown: changing group of '/usr/share/doc/nmap/3rd-party-licenses.txt.gz': Read-only file system
chown: changing group of '/usr/share/doc/nmap/leet-nmap-ascii-art.txt': Read-only file system
chown: changing group of '/usr/share/doc/nmap/nmap.usage.txt.gz': Read-only file system
chown: changing group of '/usr/share/doc/nmap/device-types.txt.gz': Read-only file system
chown: changing group of '/usr/share/doc/nmap/committers.txt.gz': Read-only file system
chown: changing group of '/usr/share/doc/nmap/nmap_gpgkeys.txt.gz': Read-only file system
chown: changing group of '/usr/share/doc/nmap/style/lua-format.lua.gz': Read-only file system
chown: changing group of '/usr/share/doc/nmap/style/README': Read-only file system
In case it's your main filesystem ran as part of the kernel parameter using grub you should change the command line from (example):
To:
And reboot.
If this partition is being mounted after reboot or it's not the root partition you can remount it with rw, like this:
Replace
sdX
with the appropriate partition that matches your case.The easiest way to solve this? The hard way: reinstall your system. All of it.
The root
/
should be owned by# root
, not by a user (pranav
). Your command meant changing all the files in your system to the grouppranav
. This is messy.Don't worry, I did things worse than this (e.g.
dd
on my system's drive). But it's a good way to learn things the Linux way. :-)