How do I fix a corrupted harddrive after failed upgrade?
- by Nil
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