Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
1  
It really sounds like your disk is failing. 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) –  geirha Mar 1 '12 at 21:07
2  
@geirha - would you please add that as an answer rather then a comment. –  bodhi.zazen Mar 1 '12 at 22:12
add comment

2 Answers

up vote 3 down vote accepted

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).

share|improve this answer
add comment

I had a problem where I could not write to my Toshiba 500GB external hard drive. I kept getting an error stating: "Cannot create directory: Read-only file system"

Note: I am using Ubuntu 11.10. The software Disk Utility is pre-installed with 11.10.

My hard drive seems to be back working now after I did the following:

Firstly, using Disk Utility I unmounted the drive "Unmount Volume", then I selected "Check File System". It did it's thing and in my case found no errors. Then I mounted the drive using Disk Utility and hey presto, it seems to be working as it did before.

If there's errors on your drive I'd back up everything on it and let Disk Utility try to repair them. If Disk Utility can't repair the drive then a new drive may be required.

Hope this helps. This issue annoyed me Greatly!!

share|improve this answer
    
Worked for me also but I booted from a USB and it was already unmounted so I just had to click on "Check File System" –  Muhammad Ahmad Zafar Jun 21 '13 at 12:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.