0

I have a hard drive with a lot of back up files, that were created by PhotoRec. When mounting it with a windows computer I can read all the files perfectly fine. Under linux I get an error when trying to look at the folder that contains all my backups. The rest of the hard drive is perfectly readable but when I try to ls the backup folder I get

ls: reading directory .: Input/output error

In Dolphin I just see a blank directory. I have tried letting arch auto mount and I have tried manually mounting it with -t ntfs-3g option (only flag used). A strange thing I notice is that if I manually mount it with the 3g option then all permissions are -rwxrwxrwx but if I let it be automatically mounted I have permissions -rw------- 1 steven steven (some have 2, but not many. The directories show d as they should). These are the same for every file and directory on the system.

I don't understand why I can't see these files under Linux, but can under Windows. I even booted up SystemRescueCD again to see if it recognized it, but it couldn't even see the files (even though it was what had originally written the files in the first place). What is so weird to me is that I can read everything on the hard drive except that one folder. It has the exact same permissions as everything else in the hard drive.

Additional info:

This is a fresh install of Arch. As of today.

[steven@serenity ~]$ uname -a
Linux serenity 3.16.1-1-ARCH #1 SMP PREEMPT Thu Aug 14 07:40:19 CEST 2014 x86_64 GNU/Linux

(auto mounted)

[steven@serenity ~]$ sudo fdisk -l

Disk /dev/sdb: 596.2 GiB, 640135028736 bytes, 1250263728 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x1549f232

Device     Boot Start        End    Sectors   Size Id Type
/dev/sdb1  *       63 1250258159 1250258097 596.2G  7 HPFS/NTFS/exFAT
5
  • You say you can't see anything in the directory, but also give permissions for "every file and directory" in it - I'm not sure how those fit together. Could you clarify what you can and can't see, and what is happening with each way of mounting? Commented Aug 31, 2014 at 23:14
  • @MichaelHomer sorry, I'll clear this up in the OP. It is only a single folder that this error is happening on the hard drive. Commented Aug 31, 2014 at 23:49
  • 1
    did you try running chkdsk from windows? Commented Sep 1, 2014 at 7:48
  • 1
    Sounds like it might have been the difference between the ntfs-3g and ntfs filesystem drivers. The automatic mounting might have defaulted to the ntfs driver, which at one point had severely restricted features. In cases like this, you might also want to check the output of the dmesg command - that's the place where the filesystem driver may have sent a more verbose error message. Commented Dec 20, 2020 at 15:49
  • It would be helfpul if you provided the actual permissions for directories when automounted - and confirmed is 'stephen' is the user you are trying to browse the files as. Commented Sep 28, 2023 at 14:49

1 Answer 1

0

The errors indicate a hardware problem with the disk but only on sectors containing the data.

The reason that under Windows you don't see these errors (until now), is probably caused by the difference in file browsing software: most Linux file browsers read more of the file information, from the file when opening a folder, than Windows Explorer does. This is to try and make previews, and have meta-data for the files available. Windows is probably only retrieving this when explicitly asked for.

You can try and see if you can copy all of the files under Windows to a separate disc. If that works run some thorough disk analyser on the original disk before continuing to use it (after making a full backup).

4
  • But I can open the files under the Windows system. And a hardware problem only on these sectors seems kind of weird... Commented Sep 1, 2014 at 4:57
  • 1
    @StevenWalton I'm just guessing, but opening doesn't necessarily mean complete reading. If you had a headcrash, as little as one sector could be affected, although usually there is more. How long does it take (under Linux) to get the error (i.e. is the system obviously retrying before giving up)? Commented Sep 1, 2014 at 4:59
  • Yeah, it just seems HIGHLY unlikely that the there is a hardware problem on only a certain section of a hdd. And I get the ls error immediately. If opening through dolphin it starts to scan then fails. I can even open the files in windows though. So if it is corrupted, it isn't in that way. Why can I open it in Windows and not Linux? Usually it's the other way around, or at least I can diagnose better. But I can't find anything. Commented Sep 1, 2014 at 7:13
  • 1
    What happens if you copy the files, preferably to another disk/SD etc. under Windows and then access those from Linux? Commented Sep 1, 2014 at 7:31

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.