2

I do some photography, and I was trying to copy all of my recent raws (.NEF files, since I use a Nikon camera) from my SD card to an HDD that I have mounted (formatted in NTFS) using the basic copy/paste function in Nautilus. During the file transfer, my system crashed for some unknown reason (this has been happening occasionally recently, although I don't believe the mounted HDD is at fault). When the system rebooted, I attempted to continue the file transfer, but it kept running into an error. I then browsed to the destination folder in Nautilus, and it simply said "Folder is Empty." Concerned, I went to the command line and received this output from ls:

username@localhost:/path_to_main_folder/destination_directory$ ls
ls: reading directory '.': Input/output error

Switching to the main folder, I got this output from ls -l:

username@localhost:/path_to_main_folder$ ll | grep destination_directory
drwxrwxrwx 1 username username   1036288 Apr 14 15:27 destination_directory/

So, strangely, ls sees that the destination directory must have sizeable contents, but can't actually see what's inside the directory. Similarly, cp also spits out an input/output error. The HDD seems otherwise fine - all other files are perfectly intact, it's just that one folder.

Is there any way I can potentially recover this data from this broken directory?

  • Do you have another computer that you can use to verify that the SD is corrupt, and its not some obscure system error? – brndn2k Apr 18 '17 at 04:09

1 Answers1

0

We're going to fsck (file system check) your hard disk, run SMART utilities, and bad block scan your hard disk for errors.

Step #1

To check the file system on your Ubuntu partition...

  • boot to the GRUB menu
  • choose Advanced Options
  • choose Recovery mode
  • choose Root access
  • at the # prompt, type sudo fsck -f /
  • repeat the fsck command if there were errors
  • type reboot

To check the file system on your NTFS HDD...

  • boot into Windows
  • open a admin command prompt window
  • type chkdsk /f d: changing the "d" to the appropriate drive letter

Step #2

  • boot to a Ubuntu Live DVD/USB
  • start the Disks application
  • select the proper disk in the left pane
  • go to the "hamburger" icon and select SMART Data & Tests
  • review the failure data
  • run the SMART tests
  • quit Disks

Step #3

  • still in the Ubuntu Live DVD/USB
  • open terminal
  • type sudo e2fsck -c -k /dev/sda # scan for bad blocks
    • note: changing "sda" to "sdb" or some other correct drive designator
  • badblock scan will take a while
  • observe any output indicating that it found {single|multiple} bad blocks
  • if there are none, or only a few bad blocks, reboot and try Ubuntu again
  • if there are many bad blocks, backup your data, replace your hard disk
heynnema
  • 70,711