Ubuntu – Ubuntu says that filesystem is read only when trying to use sudo or su

hard drive

I am currently using Ubuntu 11.10. My HDD has been frequently used for more than 5 years now. When I try to use the sudo command, or execute a command as root, I receive a message stating that the filesystem is read-only. For example, when I try to run sudo apt-get install gnome-tweak-tool, I receive the following output:

sudo: Can't ipen /var/lib/sudo/aaron/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

I have heard that Ubuntu will make the filesystem read only because of disk errors. After checking my hard drive with Disk Utility, I discovered that it has 7 bad sectors. Disk Utility also warned about imminent disk failure. Is this kind of thing normal, and can/should I make the filesystem writeable again? Or should I simply replace my hard drive?

Best Answer

Given the age of the disk, and that it has started getting bad sectors, it really sounds like your disk is failing. My best advice is to stop using it, get hold of a new disk, and either try to copy everything to the new disk, or do a fresh install on the new disk, and copy the files of importance from the old (The latter is the easiest, but the former is possible too).

Related Question