Announcement

Collapse
No announcement yet.

Input/Output Errors on an External Drive?

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

    Input/Output Errors on an External Drive?

    I have a particular folder that I want to delete, but when I do sudo rm -r folderNameHere, I get an Input/Output Error. This seems to sugest that the drive is damaged, but the nearest thing someone told me to do it to run a smart test, which I did useing sudo smartctl --test=long -d sat /dev/sdg. I received no errors (At least as far as I could tell by reading from sudo smartctl -a -d sat /dev/sdg).

    An old answer that I saw on AskUbuntu said to boot Windows and have it take a look at the drive, but is there a more *buntu-friendly version that doesn't assume that you are dual booting windows? I'm still having issues with the external drive and couldn't delete the folder.

    I can run diagnostic commands if you want me to .

    #2
    How do u mount it ?
    What format is on the disk ?
    Have you tried running fsck ?
    Mark Your Solved Issues [SOLVED]
    (top of thread: thread tools)

    Comment


      #3
      The command looks wrong to me. To remove a folder, use "rmdir" unless it has files in it, then use "rm -rf". The command you listed would remove files from within the folder but not the folder itself. However, the error message is not germane to the command. The error you should have gotten was "rm: cannot remove 'folderNameHere': Is a directory"

      I wouldn't leap to a bad device before checking out the filesystem. Much more likely a damaged inode than a drive sector. Run fsck on the file system.

      If smartctl shows "passed", that doesn't mean you're not encountering a bad sector, just that the drive looks normal. Bad sectors are a "normal", if rare, occurrence. Look at your smartctl output at "Current_Pending_Sector" count and if the raw value is higher than zero, you may be losing the drive. If it shows pending bad blocks, check into the "badblocks" command.

      Attempt the deletion, when the error occurs, check the output of dmesg. If the drive is actually failing, it should show some errors. Also, the fact that it's an external drive means there are more things to consider - cable, interface, driver, etc.

      BTW, if you're asking for file system help, it would be useful to know which file system you're using.

      Please Read Me

      Comment


        #4
        Originally posted by oshunluvr View Post
        use "rm -rf"
        Warning: Be aware, using rm -rf in the wrong location can have serious and unintended consequences. See man rm and understand what its OPTIONS do.
        Using Kubuntu Linux since March 23, 2007
        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

        Comment


          #5
          The /dev/sdg drive appears to be NTFS according to gparted.

          Running this command gave me an error message:
          Code:
          [FONT=monospace][COLOR=#54FF54][B]sarah@ConvergentRefuge[/B][/COLOR]:[COLOR=#5454FF][B]~[/B][/COLOR]$ sudo fsck -r /dev/sdg 
          fsck from util-linux 2.31.1 
          e2fsck 1.44.1 (24-Mar-2018) 
          ext2fs_open2: Bad magic number in super-block 
          fsck.ext2: Superblock invalid, trying backup blocks... 
          fsck.ext2: Bad magic number in super-block while trying to open /dev/sdg 
          
          The superblock could not be read or does not describe a valid ext2/ext3/ext4 
          filesystem. If the device is valid and it really contains an ext2/ext3/ext4 
          filesystem (and not swap or ufs or something else), then the superblock 
          is corrupt, and you might try running e2fsck with an alternate superblock: 
            e2fsck -b 8193 <device> 
          or 
            e2fsck -b 32768 <device> 
          
          Found a dos partition table in /dev/sdg 
          /dev/sdg: status 8, rss 4280, real 3.412566, user 0.001418, sys 0.004827
          
          [/FONT]

          Comment


            #6
            Well, ntfs isn't a linux drive format so you can't check it using fsck. See where is says "not a valid ext2/ext3/ex4 filesystem"? You need to install ntfs-3g and run ntfsfix.

            Also, you're running a file system check on the whole device rather than the file system. Last time I checked, all file systems except btrfs must reside on a partition. You would need to indicate which partition, likely 1, so use /dev/sdg1 not /dev/sdg.

            Try:

            sudo ntfsfix -d -b /dev/sdg1

            Please Read Me

            Comment

            Working...
            X