Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

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

    Scheduled Pinned Locked Moved Problems Installing or Upgrading pfSense Software
    8 Posts 5 Posters 4.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      schirrmie
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • D
        doktornotor Banned
        last edited by

        Re-image, restore the config.

        1 Reply Last reply Reply Quote 0
        • S
          schirrmie
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • D
            doktornotor Banned
            last edited by

            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.  ::)

            1 Reply Last reply Reply Quote 0
            • P
              phil.davis
              last edited by

              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.

              As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
              If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

              1 Reply Last reply Reply Quote 0
              • R
                robi
                last edited by

                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!

                1 Reply Last reply Reply Quote 0
                • R
                  robi
                  last edited by

                  @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...

                  1 Reply Last reply Reply Quote 0
                  • jimpJ
                    jimp Rebel Alliance Developer Netgate
                    last edited by

                    There's a bigger thread already for this same issue here:
                    https://forum.pfsense.org/index.php?topic=75069.0

                    You can try some of the suggestions posted there:
                    https://forum.pfsense.org/index.php?topic=75069.msg410804#msg410804
                    https://forum.pfsense.org/index.php?topic=75069.msg411077#msg411077
                    https://forum.pfsense.org/index.php?topic=75069.msg410819#msg410819

                    Post results in the other thread, locking this one.

                    Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                    Need help fast? Netgate Global Support!

                    Do not Chat/PM for help!

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.