Announcement

Collapse
No announcement yet.

Can't delete files & folders (input/output error)

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Can't delete files & folders (input/output error)

    Hey
    this week I had three files/dir I can't delete. I looked on the internet, but only radical methods of formatting or buying a new disk (!!) are advised.
    On a NTFS usb drive, I have two folders with problems. Sth happened when I copied/deleted files to them, and now, I tried sudo rm -r / -f / -rf but that doesn't work. (Input/output error) The other folders are OK.
    On my desktop, I have a file with what was originally chinese characters, it looks now as a lof of black square with ? inside and I can't delete it neither. I didn't try the rm -rf because this is on the desktop and I am a little more afraid. If I try to delete it or rename it in dolphin, I get a 'file doesn't exist'.

    Any useful tool to get rid of those ?
    Thanks
    Single boot Kubuntu12.04 on Zepto NoxA14 Intel Dual Core 2GHz (64-bit), RAM 4Go, Nvidia GeForce 9600M GT

    #2
    Re: Can't delete files & folders (input/output error)

    I must admit that I'm not sure what you're trying to do. Are you trying to delete DIRECTORIES, or are you trying to delete ordinary files?

    Please navigate to the directory containing the object or objects that you want to delete. For each of the files that you want to delete, run the command ls -l BADFILE (where BADFILE is the name of the file you want to delete). That will give us an idea of what you're trying to do.

    BTW, forget you ever heard of the command "rm -rf", it is fatal!

    Comment


      #3
      Re: Can't delete files & folders (input/output error)

      Originally posted by askrieger
      BTW, forget you ever heard of the command "rm -rf", it is fatal!
      That can not be emphasized enough. When he says 'fatal,' that is exactly what is meant. Running that command correctly - it's good that it did not run for you (you typed it incorrectly) - as had you typed it correctly, you would have erased your entire system.
      Windows no longer obstructs my view.
      Using Kubuntu Linux since March 23, 2007.
      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

      Comment


        #4
        Re: Can't delete files & folders (input/output error)

        Hey
        many thanks for the replies !
        what is on my desktop was originally and still look like an MS office .doc file. It was originally a file which filename was in Chinese caracters, which I never have problems to display. The file was not corrupted, after this happened, I put another copy of the file (received by email) in a folder, changed the name to latin letters and could open it in OOF and work on it.
        On the graphical Desktop it looks as described above in my first post, in Konsole as below : I did a copy/paste of the file name to use it in commands. There were other files on the Desktop without problems happening to them.
        Code:
        $~/Desktop$ ls
        տ?ի???????ի??????????ɵ?????.doc
        $~/Desktop$ ls -l
        total 28
        -rw-r--r-- 1 [myname] [myname] 28672 2009-11-25 07:16 տ?ի???????ի??????????ɵ?????.doc
        $~/Desktop$ sudo rm տ?ի???????ի??????????ɵ?????.doc
        rm: cannot remove `տ?ի???????ի??????????ɵ?????.doc': No such file or directory
        $~/Desktop$ ls -l տ?ի???????ի??????????ɵ?????.doc
        ls: cannot access տ?ի???????ի??????????ɵ?????.doc: No such file or directory
        My second problem is two directories ('Music' and 'Music2') on an NTFS external usb disk. sth went wrong while copying files and I can't remove them now
        Code:
        $ ls -l Music
        ls: cannot access Music/Electro: Input/output error
        total 0
        d????????? ? ? ? ?        ? Electro
        I can get into the directory but
        Code:
        $ ls -l Electro
        ls: cannot access Electro: Input/output error
        as for the other one, slightly different response :
        Code:
        $ ls -l Music2
        ls: cannot access Music2: No such file or directory
        Other directories on the drive (backups) have not been affected.

        And I'll stay far away from rm -rf, promise !
        Single boot Kubuntu12.04 on Zepto NoxA14 Intel Dual Core 2GHz (64-bit), RAM 4Go, Nvidia GeForce 9600M GT

        Comment


          #5
          Re: Can't delete files & folders (input/output error)

          In this case, I'd be somewhat cautious about the wild cards because you might wind up deleting everything on the desktop. At the very least, I'd copy the '.directory' file some place else (under a different name). With regard to your external USB drive, do you have the ntfs-3g package (and it's dependencies (with recommends and suggests) installed?

          Comment


            #6
            Re: Can't delete files & folders (input/output error)

            Originally posted by askrieger
            In this case, I'd be somewhat cautious about the wild cards
            That's good advice. Probably would be smart to back it all up before launching the "delete" mission.

            However, looking at one of those crazy filenames, it looks like

            Code:
            rm *?.doc
            should nail the one that ends that way.

            The directories on the NTFS drive might be a bigger problem. If you can't read them from a Windows machine, time to dig up your Hiren's CD .... no guarantees that can be fixed, either.

            Comment


              #7
              Re: Can't delete files & folders (input/output error)

              Code:
              rm *?.doc
              worked instantly for the file on the Desktop, great !
              I didn't moved the .directory file nor used the wild cards.

              I'll have a go at the external drive this afternoon. Yes, I have ntfs-3g installed.
              Single boot Kubuntu12.04 on Zepto NoxA14 Intel Dual Core 2GHz (64-bit), RAM 4Go, Nvidia GeForce 9600M GT

              Comment

              Working...
              X