When I try to save something or rename a file/folder it say this error " Read-only file system" or run something as root in the terminal it say this error
sudo: unable to open /var/lib/sudo/"My User Name"/0: Read-only file system
W: Not using locking for read only lock file /var/lib/dpkg/lock
E: Unable to write to /var/cache/apt/
E: The package lists or status file could not be parsed or opened.
When I make a Folder the error dialog in the details with Nautilus is this:
Error creating directory: Read-only file system
I would show you I picture of it but it isn't even letting my save onto my flash drive. Please help me.
This worked for me:
First, run this command with
sudo
permission:Then reboot the machine
When the system enters a read-only state, it does so to prevent damage to the system. Make sure your HDD is working properly and/or backup your data before doing anything.
I suggest to boot a live USB/DVD, open GParted, and use the check/repair feature.
This is the command to enable writing:
If you are dual booting Windows with Ubuntu and you do not have any error in
dmesg
, then the problem could very well be caused by Windows.In Windows go to Control Panel → Power Options and disable Fast Startup. Now boot into Ubuntu.
When accessing an HDD from different OS (Windows & Linux) the disk could contain an unclean file system. So the metadata cached in the OS, deny mounting the disk
To try to correct the mistakes, identify the path of your partition disk in the Disk app (i.e:
/dev/sdb1
) and usentfsfix
.If the disk is not mounted automatically, so:
If you get the error
Read-only file system
then you should delete the following directories from Windows:In Git Bash as Admin:
Identify your disk. In my case is
/f
GL
If someone using dual OS(Ubuntu, Windows) like me, NTFS filesystem is the main reason of this problem. Inspect the path of disk like "/dev/sda3", unmount the disk and run:
In my case, I have a common drive between Windows and Ubuntu.
On Ubuntu, I had installed trash-cli and had trashed some files.
When I booted in Windows, I did some defragmentation on that drive.
But when I went back to Ubuntu, then it started giving me
Read-only file system
error on any write operation.After reading @Braian Coronel's answer, I went back to Windows and permanently deleted
.Trash-1000
folder which solved my issue.