Announcement

Collapse
No announcement yet.

Help with HDD. Is it a Partitioning Problem?

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

    #61
    So here's my protective MBR (on my GPT disk):

    Code:
     sudo dd if=/dev/sda bs=512 count=1 | hexdump -C
    1+0 records in
    1+0 records out
    512 bytes (512 B) copied00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
    , 4.1052e-05 s, 12.5 MB/s
    *
    000001c0  01 00 ee fe ff ff 01 00  00 00 2f 60 38 3a 00 00  |........../`8:..|
    000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
    *
    000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
    00000200
    The asterisks indicate zeros. Thus, there is very little non-zero entry in my protective MBR.

    As Starman explains, Windows 7/8 has its own version of the protective MBR, and he points out the differences. I think if you study his example, you can put your finger on the entry for the damaged MBR sector your TestDisk error message refers to. You can't fix that, but maybe TestDisk can 'fix the MBR' for you -- that is the $64,001 question.

    If you have a GPT, it has a Protective MBR--its first 512 bytes, or Sector 0. The entries explained by Starman, are there partly to fool partitioning tools that are NOT GPT aware: it tells them that there is only one partition on the disk and it is basically FULL--so go away, don't try to write anything in this MBR or on this disk.

    The protective MBR has another purpose, also. If you wish to use your UEFI firmware to boot this disk by Legacy method (using CSM--and NOT using the ESP with UEFI), this MBR is used along with another Bios Boot Partition of 1 MB created somewhere on the GPT disk -- so a bootloader like GRUB can install itself to the MBR + the Bios Boot Partition.

    Don't get too involved in this right now. But perhaps TestDisk can repair the MBR if, in fact, it is broken. But ... why would it be broken all of a sudden? It happens, though, but infrequently. Perhaps some corruption crept in [to just a sector or so]? Just remember, when you use a program like TestDisk, I think it is safe, BUT as the site says, there are risks of messing up part of or even the entire show.
    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

    Comment


      #62
      Thank you! I started looking through your links, and I really don't understand what they mean for me. But I shall continue. In the meantime, I will share the recovery utilities I found in TestDisk, as well as the Protective MBR table for my broken HDD:

      Here is the "Write MBR code on First Sector""
      Click image for larger version

Name:	WriteMBRCode.png
Views:	1
Size:	21.1 KB
ID:	642975

      Click image for larger version

Name:	WriteYN.png
Views:	1
Size:	12.3 KB
ID:	642976

      Also, the "Advanced File System Utilities (with a create image option):

      Click image for larger version

Name:	AdvFileSysUt.png
Views:	1
Size:	18.1 KB
ID:	642977


      And lastly (for now), my Protective MBR:

      Code:
      00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|1+0 records in
      1+0 records out
      *
      512 bytes (512 B) copied000001b0  00 00 00 00 00 00 00 00  f3 b6 56 39 00 00 00 00  |..........V9....|
      000001c0  01 00 ee fe ff ff 01 00  00 00 2f 60 38 3a 00 00  |........../`8:..|
      000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
      , 0.0243357 s, 21.0 kB/s
      *
      000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
      00000200
      Also, my broken HDD dualboots Windows 8 and Linux, not Windows 7 and Linux.

      Thank you! I'm off to my reading list.

      TM

      Comment


        #63
        I might be starting to interpret it now:

        Per Gdisk, the code I have is MBR Protective, not GPT:

        Code:
        kubuntu@kubuntu:~$ sudo gdiskGPT fdisk (gdisk) version 0.8.7
        
        
        Type device filename, or press <Enter> to exit: /dev/sda
        Partition table scan:
        [B]  MBR: protective[/B]
          BSD: not present
          APM: not present
        [B]  GPT: not present[/B]
        
        
        Creating new GPT entries.
        Protective MBR map:

        Code:
        kubuntu@kubuntu:~$ sudo dd if=/dev/sda bs=512 count=1 | hexdump -C1+0 records in
        1+0 records out
        00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
        *
        512 bytes (512 B) copied000001b0  00 00 00 00 00 00 00 00  f3 b6 56 39 00 00 00 00  |..........V9....|
        , 0.00413373 s, 124 kB/s
        000001c0  01 00 ee fe ff ff 01 00  00 00 2f 60 38 3a 00 00  |........../`8:..|
        000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
        *
        000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
        00000200
        Yet, according to fdisk, my system is GPT:

        Code:
        sudo fdisk -l /dev/sda Note: sector size is 4096 (not 512)
        
        
        Disk /dev/sda: 500.1 GB, 500107862016 bytes
        255 heads, 63 sectors/track, 7600 cylinders, total 122096646 sectors
        Units = sectors of 1 * 4096 = 4096 bytes
        Sector size (logical/physical): 4096 bytes / 4096 bytes
        I/O size (minimum/optimal): 4096 bytes / 4096 bytes
        Disk identifier: 0x3956b6f3
        
        
           Device Boot      Start         End      Blocks   Id  System
        /dev/sda1               1   976773167  3907092668   ee  [B]GPT[/B]
        But, if I use TestDisk and search for an Intel partition map

        Code:
        Disk /dev/sda - 500 GB / 465 GiB - ST500LT0 12-9WS142
        
        Please select the partition table type, press Enter when done.
        [B]>[Intel  ] Intel/PC partition[/B]
         [EFI GPT] EFI GPT partition map (Mac i386, some x86_64...)
         [Humax  ] Humax partition table
         [Mac    ] Apple partition map
         [None   ] Non partitioned media
         [Sun    ] Sun Solaris partition
         [XBox   ] XBox partition
         [Return ] Return to disk selection
        
        
        Hint: Intel partition table type has been detected.
        Note: Do NOT select 'None' for media with only a single partition. It's very
        rare for a drive to be 'Non-partitioned'.

        ...there is only one partition that remains - a corrupted GPT:

        Code:
        Disk /dev/sda - 500 GB / 465 GiB - CHS 7600 255 63Current partition structure:
             Partition                  Start        End    Size in sectors
        
        
         1 P [B]EFI GPT [/B]                 0   0  2 60801  80 63  976773167
        
        
        [B]Bad relative sector.[/B]
        [B]No partition is bootable[/B]
        ....in addition to several additional partitions (found after a quick search):

        Code:
        Disk /dev/sda - 500 GB / 465 GiB - CHS 7600 255 63     Partition               Start        End    Size in sectors
        >  HPFS - NTFS             10 168 31    18 119 37     125440 [WINRETOOLS]
           HPFS - NTFS             18 119 38  3911 136  1   62542080 [OS]
           HPFS - NTFS           3911 136  2  3918 179 37     115200
           Linux Swap            3918 179 38  4058 193 39    2249984
           Linux                 4058 193 40  4525 156 47    7500032
           Linux                 4525 156 48  7394  59 25   46084352
           HPFS - NTFS           7394  59 26  7399 206 39      89600
           HPFS - NTFS           7399 206 40  7600  41 57    3218688 [PBR Image
        If I search for a EFI GPT table...

        Code:
        Please select the partition table type, press Enter when done.
         [Intel  ] Intel/PC partition
        [B] >[EFI GPT] EFI GPT partition map (Mac i386, some x86_64...)[/B]
         [Humax  ] Humax partition table
         [Mac    ] Apple partition map
         [None   ] Non partitioned media
         [Sun    ] Sun Solaris partition
         [XBox   ] XBox partition
         [Return ] Return to disk selection
        
        
        Hint: Intel partition table type has been detected.
        Note: Do NOT select 'None' for media with only a single partition. It's very
        rare for a drive to be 'Non-partitioned'.
        ....I am told I have no partitions left, except a corrupted GPT:

        Code:
        Disk /dev/sda - 500 GB / 465 GiB - CHS 7600 255 63Current partition structure:
             Partition                  Start        End    Size in sectors
        
        
        Bad GPT partition, invalid signature.
        Trying alternate GPT
        Bad GPT partition, invalid signature.
        ....upon which I cannot write MBR code:

        Code:
        Disk /dev/sda - 500 GB / 465 GiB - ST500LT0 12-9WS142     CHS 7600 255 63 - sector size=4096
        
        
        >[ Analyse  ] Analyse current partition structure and search for lost partitions
         [ Advanced ] Filesystem Utils
         [ Geometry ] Change disk geometry
         [ Options  ] Modify options
         [ Quit     ] Return to disk selection
        
        
        Note: Correct disk geometry is required for a successful recovery. 'Analyse'
        process may give some warnings if it thinks the logical geometry is mismatched.
        ....but I can recover several partitions with a quick search:

        Code:
        Disk /dev/sda - 500 GB / 465 GiB - CHS 7600 255 63     Partition               Start        End    Size in sectors
        >P MS Data                   171264     296703     125440 [WINRETOOLS]
         P MS Data                   296704   62838783   62542080 [OS]
         P MS Data                 62838784   62953983     115200
         P Linux Swap              62953984   65203965    2249982
         P MS Data                 65203968   72703999    7500032
         P MS Data                 72704000  118788351   46084352
         P MS Data                118788352  118877951      89600
         P MS Data                118877952  122096389    3218438 [PBR Image]
        So, is it possible that I have a protective MBR AND a corrupted GPT?

        And if so, how shall I fix it/them?


        Shall I rewrite the MBR code...

        Code:
        Disk /dev/sda - 500 GB / 465 GiB - CHS 7600 255 63
        
        Write a new copy of MBR code to first sector? (Y/N)
        ...to the first sector detected by an Intel map search...

        Code:
        Disk /dev/sda - 500 GB / 465 GiB - CHS 7600 255 63Current partition structure:
             Partition                  Start        End    Size in sectors
        
        
         1 P EFI GPT                  0   0  2 60801  80 63  976773167
        
        
        Bad relative sector.
        No partition is bootable
        ...then recover the remaining partitions and save?

        Code:
        Disk /dev/sda - 500 GB / 465 GiB - CHS 7600 255 63     Partition               Start        End    Size in sectors
        >  HPFS - NTFS             10 168 31    18 119 37     125440 [WINRETOOLS]
           HPFS - NTFS             18 119 38  3911 136  1   62542080 [OS]
           HPFS - NTFS           3911 136  2  3918 179 37     115200
           Linux Swap            3918 179 38  4058 193 39    2249984
           Linux                 4058 193 40  4525 156 47    7500032
           Linux                 4525 156 48  7394  59 25   46084352
           HPFS - NTFS           7394  59 26  7399 206 39      89600
           HPFS - NTFS           7399 206 40  7600  41 57    3218688 [PBR Image]
        
        Structure: Ok.  Use Up/Down Arrow keys to select partition.
        Use Left/Right Arrow keys to CHANGE partition characteristics:
        *=Primary bootable  P=Primary  L=Logical  E=Extended  D=Deleted
        Keys A: add partition, L: load backup, T: change type, P: list files,
             Enter: to continue
        NTFS, blocksize=4096, 513 MB / 490 MiB
        Or, must I recover the detected partitions FIRST, then write MBR to the first sector?


        ----------

        Or, can I use the options in gdisk:

        Code:
        Type device filename, or press <Enter> to exit: /dev/sdaPartition table scan:
          MBR: protective
          BSD: not present
          APM: not present
          GPT: not present
        
        
        Creating new GPT entries.
        
        
        [B]Command (? for help): ?[/B]
        [B]b       back up GPT data to a file[/B]
        [B]c       change a partition's name[/B]
        [B]d       delete a partition[/B]
        [B]i       show detailed information on a partition[/B]
        [B]l       list known partition types[/B]
        [B]n       add a new partition[/B]
        [B]o       create a new empty GUID partition table (GPT)[/B]
        [B]p       print the partition table[/B]
        [B]q       quit without saving changes[/B]
        [B]r       recovery and transformation options (experts only)[/B]
        [B]s       sort partitions[/B]
        [B]t       change a partition's type code[/B]
        [B]v       verify disk[/B]
        [B]w       write table to disk and exit[/B]
        [B]x       extra functionality (experts only)[/B]
        [B]?       print this menu[/B]
        
        
        Command (? for help):
        ...to fix it? Or, something completely different?

        Thanks,
        TM
        Last edited by technomancer; Jul 23, 2015, 11:33 AM.

        Comment


          #64
          I'm on the run today and just had time to check in and see the two new posts. Quickly then:

          Also, my broken HDD dual boots Windows 8 and Linux, not Windows 7 and Linux.
          That's confusing, not at all sure what the picture is here.

          So, is it possible that I have a protective MBR AND a corrupted GPT?
          But if you had a valid GPT, gdisk should detect it, I would think, and then, possibly report back some issue it sees (especially if you run the interactive mode where you respond to its prompts to explore things).

          Did you notice that starman is using Windows utilities, exclusively, although he mentions that TestDisk sees things the way he likes. And did you catch starman claiming that Windows 7 may set things up the way it wants, which may not gel with more standard UEFI or Linux ways?

          fwiw, here's the nice clean picture I'm trying to get in my mind, an example, run on my HDD, a standard, clear POV from Linux using gdsik:

          Code:
            sudo [B]gdisk -l /dev/sda[/B]
           [sudo] password for mike:  
           GPT fdisk (gdisk) version 0.8.8
           
            Partition table scan:
             MBR: protective
             BSD: not present
             APM: not present
             [B]GPT: present[/B]
            
           Found valid GPT with protective MBR; using GPT.
           Disk /dev/sda: 976773168 sectors, 465.8 GiB
           Logical sector size: 512 bytes
           Disk identifier (GUID): D3B766B4-D998-4351-8F06-13BC87F55BDE
           Partition table holds up to 128 entries
           First usable sector is 34, last usable sector is 976773134
           Partitions will be aligned on 2048-sector boundaries
           Total free space is 111493101 sectors (53.2 GiB)
            
           Number  Start (sector)    End (sector)  Size       Code  Name
              1            2048         1026047   500.0 MiB   EF00  <-- my "main" ESP
              2         1026048        62466047   29.3 GiB    8300   
              3        62466048       267266047   97.7 GiB    8300   
              4       267266048       300034047   15.6 GiB    8200   
              5       300034048       361474047   29.3 GiB    8300   
              6       361474048       566274047   97.7 GiB    8300   
              7       566274048       567298047   500.0 MiB   EF00   
              8       567298048       669698047   48.8 GiB    8300   
              9       669698048       772098047   48.8 GiB    8300   
             10       772098048       773122047   500.0 MiB   EF00   
             11       773122048       824322047   24.4 GiB    8300   
             12       824322048       865282047   19.5 GiB    8300
          Now when you ask me, I can explain what is on each of those partitions -- I have 6 OSs, three ESPs, a swap, one separate /home at sda3 for the Kubuntu 14.04 in sda2, etc.

          It does not appear (to me) that you have any GPT, although there are indications you do, like the "1 P EFI GPT" I mention below.

          I need to re-think this. I'm thinking of your first post: we do not really have a diagnosis of what the true problem is--bad HDD? corrupted boot sector? corrupted MBR? a hardware problem (sure sounds like the power supply had a stutter there at least once), and so on. I mean, we can direct TestDisk to make all sorts of changes, like shooting in the dark hoping to do something that hits. But it could be risky. Recall, your DVD live session and Boot Repair could not even see this HDD properly.

          This thing keeps popping up:

          1 P EFI GPT 0 0 2 60801 80 63 976773167

          Well, gee golly, that happens to be ONE partition of size 500 MB = the whole disk, just like the Protective MBR would indicate (as starman explains) in a GPT.

          Code:
          kubuntu@kubuntu:~$ sudo dd if=/dev/sda
          bs=512 count=1 | hexdump -C
          Actually what I meant here was to compare yours--step-by-step--to starman's explanantion of what those entries mean, thinking you might glean something or confirm something.


          Just checking:
          did we ever run the SMART for a longer/detailed test, or just the short test?
          if you boot the bad computer with the bad HDD in it now, what happens? did you try this?
          An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

          Comment


            #65
            Please read my previous post, just a note:

            It does seem you have a GPT--though gdisk is not showing that to us. The "ee" type for this appears in your MBR, at position 1C2:

            Code:
            sudo dd if=/dev/sda bs=512 count=1 | hexdump -C
            1+0 recordsin
            1+0 records out 
            512 bytes (512 B) copied, 0.00413373 s, 124 kB/s
            00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................| * 
            000001b0  00 00 00 00 00 00 00 00  [B]f3 b6 56 39[/B] 00 00 [COLOR=#006600][B]00[/B][/COLOR] 00 |..........V9....| 
            [U]000001c0[/U]  01 00 [SIZE=3][COLOR=#00ffff][B]ee[/B][/COLOR][/SIZE] fe ff ff [B]01[/B] 00  00 00 2f 60 38 3a 00 00  |........../`8:..|
            000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................| * 
            000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.| 
            00000200
            I'll review your printouts when I return to this again soon. You ran fdisk on this bad HDD, too, right?
            An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

            Comment


              #66
              So, is it possible that I have a protective MBR AND a corrupted GPT?
              Yes, it is possible.

              Now this:
              1 P EFI GPT 0 0 2 60801 80 63 976773167

              Bad relative sector. No partition is bootable
              I already explained the first line: 1 P EFI
              GPT => showing us ONE partition = the entire HDD -- this is normal behavior for a Protective MBR (which is part of a GPT).

              Bad relative sector: Not sure about this, it doesn't sound good BUT it might simply be a bad or unexpected entry in the MBR.

              No partition is bootable: That is also a normal message for a
              protective MBR: nothing is supposed to be bootable! You don't want
              an OS or utility messing with your real GPT.

              Look at your output for sudo fdisk -l /dev/sda

              Device Boot Start End
              Blocks Id System /dev/sda1
              1 976773167 3907092668 ee GPT

              That's as it should be if you have a GPT: ee GPT
              and there is ONE partition = the entire HDD.

              Conclusion: Windows 7 has set up a GPT with a
              protective MBR.

              But, why doesn't gdisk enumerate the
              partitions and say it is a GPT?

              As for this, in TestDisk: Write a new copy of MBR code to first sector?
              (Y/N)

              I'd say No to that! It is not even clear what is going on. TestDisk--I believe--is asking you if you want a standard MBR fixed, but this is not a standard MBR.

              =>

              Can you use gdisk to explore this, somehow,
              any-how!, poking around, getting it to list partitions or whatever or
              analyze?

              And from my post above:

              Just checking:
              did we ever run the SMART for a longer/detailed test, or just the short test?
              if you boot the bad computer with the bad HDD in it now, what happens? did you try this?
              and this:

              Also, my broken HDD dual boots Windows 8 and Linux, not Windows 7 and Linux.
              Confusing, again! You have two Windows on the bad disk, and the bad disk WILL boot up OK with Windows 8?
              Last edited by Qqmike; Jul 23, 2015, 04:32 PM.
              An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

              Comment


                #67
                Running gdisk to explore this ...


                Command (? for help): ?
                b back up GPT data to a file
                c change a partition's name

                d delete a partition

                i show detailed information on a partition
                l list known partition types n add a new partition o create a new empty GUID partition table (GPT)
                p print the partition table
                q quit without saving changes
                r recovery and transformation options (experts only)
                s sort partitions
                t change a partition's type code
                v verify disk w write table to disk and exit
                x extra functionality (experts only)<--I'm not sure about this one ... ? ? print this menu

                It's been quite awhile since I ran gdisk, but the entries in red are the ones you'd use to explore this. r:recovery is the one that gets real serious! be careful there. I can't remember x. v is harmless.
                An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                Comment


                  #68
                  I have not run the long (several hours long) SMART test on my HDD, but I can do that.


                  Also, my broken HDD dual boots Windows 8 and Linux, not Windows 7 and Linux.




                  Confusing, again! You have two Windows on the bad disk, and the bad disk WILL boot up OK with Windows 8?
                  It is confusing, but let me try to explain. No, I only have 1 version of Windows on my Bad HDD, and that is Windows 8. Maybe telling the story chronologically will help:

                  --------------

                  My spare computer runs windows 7 on it. I tossed it aside when I got my new laptop for Christmas, which had Windows 8.

                  I never liked Windows 8, and creating Batch Files to go-around all of its eccentricities (like the 50 mouseclicks you have to make in order to shut the d@mn thing down) wasn't enough for me. So I did a dual-boot install of Win 8 and Linux. This has been my primary system for over a year now, until the crash on Sunday.

                  I took the bad HDD out of my new computer, and plugged it in via USB into my old one (the one that runs Win 7). I started booting liveCDs in the Win 7 one, which is how I started writing on the forum.

                  I eventually put the newer, broken laptop together again, and I have the offending HDD plugged into it now via USB.

                  In summary, the offending HDD has only two OS's on it: Win 8 and Kubuntu. It is a dualboot system. I would like to get it back, because I have customized my Kubuntu to such a degree, that starting over again will be like going back to the stone age for me. I cannot promise anything, but if you can help me fix it, I will be so ecstatic I'll likely write my Congressman to dedicate a national holiday in your honor.

                  --------------

                  I will run the longer test on the broken HDD. Previous tries to boot from it failed to even load a boot menu, but it's worth trying again. I will let you know what happens :-)

                  Thanks again,
                  TM
                  Last edited by technomancer; Jul 23, 2015, 05:27 PM.

                  Comment


                    #69
                    OK, let's stick to the program here: you are running a more extensive SMART test on the bad HDD.

                    If it passes, and just in case I am not here when you finish it, let me post what I think looks promising by using gdisk to ATTEMPT a fix (I have actually done this in my tests) -- this way, you will have something to look at if I'm away awhile:

                    Code:
                    mike@mike-desktop:~$ sudo gdisk
                    [sudo] password for mike: 
                    GPT fdisk (gdisk) version 0.8.8
                    
                    Type device filename, or press <Enter> to exit: /dev/sda
                    Partition table scan:
                      MBR: protective
                      BSD: not present
                      APM: not present
                      GPT: present
                    
                    Found valid GPT with protective MBR; using GPT.
                    
                    Command (? for help): ?
                    b       back up GPT data to a file
                    c       change a partition's name
                    d       delete a partition
                    i       show detailed information on a partition
                    l       list known partition types
                    n       add a new partition
                    o       create a new empty GUID partition table (GPT)
                    [COLOR=#ff0000]p       print the partition table[/COLOR]
                    q       quit without saving changes
                    [COLOR=#ff0000]r       recovery and transformation options (experts only)[/COLOR]
                    s       sort partitions
                    t       change a partition's type code
                    v       verify disk
                    w       write table to disk and exit
                    x       extra functionality (experts only)
                    ?       print this menu
                    
                    Command (? for help): p
                    Disk /dev/sda: 976773168 sectors, 465.8 GiB
                    Logical sector size: 512 bytes
                    Disk identifier (GUID): D3B766B4-D998-4351-8F06-13BC87F55BDE
                    Partition table holds up to 128 entries
                    First usable sector is 34, last usable sector is 976773134
                    Partitions will be aligned on 2048-sector boundaries
                    Total free space is 111493101 sectors (53.2 GiB)
                    
                    Number  Start (sector)    End (sector)  Size       Code  Name
                       1            2048         1026047   500.0 MiB   EF00  
                       2         1026048        62466047   29.3 GiB    8300  
                       3        62466048       267266047   97.7 GiB    8300  
                       4       267266048       300034047   15.6 GiB    8200  
                       5       300034048       361474047   29.3 GiB    8300  
                       6       361474048       566274047   97.7 GiB    8300  
                       7       566274048       567298047   500.0 MiB   EF00  
                       8       567298048       669698047   48.8 GiB    8300  
                       9       669698048       772098047   48.8 GiB    8300  
                      10       772098048       773122047   500.0 MiB   EF00  
                      11       773122048       824322047   24.4 GiB    8300  
                      12       824322048       865282047   19.5 GiB    8300  
                    
                    Command (? for help): r
                    
                    Recovery/transformation command (? for help): ?
                    [COLOR=#ff0000]b       use backup GPT header (rebuilding main)
                    c       load backup partition table from disk (rebuilding main)[/COLOR]
                    d       use main GPT header (rebuilding backup)
                    e       load main partition table from disk (rebuilding backup)
                    f       load MBR and build fresh GPT from it
                    g       convert GPT into MBR and exit
                    h       make hybrid MBR
                    i       show detailed information on a partition
                    l       load partition data from a backup file
                    m       return to main menu
                    o       print protective MBR data
                    p       print the partition table
                    q       quit without saving changes
                    t       transform BSD disklabel partition
                    v       verify disk
                    w       write table to disk and exit
                    x       extra functionality (experts only)
                    ?       print this menu
                    
                    Recovery/transformation command (? for help):
                    At this point, I would try c:
                    c load backup partition table from disk (rebuilding main)

                    If that didn't help, then b:
                    b use backup GPT header (rebuilding main)

                    Some logic:
                    I don't see what else to try. And it should not hurt anything. I'm assuming you have an ESP set up by Windows -- looks like a 50 MB partition I saw on one of your printouts. It seems to be EFI+GPT, so there's no sense rebuilding any MBR. (Very difficult doing this work relying on Windows utilities, which I am not familiar with and have avoided since XP.)
                    An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                    Comment


                      #70
                      Originally posted by Qqmike View Post
                      OK, let's stick to the program here: you are running a more extensive SMART test on the bad HDD.

                      If it passes, and just in case I am not here when you finish it, let me post what I think looks promising by using gdisk to ATTEMPT a fix (I have actually done this in my tests) -- this way, you will have something to look at if I'm away awhile:
                      Ok, here's the results of the long SMART test:

                      Code:
                      kubuntu@kubuntu:~$ sudo smartctl -l selftest /dev/sdasmartctl 6.2 2013-04-20 r3812 [x86_64-linux-3.11.0-12-generic] (local build)
                      Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
                      
                      
                      === START OF READ SMART DATA SECTION ===
                      SMART Self-test log structure revision number 1
                      Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
                      # 1  Extended offline    Completed without error       00%      5946         -
                      # 2  Extended offline    Completed without error       00%      5943         -
                      # 3  Extended offline    Aborted by host               90%      5941         -
                      # 4  Short offline       Completed without error       00%      5886         -
                      # 5  Short offline       Completed without error       00%      5886         -
                      # 6  Extended offline    Aborted by host               90%      5854         -
                      # 7  Short offline       Completed without error       00%      5854         -
                      # 8  Short offline       Completed without error       00%      5073         -
                      # 9  Short offline       Completed without error       00%       666         -
                      #10  Short offline       Completed without error       00%       136         -
                      A couple tests were aborted, but I can try the gdisk options you highlighted for me:

                      Code:
                      mike@mike-desktop:~$ sudo gdisk
                      [sudo] password for mike: 
                      GPT fdisk (gdisk) version 0.8.8
                      
                      Type device filename, or press <Enter> to exit: /dev/sda
                      Partition table scan:
                        MBR: protective
                        BSD: not present
                        APM: not present
                        GPT: present
                      
                      Found valid GPT with protective MBR; using GPT.
                      
                      Command (? for help): ?
                      b       back up GPT data to a file
                      c       change a partition's name
                      d       delete a partition
                      i       show detailed information on a partition
                      l       list known partition types
                      n       add a new partition
                      o       create a new empty GUID partition table (GPT)
                      [COLOR=#ff0000]p       print the partition table[/COLOR]
                      q       quit without saving changes
                      [COLOR=#ff0000]r       recovery and transformation options (experts only)[/COLOR]
                      s       sort partitions
                      t       change a partition's type code
                      v       verify disk
                      w       write table to disk and exit
                      x       extra functionality (experts only)
                      ?       print this menu
                      
                      Command (? for help): p
                      Disk /dev/sda: 976773168 sectors, 465.8 GiB
                      Logical sector size: 512 bytes
                      Disk identifier (GUID): D3B766B4-D998-4351-8F06-13BC87F55BDE
                      Partition table holds up to 128 entries
                      First usable sector is 34, last usable sector is 976773134
                      Partitions will be aligned on 2048-sector boundaries
                      Total free space is 111493101 sectors (53.2 GiB)
                      
                      Number  Start (sector)    End (sector)  Size       Code  Name
                         1            2048         1026047   500.0 MiB   EF00  
                         2         1026048        62466047   29.3 GiB    8300  
                         3        62466048       267266047   97.7 GiB    8300  
                         4       267266048       300034047   15.6 GiB    8200  
                         5       300034048       361474047   29.3 GiB    8300  
                         6       361474048       566274047   97.7 GiB    8300  
                         7       566274048       567298047   500.0 MiB   EF00  
                         8       567298048       669698047   48.8 GiB    8300  
                         9       669698048       772098047   48.8 GiB    8300  
                        10       772098048       773122047   500.0 MiB   EF00  
                        11       773122048       824322047   24.4 GiB    8300  
                        12       824322048       865282047   19.5 GiB    8300  
                      
                      Command (? for help): r
                      
                      Recovery/transformation command (? for help): ?
                      [COLOR=#ff0000]b       use backup GPT header (rebuilding main)
                      c       load backup partition table from disk (rebuilding main)[/COLOR]
                      d       use main GPT header (rebuilding backup)
                      e       load main partition table from disk (rebuilding backup)
                      f       load MBR and build fresh GPT from it
                      g       convert GPT into MBR and exit
                      h       make hybrid MBR
                      i       show detailed information on a partition
                      l       load partition data from a backup file
                      m       return to main menu
                      o       print protective MBR data
                      p       print the partition table
                      q       quit without saving changes
                      t       transform BSD disklabel partition
                      v       verify disk
                      w       write table to disk and exit
                      x       extra functionality (experts only)
                      ?       print this menu
                      
                      Recovery/transformation command (? for help):
                      At this point, I would try c:
                      c load backup partition table from disk (rebuilding main)

                      If that didn't help, then b:
                      b use backup GPT header (rebuilding main)

                      Some logic:
                      I don't see what else to try. And it should not hurt anything. I'm assuming you have an ESP set up by Windows -- looks like a 50 MB partition I saw on one of your printouts. It seems to be EFI+GPT, so there's no sense rebuilding any MBR. (Very difficult doing this work relying on Windows utilities, which I am not familiar with and have avoided since XP.)
                      Thanks,
                      TM
                      Last edited by technomancer; Jul 24, 2015, 07:30 AM.

                      Comment


                        #71
                        OK, so I ran Gdisk and printed the partition table. It came up empty:

                        Code:
                        Command (? for help): pDisk /dev/sda: 122096646 sectors, 465.8 GiB
                        Logical sector size: 4096 bytes
                        Disk identifier (GUID): CC1C1049-6685-49DD-89B2-1E1380A65B27
                        Partition table holds up to 128 entries
                        First usable sector is 6, last usable sector is 122096640
                        Partitions will be aligned on 256-sector boundaries
                        Total free space is 122096635 sectors (465.8 GiB)
                        
                        
                        Number  Start (sector)    End (sector)  Size       Code  Name
                        Shall I continue with the recovery options? Shall I recover the partitions with TestDisk? Or, does option C "load backup partition table from disk" do that?

                        Also, when I select option C, I get this:

                        Code:
                        Command (? for help): r
                        
                        [COLOR=#ff0000]Recovery/transformation command (? for help): c[/COLOR]
                        Warning! This will probably do weird things if you've converted an MBR to
                        GPT form and haven't yet saved the GPT! Proceed? (Y/N): n
                        And, when I select B, then C:

                        Code:
                        
                        Recovery/transformation command (? for help): [COLOR=#ff0000]b[/COLOR]
                        [COLOR=#ff0000]
                        [/COLOR]
                        Recovery/transformation command (? for help): [COLOR=#ff0000]c[/COLOR]
                        Warning! This will probably do weird things if you've converted an MBR to
                        GPT form and haven't yet saved the GPT! Proceed? (Y/N): n
                        
                        
                        Recovery/transformation command (? for help):
                        What gives?

                        Thanks,
                        TM
                        Last edited by technomancer; Jul 24, 2015, 07:46 AM.

                        Comment


                          #72
                          Shall I continue with the recovery options? Shall I recover the partitions with TestDisk?
                          Did you SEE missing partitions on the TestDisk output, that you know of? If so, then, yes, recover those. I'll look at the output again, but you would be the one to know what is missing. Or, as TestDisk step-by-step says, a duplicate partition is also a clue; or overlapping partitions.

                          Shall I continue with the recovery options?
                          Why not! :-) See what it sees, if nothing else.

                          This is a mystery. Could Windows have made some kind of hybrid MBR? who knows.

                          The other thing, as we've discussed, are hardware issues, which again, you would see on your end, like a stuttering power supply, fans not turning, strange clicking noises, an open fire inside the case .... However, you have run live CD/DVDs on the "bad" laptop without problems.
                          An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                          Comment


                            #73
                            fdisk sees it in a way that makes sense: as one partition covering the entire drive; thus, fdisk won't be tempted to mess with it (as it appears to be a GPT, not an MBR).
                            So gdisk is the tool to use, but, as we know, gdisk isn't seeing it the way we'd like.

                            Maybe the partition table header and/or the partition table IS messed up, in the GPT, which, maybe gdisk will fix.
                            An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                            Comment


                              #74
                              Your TesDisk output:
                              Code:
                              Disk /dev/sda - 500 GB / 465 GiB - CHS 7600 255 63     Partition               Start        End    Size in sectors
                              >P MS Data                   171264     296703     125440 [WINRETOOLS]
                               P MS Data                   296704   62838783   62542080 [OS]
                               P MS Data                 62838784   62953983     115200
                               P Linux Swap              62953984   65203965    2249982
                               P MS Data                 65203968   72703999    7500032
                               P MS Data                 72704000  118788351   46084352
                               P MS Data                118788352  118877951      89600
                               P MS Data                118877952  122096389    3218438 [PBR Image]
                              I don't see any duplicates or overlaps. Looks OK, assuming the list is exhaustive.

                              Let me look at the rest of you above post now ...
                              An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                              Comment


                                #75
                                Originally posted by Qqmike View Post
                                Running gdisk to explore this ...


                                Command (? for help): ?
                                b back up GPT data to a file
                                c change a partition's name

                                d delete a partition

                                i show detailed information on a partition
                                l list known partition types n add a new partition o create a new empty GUID partition table (GPT)
                                p print the partition table
                                q quit without saving changes
                                r recovery and transformation options (experts only)
                                s sort partitions
                                t change a partition's type code
                                v verify disk w write table to disk and exit
                                x extra functionality (experts only)<--I'm not sure about this one ... ? ? print this menu

                                It's been quite awhile since I ran gdisk, but the entries in red are the ones you'd use to explore this. r:recovery is the one that gets real serious! be careful there. I can't remember x. v is harmless.
                                When I try these options, here is what I get:

                                Code:
                                kubuntu@kubuntu:~$ sudo gdisk GPT fdisk (gdisk) version 0.8.7
                                
                                
                                Type device filename, or press <Enter> to exit: /dev/sda
                                Partition table scan:
                                  MBR: protective
                                  BSD: not present
                                  APM: not present
                                  GPT: not present
                                
                                
                                Creating new GPT entries.
                                
                                
                                Command (? for help):[COLOR=#FF0000] i[/COLOR]
                                No partitions
                                
                                
                                Command (? for help): [COLOR=#FF0000]p[/COLOR]
                                Disk /dev/sda: 122096646 sectors, 465.8 GiB
                                Logical sector size: 4096 bytes
                                Disk identifier (GUID): 85F1F2E4-D93B-444F-9DE8-C4B1866B5681
                                Partition table holds up to 128 entries
                                First usable sector is 6, last usable sector is 122096640
                                Partitions will be aligned on 256-sector boundaries
                                Total free space is 122096635 sectors (465.8 GiB)
                                
                                
                                Number  Start (sector)    End (sector)  Size       Code  Name
                                
                                
                                Command (? for help):[COLOR=#FF0000] v[/COLOR]
                                
                                
                                No problems found. 122096635 free sectors (465.8 GiB) available in 1
                                segments, the largest of which is 122096635 (465.8 GiB) in size.

                                Comment

                                Working...
                                X