Page 3 of 7 FirstFirst 12345 ... LastLast
Results 21 to 30 of 61

Thread: GPT messed up, cant boot or access harddrive

  1. #21
    Join Date
    Jan 2014
    Beans
    45
    Distro
    Ubuntu

    Re: GPT messed up, cant boot or access harddrive

    So we replace the GPT with a MBR? Does that work and is it important for the existing data to either have GPT or MBR?

  2. #22
    Join Date
    Oct 2009
    Beans
    2,199
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: GPT messed up, cant boot or access harddrive

    Then edit "mbrtable" to look like this:
    Code:
    # partition table of /dev/sda
    unit: sectors
    
    /dev/sda1 : start=   280582, size=  1024000, Id=83
    /dev/sda2 : start=118786048, size=118317056, Id=83
    /dev/sda3 : start=186845208, size=126658688, Id=83
    /dev/sda4 : start=        0, size=        0, Id= 0
    This only chnages the table in the MBR, not the rest of the disk. This will make the disk appear to have 3 partitions: the linux boot and the two candidates for / or /home. This will not boot yet but we may be able to see what's there and then decide what to do next.

    Once you have edited mbrtable, write it back to the disk's MBR:
    Code:
    sudo sh -c "cat mbrtable | sfdisk /dev/sda"
    ASRock P67 Extreme6, Intel i5 2500K, 8GB RAM, nVidia 6600GT, 4x1TB RAID1+0

  3. #23
    Join Date
    Jan 2014
    Beans
    45
    Distro
    Ubuntu

    Re: GPT messed up, cant boot or access harddrive

    Thank you for the clarification. The data is of course most important to me. I dont really have a problem with setting up the system from scratch.


    I still cant read the table after deleting the GPT. But I'm not sure if I still have to read it, if I overwrite it with your information.

    Code:
    ubuntu@ubuntu:~$ sudo dd if=/dev/zero bs=512 count=1 seek=1 of=/dev/sda
    1+0 records in
    1+0 records out
    512 bytes (512 B) copied, 0.00112427 s, 455 kB/s
    ubuntu@ubuntu:~$ sudo sfdisk -d /dev/sda > mbrtable
    
    WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util sfdisk doesn't support GPT. Use GNU Parted.

  4. #24
    Join Date
    Oct 2009
    Beans
    2,199
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: GPT messed up, cant boot or access harddrive

    Deleting the GPT header means there is no chance of using the GPT partition table to recover your data. I am assuming this doesn't work anyhow. Instead, we can create an equivalent MBR partition table for the partitions that we believe are correct.

    The existing data doesn't care what sort of partition table exists except for the booting systems. These will be broken. However, they are already broken.

    As I indicated earlier, I think the disk is in a mangled state. So getting anything back off it will be lucky.

    However, if you wish to take the disk to, say, a professional recovery person then you should not write anything to it.
    ASRock P67 Extreme6, Intel i5 2500K, 8GB RAM, nVidia 6600GT, 4x1TB RAID1+0

  5. #25
    Join Date
    Oct 2009
    Beans
    2,199
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: GPT messed up, cant boot or access harddrive

    It may be that sfdisk now looks for the backup GPT table at the end of the disk. It has been a while since I've done this.
    While I look this up, try writing the new MBR table to the disk.
    ASRock P67 Extreme6, Intel i5 2500K, 8GB RAM, nVidia 6600GT, 4x1TB RAID1+0

  6. #26
    Join Date
    Oct 2009
    Beans
    2,199
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: GPT messed up, cant boot or access harddrive

    Try
    Code:
    sudo hdparm -z /dev/sda
    before using sfdisk. This causes the kernel to re-read the disk partition table.
    ASRock P67 Extreme6, Intel i5 2500K, 8GB RAM, nVidia 6600GT, 4x1TB RAID1+0

  7. #27
    Join Date
    Jan 2014
    Beans
    45
    Distro
    Ubuntu

    Re: GPT messed up, cant boot or access harddrive

    I'm sorry. I'm totally fine with what you suggest, I was just a little irritated with the whole GPT/MBR stuff and wanted to be sure.

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

    I used the mbrtable that you gave me and sfdisk is giving me the following error:

    Code:
    ubuntu@ubuntu:~$ sudo sh -c "cat mbrtable | sfdisk /dev/sda"
    Checking that no-one is using this disk right now ...
    OK
    
    Disk /dev/sda: 15566 cylinders, 255 heads, 63 sectors/track
    Old situation:
    Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
    
       Device Boot Start     End   #cyls    #blocks   Id  System
    /dev/sda1          0+     17-     18-    140290+  ee  GPT
    /dev/sda2       2192+   4280-   2089-  16777347   af  HFS / HFS+
    /dev/sda3         17+     81-     64-    512000   83  Linux
    /dev/sda4       1002+   1003-      1-      3087    7  HPFS/NTFS/exFAT
    Warning: given size (126658688) exceeds max allowable size (0)
    
    sfdisk: bad input

  8. #28
    Join Date
    Jan 2014
    Beans
    45
    Distro
    Ubuntu

    Re: GPT messed up, cant boot or access harddrive

    Quote Originally Posted by YesWeCan View Post
    Try
    Code:
    sudo hdparm -z /dev/sda
    before using sfdisk. This causes the kernel to re-read the disk partition table.
    Will try that now, forget the post before this one

  9. #29
    Join Date
    Jan 2014
    Beans
    45
    Distro
    Ubuntu

    Re: GPT messed up, cant boot or access harddrive

    Ok hdparm worked well. sfdisk is giving the same error as two posts before

  10. #30
    Join Date
    Oct 2009
    Beans
    2,199
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: GPT messed up, cant boot or access harddrive

    Ok, the size of the last partition is too big for the size of the disk. I copied the size from the dodgy GPT table! The last sector on the disk is 268435455 so I reckon the size of sda3 should be no more than 81590248 (39GiB).
    Try this table:
    Code:
    # partition table of /dev/sda
    unit: sectors
    /dev/sda1 : start=   280582, size=  1024000, Id=83
    /dev/sda2 : start=118786048, size=118317056, Id=83
    /dev/sda3 : start=186845208, size= 81590248, Id=83
    /dev/sda4 : start=        0, size=        0, Id= 0
    ASRock P67 Extreme6, Intel i5 2500K, 8GB RAM, nVidia 6600GT, 4x1TB RAID1+0

Page 3 of 7 FirstFirst 12345 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •