Fix: sudo: unable to open Read-only file system


Error:
$ sudo vim /etc/20230712_app_server.log

[sudo] password for user: 

sudo: unable to open '/etc/20230712_app_server.log' Read-only file system

You need to first check if the mount status is not read-only.

# mount | grep /etc

/dev/sda1 on /etc type ext4 (ro,relatime)

As you can see the mount is read-only!

Solution: In this case you can remount the filesystem.

# sudo mount -o remount,rw /dev/sda1 /etc
Fix - sudo- unable to open Read-only file system
-

Facing issues? Have Questions? Post them here! I am happy to answer!


Author Info:

Rakesh (He/Him) is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap