Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

I have a pendrive which is full of viruses. These viruses are .js files. Using linux, I can open the pendrive and see which folders they are in. But when I try to remove them by pressing Del button or via sudo rm filename.extension it gives me an error:

cannot remove 'file.lnk' : Read-only file system

All of the files on the pendrive are like this. I can't even format it with gparted Install gparted but it also gives me an error message.

I have like 3 or 4 folders containing these .js files. I can even open it with gedit Install gedit but can't edit its contents. These folders' names are like:

  • C4
  • d8d8d
  • cfc4c

...and the files are like:

  • gd586d.js
  • id9d9.js

How can I work around this? I would like to remove these files from the pendrive by terminal or any another method.

share|improve this question
What is the error message you're getting from GParted? – hmayag Jun 18 '14 at 23:48
@hmayag Sorry, actually I get the error when I try to format via Disks. The Gparted format option is Unable. – PlayHardGoPro Jun 19 '14 at 0:14
You should press Unmount button before format – Ruslan Gerasimov Jun 19 '14 at 0:22
@RuslanGerasimov on Disks ? I did it... – PlayHardGoPro Jun 19 '14 at 0:26
what happens if you run Benchmark Drive... in Disks ? – Ruslan Gerasimov Jun 19 '14 at 0:36
up vote 0 down vote accepted

It seems your pendrive device is dead. I am pretty sure, because all times I saw I/O error it meant hardware was damaged.

share|improve this answer
I also think so... I have 2 pendrives with the same problem (vírus). The first one I could remove easily with linux live cd, but this second one... No way! And I'm used to see this model of pendrive with problems and stop working... Look, I could get all the importante files from the pendrive and moved to my HD. Even if I Could do so it still may be damaged? – PlayHardGoPro Jun 19 '14 at 4:09
You didn't move all files, but if so, there might be physical sectors damages regardless whether they are occupied or not. The IO error is very serious problem, related to a hardware. – Ruslan Gerasimov Jun 19 '14 at 4:59

Your Answer


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.