Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suddenly all of my contents residing on external hard disk has changed to read-only mode. Even though I am using Linux, I don't know how a virus have done this. I tried using "chmod", but still I am not able to change permission. So Now I can only read and copy files in/out it. But I cant delete anything.Please suggest me some way.

share|improve this question

migrated from Jan 10 '12 at 22:27

This question came from our site for professional and enthusiast programmers.

What filesystem are you using on external hard disk? Also, attaching the output of mount command when hard disk is in use can help. – AnonymousLurker Sep 28 '12 at 10:27

Hard to know your situation with so few details. Are you root? If not, do you have root access? When you tried CHMOD, did you get an error?

Try CHMOD -R 755 /path/to/external/drive

if that doesn't work, try sudo CHMOD -R 755 /path/to/external/drive

share|improve this answer

Try usind super user to change permissions

sudo chmod -R 755 /media/ExternalDrive

This will recursively (therefor the "-R") set 755 permissions fo the specified path. If you want full permisisons set to 777

share|improve this answer

You need to run chmod from an account that does have permission to make these changes; your account might have permission using the sudo command, but if you don't know if it does, it probably doesn't.

share|improve this answer

It would helpful to know exactly what, if any, error message you see when you try to chmod.

Since this is an external mount, it is possible that it has been mounted read-only. In that case, chmod would return something like "Operation not permitted". Fixing that requires examining your mount tables. If this is a removable drive, it could be something a simple as the write-protect tab being set.

In any case, I advise against doing a chmod -R on the entire drive until you know what is going on, as doing so could mess up permissions on existing files.

share|improve this answer

Try the following command

sudo chown $USER /media/ExternalDriveName

This will enable you to read and write to the disk. This worked for me after Ubuntu 12.04 mysteriously changed the onwership of my hard drive from myself to "root". Which meant that I had a similar problem as you.

share|improve this answer

You must log in to answer this question.