How do I fix a corrupted harddrive after failed upgrade?

Posted by Nil on Ask Ubuntu See other posts from Ask Ubuntu or by Nil
Published on 2013-10-20T19:08:39Z Indexed on 2013/10/21 22:04 UTC
Read the original article Hit count: 492

Filed under:
|

The problem originated when I was trying to fix this problem. Things went horribly, horribly wrong and I ended up with a new problem altogether. The last thing I did was run

sudo apt-get install

and that caused my system to freeze. I restarted my computer and it would not boot from the harddrive. I ran a copy of Ubuntu 12.10 from a flashdrive that I had and ran gparted to see if my partitions were all there. It returned this message:

Invalid partition table on /dev/sda -- wrong signature 5208.

The drive appeared as a 2TiB unallocated drive with an error. The drive had 4 partitions before (plus random unallocated space). There was a fat32 partition, an ext4 partition which contained ubuntu 13.04/13.10 (I don't even know which one at this point), an extended partition which contained a swap partition for my ubuntu partition (I was meaning to move that ubuntu partition into the extended partition, never got around to it), and another partition (I don't remember how I formatted it). I should also mention this is a 1TB harddrive.

So in short, I have a corrupted partition table on my primary harddrive from which I boot from, how can I fix this?


I tried mounting the drive with

sudo mount /dev/sda1 /media/ubuntu

then I changed my directory to said folder and tried to list files and this monstrosity happened:

$ ls
ls: cannot access ??w?j^?.: Input/output error
ls: cannot access ??(?
                      ?x?.|: Input/output error
ls: cannot access 6W_@?)?._??: Input/output error
ls: cannot access HB0v???.A}?: Input/output error
ls: cannot access ???.?X: Input/output error
ls: cannot access t)?.+?l: Input/output error
ls: cannot access ?h@   
?.@ : Input/output error
ls: cannot access >?    @??.???: Input/output error
ls: cannot access m???.??: Input/output error
ls: cannot access @ if??a?: Input/output error
ls: cannot access ?M!vN$?.??n: Input/output error
ls: cannot access ?o?
??.Bm`: Input/output error
ls: cannot access ?:I???
M.
: Input/output error
ls: cannot access W??.??: Input/output error
ls: cannot access ?: Input/output error
ls: cannot access ?W?s??: Input/output error
ls: cannot access ?v?k?.???: Input/output error
ls: cannot access 5?$<N??: Input/output error
.x????.??i: Input/output error
ls: cannot access je????.j?1: Input/output error
XjD?.???: Input/output error
ls: cannot access W??n???.?: Input/output error
ls: cannot access ?^x.$"?: Input/output error
ls: cannot access !??*!??j.??: Input/output error
ls: cannot access '-??k?^?.???: Input/output error
ls: cannot access b?w?w?b.\??: Input/output error
ls: cannot access o????"z.??B: Input/output error
ls: cannot access ??b?h.?3-: Input/output error
ls: cannot access ??.$7: Input/output error
ls: cannot access )??K.bk: Input/output error
ls: cannot access s??z?.?(?: Input/output error
ls: cannot access ?F@?0?.@?: Input/output error
.?D: Input/output error
.??: Input/output error
ls: cannot access?????.
                        @: Input/output error
ls: cannot access ?/??
                        ?.??: No such file or directory
ls: cannot access rk?p4q(?.?k: Input/output error

This looks promising. This is the output of fdisk -l

$ sudo fdisk -l /dev/sda
Warning: ignoring extra data in partition table 5
Warning: ignoring extra data in partition table 5
Warning: ignoring extra data in partition table 5
Warning: invalid flag 0x5208 of partition table 5 will be corrected by w(rite)

Disk /dev/sda: 2199.0 GB, 2199023132672 bytes
255 heads, 63 sectors/track, 267349 cylinders, total 4294967056 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
Disk identifier: 0x44fdfe06

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1       113305600   894715903   390705152    c  W95 FAT32 (LBA)
/dev/sda2       894715904  1489307647   297295872   83  Linux
/dev/sda3      1489309694  1497307135     3998721    5  Extended
/dev/sda4      1497309184  1953523711   228107264    7  HPFS/NTFS/exFAT
/dev/sda5   ?  3013257822  3688738171   337740175   aa  Unknown

© Ask Ubuntu or respective owner

Related posts about hard-drive

Related posts about Corruption

  • help! corrupt file recovery

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    My supervisor computer crashed last night, and I'm trying to help him out. He made an R script but when he tried to open it, it was empty. But for some reason the file is 7.9kb so it should not be empty i think... anyway when i tried to open it, Gedit gave this error: "The file you opened has… >>> More

  • Login screen restarts while entering password

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    I am having a problem that only occurred after installing the fglrx proprietary driver through the additional drivers app. The exact same issue is described in this question, however it's closed. Must login twice before entering Unity; first login screen has graphical anomalies When I boot up my… >>> More

  • Delete corrupted folder

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    I am trying to delete a folder in my home directory; its name is completely garbled. In Nautilus, the garbled text is followed by 'Invalid Directory.' Deleting it with Nautilus stalls; I can't type in the garbled name in the terminal. peter@io_vbox:~$ ls -lbdR * ... drwxrwxr-x 3 peter peter … >>> More

  • Error while installing netbeans

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    I tried to install NetBeans 7.2 from a downloaded .sh file, but experienced problems. Here's text from the Terminal, which shows what I did and what happened: hridesh@ubuntu:~$ cd Desktop/ hridesh@ubuntu:~/Desktop$ cd full\ netbeans\ 7.2\ for\ linux\ in\ .sh\ format/ hridesh@ubuntu:~/Desktop/full… >>> More

  • How do I fix a corrupted harddrive after failed upgrade?

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    The problem originated when I was trying to fix this problem. Things went horribly, horribly wrong and I ended up with a new problem altogether. The last thing I did was run sudo apt-get install and that caused my system to freeze. I restarted my computer and it would not boot from the harddrive… >>> More