1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

gptboot: invalid backup gtp header

Discussion in 'Installing and Upgrading FreeBSD' started by bsdnews, Mar 3, 2012.

  1. bsdnews

    bsdnews New Member

    Messages:
    9
    Likes Received:
    0
    Hi all,

    So as I said in my self-introduction, I have installed FreeBSD yesterday on an external HDD in order to use it on my laptop.
    The installation was good; I used the entire disk (931 GB : 64kb as boot partition, 927GB FreeBSD-UFS and 4GB FreeBSD-swap). At start time, when I want to launch FreeBSD I have this message:
    Code:
    gptboot: invalid backup gtp header
    I try to reinstall FreeBSD and clean GTP with gdisk but it doesn’t work.
    What can I do?
    Thanks to all
     
  2. Morte

    Morte New Member

    Messages:
    45
    Likes Received:
    0
    I'd probably start with manually clearing the GPT partition data using
    dd if=/dev/zero of=/dev/{drive} bs=1m count=10
    Or something to that effect. To truly clear the old GPT data, you have to clear the back of the drive as well. I'm not sure on a good way to calculate how to skip most of the drive data (usually I just guess until I get close enough).

    During the install process, you may want to use the manual partitioning system and try MBR instead of GPT and see if that works for you.
     
  3. wblock@

    wblock@ Administrator Staff Member Administrator Moderator Developer

    Messages:
    11,165
    Likes Received:
    7
    gpart(8) has commands to destroy and recover GPT partition tables. Too little information given to tell why the backup GPT table was corrupted.
     
  4. bsdnews

    bsdnews New Member

    Messages:
    9
    Likes Received:
    0
    Hi,

    Thanks a lot for your answers. So I try to use dd, but it doesn't change anything, I still have this message. I will try to use MBR instead of GPT (I will seek how to do it). About my configuration, so I have my internal HDD (ad0) on which I have Fedora and Ubuntu, I have the MBR here and I'm using Grub2. FreeBSD is installed on an external HDD (hd0). Gdisk says that I have:
    Code:
    Partition table scan:
      MBR: protective
      BSD: not present
      APM: not present
      GPT: present
    
    Code:
    Disk /dev/sdf: 1953468416 sectors, 931.5 GiB
    Logical sector size: 512 bytes
    Disk identifier (GUID): 02220102-65EB-11E1-9830-485D609AB9A9
    Partition table holds up to 128 entries
    First usable sector is 34, last usable sector is 1953468382
    Partitions will be aligned on 8-sector boundaries
    Total free space is 1019837 sectors (498.0 MiB)
    
    Number  Start (sector)    End (sector)  Size       Code  Name
       1              34             161   64.0 KiB    A501  
       2             162      1944059937   927.0 GiB   A503  
       3      1944059938      1952448545   4.0 GiB     A502  
    
    Code:
    Disk size is 1953468416 sectors (931.5 GiB)
    MBR disk identifier: 0x00000000
    MBR partitions:
    
    Number  Boot  Start Sector   End Sector   Status      Code
       1      *              1   1953468415   primary     0xEE
    
    Does that help you?
     
  5. wblock@

    wblock@ Administrator Staff Member Administrator Moderator Developer

    Messages:
    11,165
    Likes Received:
    7
    It would be more helpful to see what gpart(8) says about that disk. One guess would be something changed after the install that wiped out the secondary GPT table, like one of the GEOM modules for mirroring or striping or encryption.
     
  6. bsdnews

    bsdnews New Member

    Messages:
    9
    Likes Received:
    0
    Hi,

    Sorry it took me all the night to have this information. Here is the scan of gpart:

    Code:
    gpart /dev/sdb
    
    Begin scan...
    End scan.
    
    Checking partitions...
    Ok.
    
    Guessed primary partition table:
    Primary partition(1)
       type: 000(0x00)(unused)
       size: 0mb #s(0) s(0-0)
       chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r
    
    Primary partition(2)
       type: 000(0x00)(unused)
       size: 0mb #s(0) s(0-0)
       chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r
    
    Primary partition(3)
       type: 000(0x00)(unused)
       size: 0mb #s(0) s(0-0)
       chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r
    
    Primary partition(4)
       type: 000(0x00)(unused)
       size: 0mb #s(0) s(0-0)
       chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r
    
     
  7. wblock@

    wblock@ Administrator Staff Member Administrator Moderator Developer

    Messages:
    11,165
    Likes Received:
    7
    Actually, I meant the FreeBSD gpart(8), after booting into FreeBSD. The output above looks like it's from Linux (sdb) and also looks like it's finding the partition table empty.
     
  8. bsdnews

    bsdnews New Member

    Messages:
    9
    Likes Received:
    0
    Sorry, I misunderstand but with my issue I can't boot on FreeBSD. Indeed I just see this screen and I can do nothing (I can just reboot).
     
  9. wblock@

    wblock@ Administrator Staff Member Administrator Moderator Developer

    Messages:
    11,165
    Likes Received:
    7
    Well, there's mfsBSD. But it might be quicker just to try an MBR setup.
     
  10. bsdnews

    bsdnews New Member

    Messages:
    9
    Likes Received:
    0
    Well thanks to you all is install (I'm using the MBR now):
    Code:
    ad0: 931 MBR
     adOa 931 BSD
      adOa1 900  FreeBSD-ufs /
      adOa2 4     FreeBSD-swap none
      adOa3 10   FreeBSD /var
      adOa4 7    FreeBSD /tmp
      adOa5 10  FreeBSD /usr
      
    I follow your howto but unfortunatly I have this message now:
    Code:
    Guessed BIOS device 0×ffffffffff not found by probes, defaulting to disk0. Can't load 'kernel'
    What should I do?
     
  11. bsdnews

    bsdnews New Member

    Messages:
    9
    Likes Received:
    0
    I forgot to say that I have this message when I'm booting on my external DD where FreeBSD is.
    (In order to boot on it, I'm selecting the DD in my BIOS, I haven't yet configure my GRUB2 for launching FreeBSD)
     
  12. wblock@

    wblock@ Administrator Staff Member Administrator Moderator Developer

    Messages:
    11,165
    Likes Received:
    7
  13. bsdnews

    bsdnews New Member

    Messages:
    9
    Likes Received:
    0
    Hi, thanks I will read this page I hope I will understand and find something.
    I don't understand what happen. Indeed when I installed FreBSD for the first time it worked perfectly and now it's impossible to boot on it.
    I will try mfsBSD to see if it's work.

    (I'm sorry about my mistakes like the space or the I, english is not my mother tongue)
     
  14. wblock@

    wblock@ Administrator Staff Member Administrator Moderator Developer

    Messages:
    11,165
    Likes Received:
    7
    The output shown in #10 looks wrong. MBR partitions ("slices") have an "s": ada0s1. Also, FreeBSD 9 would call that device ada0 (not "ad0"). So it should be ada0s1a, ada0s1b, and so on. What that shows is the good old "dangerously dedicated" mode, which is not an MBR. Also, the filesystems should be type freebsd-ufs. That alone will not keep it from working, but it's good procedure.
     
  15. bsdnews

    bsdnews New Member

    Messages:
    9
    Likes Received:
    0
    Hi,

    Great news! I succeeded :)

    I have my FreeBSD on my external HDD and it works (I'm using it at this time). In fact, I tried to install PCBSD and it worked, so I tried a new installation of FreeBSD with GPT. I use the same configuration as in PCBSD, that is to say I have this configuration:
    Code:
    64KB freebsd-boot
    4GB freebsd-swap
    20GB freebsd-ufs /
    907GB freebsd-zfs
    
    I still have this message:
    Code:
    gptboot: invalid backup gtp header
    But now I can launch FreeBSD :) It's really great.

    Thanks a lot for your help.