How to fix “sudo: unable to open … Read-only file system”?

1

The title might not be as descriptive as I would like it to be but couldn't come up with a better one.

My server's file system went into Read-only. And I don't understand why it does so and how to solve it.

I can SSH into the server and when trying to start apache2 for example I get the following :

[email protected]:~$ sudo service apache2 start [sudo] password for username: sudo: unable to open /var/lib/sudo/username/1: Read-only file system * Starting web server apache2 (30)Read-only file system: apache2: could not open error log file /var/log/apache2/error.log. Unable to open logs Action 'start' failed. The Apache error log may have more information.

When I try restarting the server I get :

[email protected]:~$ sudo shutdown -r now [sudo] password for username: sudo: unable to open /var/lib/sudo/username/1: Read-only file system

Once I restart it...

0 0
2

None of the above steps worked for me.

I did:

$ sudo fsck -Af -M

it just returned

fsck from util-linux 2.20.1

what after this?? :(

This also did not work for me:

sudo fsck.ext4 -f /dev/sda1

returned a whole list of warnings as my file system was NTFS. :(

The main thing is to make the drive from "read-only" to "read-write".

In my case the drive "New Volume" was affected.

To check the file system of the drive which is affected I ran this command:

mount -v | grep "^/" | awk '{print "\nPartition identifier: " $1 "\n Mountpoint: " $3}'

It retuned a few lines along with this

Partition identifier: /dev/sda4 Mountpoint: /media/sarthak/New

Here it returned "/media/sarthak/New", but my drive's full name is "New Volume", so I simply executed the below command

sudo mount -o remount,rw /dev/sda4 /media/sarthak/New\ Volume/

And the problem was solved, without a reboot....

0 0
3

/dev/mapper/tmuat--vg-root / ext4 ro,relatime,errors=remount-ro,data=ordered 0 0

---------------------------

I am using Ubuntu 12.04.4 LTS(Kernel version 3.11.0-15-generic), when i tried to create file in my home directory /home/user
I got the follwing error

$touch a
touch: cannot touch `a': Read-only file system

$sudo mount
sudo: unable to open /var/lib/sudo/user/1: Read-only file system
/dev/mapper/tmuat--vg-root on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs...

0 0
4

Hi both

Thanks for the information. I have tried this and the reboot takes some time, with nothing flashing across the screen... when it comes back up though, the problem persists. From your pointers, I have done some digging around and the problem seems to be definitely related to the disk, as it is coming up in gparted as not clean. When I run the clean filesystem process, I get this error:

GParted 0.11.0 --enable-libparted-dmraid

Libparted 2.3
Check and repair file system (ext4) on /dev/sda2 00:00:02 ( ERROR )

calibrate /dev/sda2 00:00:00 ( SUCCESS )

path: /dev/sda2
start: 195,347
end: 91,603,550
size: 91,408,204 (43.59 GiB)
check file system on /dev/sda2 for errors and (if possible) fix them 00:00:02 ( ERROR )

e2fsck -f -y -v /dev/sda2

/dev/sda2: recovering journal
Superblock needs_recovery flag is clear, but journal has data.
Run journal anyway? yes

/dev/sda2: ***** FILE SYSTEM WAS...

0 0
5

Using copy and paste is a routine part of most peoples Mac workflow, so if suddenly the Copy and Paste feature stops working or the clipboard appears stuck, you can imagine why that’s annoying.

Don’t stress out, most issues with nonfunctional clipboards and copy and paste on the Mac can be resolved with a series of fairly simple troubleshooting steps.


These tricks work the same on all versions of macOS and Mac OS X, they work by targeting the clipboard daemon and forcing it to relaunch. This resolves nearly all instances of a stuck clipboard or other issues where copy and paste stop working. We’ll show you two different approaches to this, one using Activity Monitor and another using the command line.

How to Fix Copy & Paste Not Working, Stuck Clipboard on Mac OS

One way to force the Clipboard to relaunch itself in Mac OS via Activity Monitor:

Quit out of the Mac app(s) where copy/paste are not working as expected Open “Activity...
0 0
6

I have a thecus home server, I'd like to edit the index.php file located under /img/www/htdocs/index.php however it tells me every time I vi that it's 'Read-only'.

I checked it's file permissions using ls -l index.php:

-rw-r--r-- 1 root root 7619 Mar 29 2013 /img/www/htdocs/index.php

From my understanding, the -rw first in the permissions, stands for the ownership permissions, and the owner is root in the group of root.

I have ssh'd into my server using:

ssh root@server.com

Once I login, it say's

root@127.0.0.1:~#

I have tried changing it's ownership, chmodding it, using vi to change permissions, trying to force it doesn't work either, how can I edit this damned file ! :(

When I try to use sudo it say's the command is not found, so I'm assuming that's because Thecus have stripped down the commands.

The output of mount without any arguments, I have noticed that the directory that I'm currently working in, is...

0 0
7

One of the most common problem in Redhat Linux is “read only root filesystem” when there is issue with hardware or SAN sub-systems .To fix the “read only filesystem” issue ,you need to reboot the server.But while rebooting the server, you will definitely encounter many issues and that requires a manual intervention by logging in with the root. Unfortunately you may not logging as root if root filesystem is corrupted and it will not accept the root password. In this case, you need to boot the system in rescue mode using Redhat Linux DVD.

Here is the steps which you need to try before rebooting the system in rescue mode using Redhat Linux DVD.

1.Reboot the system and see whether system is automatically booting in normal mode with root filesystem in read/write.While booting automatically, it will check the root filesystem filesystem integrity using fsck.

2.Some times system will go in to maintenance mode after after rebooting.In this case, system will...

0 0
8

How to fix read only USB pen drive in Ubuntu

While copying some large file I mistakenly taken out USB pen drive before the copy get completed.Later I again attached the USB pen drive in Ubuntu system but found that the USB pen drive showing read only filesystem message. I was not able to copy,create and delete any file.To solve this issue I followed some steps which I am sharing with this post.

To fix USB pen drive read only in Ubuntu,follow the given below steps

Step 1: Attach USB pen drive in system’s USB port. Automatically the Ubuntu will mount the USB pen drive and show icon on Desktop or Menu bar.

Open the terminal and become super user by running below given command

sudo su -

Step 2: First we have to find out in which directory the USB pen drive has been automatically mounted.For this run the df -Th command.
In given below output you can see,in my system the USB pen drive is mounted in /media/linux/C38C-099C ,partition is...

0 0
9

Read Only USB Drive

I have a 8 GB usb drive. Yesterday suddenly its started mounting read only in Fedora 20. This issue has occurred earlier also but I formatted drive and it worked fine. This time I had important data and wanted to resolve this issue read only usb drive without formatting disk. So I did some research to resolve the issue.

In this post I’ll try to explain – How to make read only usb drive writable without formatting drive and the reason behind of this silly occurrence ?

Notes

The commands/steps written here were tested on Fedora 20. It should work on Fedora (17-20)/Redhat 7/Centos 7. I’ll explain where needed, so that commands work on other distros/versions also. Please always take backup of your important data before doing any R&D with your storage devices. If you are in hurry and don’t want to read whole post, as you may found it little geeky :p. Click here for a Quick Fix.

Troubleshooting

1- Open terminal and login with...

0 0
10

What is Fsck ?

fsck stand for file system consistency check. Fsck is a tool used on linux servers to check and repair file system errors. Filesystem might gets corrupted due to power failure, hardware failure, unclean shutdown etc. You might see errors like “touch: cannot touch file: Read-only file system” if there is file system errors on your linux server.
Linux server administrators can manually run fsck command to check consistency errors and fix them. You must have server root access to run fsck on a linux server. Fsck command is same as ‘chkdsk’ command in windows servers.

How to run FSCK? (file system consistency check)

IMPORTANT : You must never run file system on a mounted file system because it not safe and might lead to data corruption. You must run fsck only in rescue mode or in single user mode.

You must unmount the drive before running fsck. You might see the below error if the drive is not umounted.

/dev/sda is...

0 0
11
Apr 24, 2010

I am trying to delete some files with the command "sudo rm -rf". I get the return message "read-only file system." I am log in as adim and I don't have the option of changing it to a write file in the "get info" tab. How is it possible to delete these files?

Hardware :: Read Only File System On External HD MacBook :: How To Read NT File System (NTFS) OS X :: Making File System Read/write On Leopard? Final Cut Pro X :: Document Could Not Be Opened - Read Only File System ITunes :: The File Library.itl Cannot Be Read After Operating System Reinstall? OS X Mavericks :: Hard Disk Partition / File System Cannot Be Read Intel Mac :: Change File/folder Permissions From Read Only To Read/write? Final Cut Studio :: Copying MTS File From SD Card To Hard Disk - File Info Cannot Be Read? OS X :: File Permission Of "-rwxr-xr-x" Making Application Impossible To Read The File? OS X :: Why Mac Is Not Able To Read Iso File From CD Audio OS X :: Cannot Run Sudo Command...
0 0
12
...
0 0
13
(Last Updated On: October 22, 2015)

This problem is very common among windows users dual booting it with Ubuntu. At times when you boot to your Ubuntu, Debian or any of its derivatives, you may get a “message that it cannot mount your windows partition, and you have to choose to either wait, skip or manually mount the partition.

I have a working solution for this error. It’s easy to use and works like charm. Here is a short tutorial on how to.
For this fix we’ll use ntfsfix. Ntfsfix is a utility that fixes some common NTFS problems. ntfsfix is NOT a Linux version of chkdsk. It only repairs some fundamental NTFS inconsistencies, resets the NTFS journal file and schedules an NTFS consistency check for the first boot into Windows.
1) First identify the mount point for the partition that fails to mount by using gparted or just lsblk.

# sudo lsblk

If you want to use gparted and not currently installed on your system, you can install it by:

# sudo apt-get...
0 0
14

Partedutil Read Only File System During Write My Essay Partedutil Read Only File System During Write My Essay. partedUtil: Error: Read-only file system Why can't partedUtil rewrite my Read-only file system during filesystems - VMWare Error: Read-only file system during msdos Error: Read-only file system during write on /dev/disks/naa write) is of no use. # partedUtil getptbl /dev/disks read-only-system…file partedUtil : Error: Read-only file system durin |VMware Error: Read-only file system during write on /dev/disks/naa.600605b00581fb6018c09f852081693a. partedUtil : Error: Read-only file system during write. Unable to Delete Partition on ESXi 5 |VMware Communities Read-only file system during write on /dev/disks/naa.6d4ae520a5eb1b001799927b11e12671. Unable to delete partition 1 These are the specs from partedUtil Identify and solve ineligible disk problems in Virtual SAN Identify and solve ineligible disk problems in Virtual SAN. Use partedUtil get "/dev/disks/" to list all...

0 0
15

This simple and brief tutorial is going to show you how to change the Hostname / Computer name in Ubuntu 14.04 Trusty Tahr.

The default name was set when you were installing Ubuntu. You can easily change it to whatever you want in both Desktop & Server by editing the hosts and hostname files. Below is how:

1. Press Ctrl+Alt+T on keyboard to open the terminal. When it opens, run the below command:

hostname NEW_NAME_HERE

This will change the hostname until next reboot. The change won’t be visible immediately in your current terminal. Start a new terminal to see the new hostname.

2. To change the name permanently, run command to edit the host files:

sudo gedit /etc/hostname /etc/hosts

For Ubuntu server without a GUI, run sudo vi /etc/hostname and sudo vi /etc/hosts and edit them one by one.

In both files, change the name to what you want and save them.

change Computer name ubuntu

Finally, restart your computer to apply the...

0 0