2.1-Beta1 upgrading: gpart: table 'ad0' is corrupt



  • Hi,
    I have an error while upgrading 2.1-Beta1 to 2.1.
    In the upgrade log i get the following error (the complete log is attached)

    gpart set -a active -i 2 ad0
    gpart: table 'ad0' is corrupt: Operation not permitted
    

    When I try to switch the slice via Dignastic -> NanoBSD it does not work. I'm allways on slice ad0s1.
    Via ssh shell I get the following output:

    [2.1-BETA1][admin@pfsense.home]/root(1): /etc/rc.nanobsd_switch_boot_slice 
    Boot slice  : ad0s1 (pfsense0)
    Active slice: ad0s1
    
    Switching active slice...gpart: table 'ad0' is corrupt: Operation not permitted
    Done.
    
    Boot slice  : ad0s1 (pfsense0)
    Active slice: ad0s1
    
    [2.1-BETA1][admin@pfsense.home]/root(5): gpart show
    =>     63  3906497  ad0  MBR  (1.9G) [CORRUPT]
           63  1902033    1  freebsd  [active]  (928M)
      1902096       63       - free -  (31k)
      1902159  1902033    2  freebsd  (928M)
      3804192   102816    3  freebsd  (50M)
    
    =>      0  1902033  ad0s1  BSD  (928M)
            0       16         - free -  (8.0k)
           16  1890929      1  !0  (923M)
      1890945    11088         - free -  (5.4M)
    
    =>      0  1902033  ad0s2  BSD  (928M)
            0       16         - free -  (8.0k)
           16  1890929      1  !0  (923M)
      1890945    11088         - free -  (5.4M)
    
    [2.1-BETA1][admin@pfsense.home]/root(6): gpart status ad0
     Name   Status  Components
    ad0s1  CORRUPT  ad0
    ad0s2  CORRUPT  ad0
    ad0s3  CORRUPT  ad0
    
    

    Is it possible to fix this error? I'm familiar with linux but not with freebsd :)

    Greetings
    schirrmie
    upgrade.txt


  • Banned

    Re-image, restore the config.



  • Yes, but I was hopping to solve this issue so I not must open the hardware, etc. :(
    Maybe another one have some hints.

    Greetings
    schirrmie


  • Banned

    Yeah, unscrewing the screws would take about 5 minutes. People, for Christ sake, you have a corrupt partition table and you are going to trust this thing as firewall instead of fixing things properly just because you'd have to "open the hardware"? Bad joke, really.  ::)



  • This really is a nasty error. If I was using this on a production firewall, I would want to start again with a new CF card.
    Then rewrite the old CF card, and if that seems to work OK, use it in a test or home system that is not critical. (and somehow remember which CF card that had this problem, so that if it repeats you will know to bin the CF card.)
    I can't think of a way to get out of this without at least re-imaging the CF card.



  • For my other prouction NanoBSD firewall, I'm going to image a fresh 2.1 install on a separate piece of hardware, install the packages manually, and replace config file as a last step.

    Actually I'm going to plug in a new CF card in the production hardware during a short power off. This will ensure minimum downtime risk!



  • @doktornotor:

    Yeah, unscrewing the screws would take about 5 minutes. People, for Christ sake, you have a corrupt partition table and you are going to trust this thing as firewall instead of fixing things properly just because you'd have to "open the hardware"? Bad joke, really.  ::)

    doktornotor, this is not a bad joke. This happened to me again when trying to upgrade from 2.1 to 2.1.2.

    "Re-image, restore the config" - it's not only 5 minutes. You have to start everything from scratch: carry a monitor to the device (if it's a VGA-based image) or a serial console, re-assign the interfaces during boot-up, connect with a dummy laptop and perform that stupid web-wizard step by step all uselessly, until you finally reach to the point you're able to restore a config file. And afterwards you still need to re-assign the interfaces (even if they were properly assigned before, it asks you to do it again), and then you have to reboot. Even between friends, this takes more than 30 minutes… that's a half an hour of downtime.

    What I usually do in cases like this (and not only in cases like this, but mostly, as I hate upgrades, preferring fresh installs), is to copy the config to the image file first, and flash afterwards. That requires downtime for only the time of changing the card in the slot + boot.

    But this is pretty advanced, and most important - unsupported way to do it...


  • Rebel Alliance Developer Netgate


Log in to reply