1b6f4
![]() |
|
|
|
|
|||||||
| Installing & Upgrading Installing and upgrading FreeBSD. |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Yesterday I tried to do a binary upgrade to 8.2-RELEASE (using freebsd-update), coming from 8.1-RELEASE-p2. The upgrade process went fine, up until the point I rebooted using the GENERIC kernel (nextboot -k GENERIC).
After rebooting, I was unable to mount my root filesystem. After some searching I found this to be the cause: Code:
GEOM: mirror/gm0: corrupt or invalid GPT detected. GEOM: mirror/gm0: GPT rejected -- may not be recoverable However, something I had on my old kernel was this: Code:
GEOM_MIRROR: Device mirror/gm0 launched (2/2). GEOM: mirror/gm0: the secondary GPT table is corrupt or invalid. GEOM: mirror/gm0: using the primary only -- recovery suggested. Now I'm at a loss. I didn't change anything (shown from the fact my old kernel still boots), but the new GENERIC stops at the GPT part. I know 8.2 did some stuff for GPT, but I don't understand how it goes from "recovery suggested" to plain "corrupt and I will refuse to boot". This is how I partitioned my disk (I'm new to FreeBSD and used one big root partition, sorry) Code:
[root@cc001 ~/gptbackup]# gpart show /dev/mirror/gm0
=> 34 156301421 mirror/gm0 GPT (75G)
34 128 1 freebsd-boot (64K)
162 1886 - free - (943K)
2048 8388608 2 freebsd-swap (4.0G)
8390656 147910799 3 freebsd-ufs (71G)
Code:
[root@cc001 ~/gptbackup]# gmirror status
Name Status Components
mirror/gm0 COMPLETE ad4
ad6
Would appreciate if anyone had an idea how I can manage to boot using the 8.2 GENERIC so I can finish the upgrade process
Last edited by DutchDaemon; February 28th, 2011 at 00:03. Reason: proper formatting: http://forums.freebsd.org/showthread.php?t=8816 |
|
#2
|
|||
|
|||
|
If you partitioned your disk before setting up the mirror, then GPT will have placed its secondary header in the last sector of the disk.
When you then set up a gmirror, it will have stored its metadata also in the last sector of the disk, clobbering the secondary GPT header. In 8.1, GPT header checksumming wasn't fully implemented, but it is now in 8.2 which is probably why you're now seeing complaints about corruption. The solution is to create your mirror from the raw disks, BEFORE partitioning the resulting gmirror device. You'll notice that the gmirror device is one sector smaller than the two disks it's made from because it hides it's own metadata sector. When GPT puts its secondary header at the end of the mirror device, it'll actually end up on the second from last sector of the physical disks. Then, gmirror metadata and GPT secondary header won't trample all over eachother.
__________________
http://www.b0rken.org/ |
|
#3
|
|||
|
|||
|
Yes, I partitioned it before the mirror :/
Is it possible to repartition my current disks *without* losing any data on it? My guess I came up with while thinking about it today, after reading your answer: - I need to boot using fixit mode - Somehow remove the current partitioning scheme from the mirror - Break up the mirror - Check if the harddisks itself don't have any partitioning left - Restore the mirror - Repartition the mirror, using the same sectors as before - Data magically was saved? ![]() What's the safe way to go about this making sure I can keep everything I got on the disks right now? |
|
#4
|
|||
|
|||
|
In the same situation, I'd try the following:
Note that this is just off the top of my head. There may well be problems I haven't thought of with this process.
__________________
http://www.b0rken.org/ Last edited by jem; February 28th, 2011 at 09:15. |
|
#5
|
|||
|
|||
|
I'm halfway there
Just got one last question I'm unsure about (found different sources using different statements)When you say "install bootblocks", would this do? gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 mirror/gm0 Or do I need different switches? Last edited by DutchDaemon; February 28th, 2011 at 00:03. Reason: proper formatting: http://forums.freebsd.org/showthread.php?t=8816 |
|
#6
|
||||
|
||||
|
CumpsD, use proper formatting, thanks.
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki Before you post: How to ask questions the smart way If you must know .. So, what does an Administrator/Moderator do? ---> Do not PM me with FreeBSD questions. I do not work here. <--- |
|
#7
|
|||
|
|||
|
Quote:
When you attempt to test booting from your new mirror, you'll probably need to use your BIOS's boot menu to boot from your second disk (ad6). I'd strongly advise having the memstick image written to a USB flash drive to aid in recovery if something goes wrong.
__________________
http://www.b0rken.org/ Last edited by jem; February 28th, 2011 at 11:55. |
|
#8
|
|||
|
|||
|
Yes, I did it with the new mirror, but due to some mistakes on my side, gm0 was my new (and only) mirror
![]() I accidentally (don't ask how), managed to not be able to boot into my old mirror anymore, so I went in with a livecd and fixit, broke up the mirror, repartitioned ad6 with the above partition table, and booted into it (after changing the bios to boot from ad6). By miracle it worked, I learned a lot by doing this (But was scared everything was lost sometimes :p)Then I recreated the mirror with ad4 in it, and partitioned the mirror device (gm0), I installed the bootcode using the above command, and restored ad6 to gm0 and rebooted. Which worked! ![]() Right now I'm adding ad4 to the mirror as well, which should have it back into the same condition. However, and this is something that I'm worried about, when I booted, just before I got the options menu (normal boot, safe mode, single user, etc..) I noticed a warning about an invalid backup GPT header. So I'm afraid I'll have the same problems all over again I'll be able to tell in a few, when the mirror is restored and I'll reboot (using the old 8.1 kernel first to see if I get any GPT complaints) *fingers crossed* Last edited by DutchDaemon; February 28th, 2011 at 20:07. |
|
#9
|
|||
|
|||
|
No, don't worry about that initial message about an invalid backup header.
When FreeBSD first starts booting it is accessing a single disk directly, not a mirror device, as it hasn't loaded the geom_mirror module yet. Because you created your GPT partitioning on the mirror device, the secondary GPT header is on the second from last sector of the physical disk. GPT considers that a problem and complains about it. However, as soon as the gmirror module loads and the last sector of the disks (containing the gmirror metadata) are hidden from view, the secondary GPT header appears to be on the last sector of the gmirror device, which is OK.
__________________
http://www.b0rken.org/ Last edited by jem; February 28th, 2011 at 20:24. |
|
#10
|
|||
|
|||
|
Indeed, the only GPT warning was during boot, but nothing in dmesg anymore, sounds good. Now to try the 8.2 GENERIC
![]() (Sorry DutchDaemon, I kept an eye out but missed the formatting of devices) |
|
#11
|
||||
|
||||
|
On the -stable mailing list right now, there's a discussion about this very issue. There appears to be a bug in the way GEOM tastes different providers, with the GPART class overriding the GMIRROR class. Or, at least with the way the gptboot code does the GEOM tasting.
The best way to describe the issue is like so: Here's the entire disk before you do anything to it: Code:
----------------------------- | ad0 | ----------------------------- Code:
----------------------------- | ad0 |MD| ----------------------------- | gm0 | -------------------------- Code:
----------------------------- | ad0 |MD| ----------------------------- |GPT| gm0 |GPT| -------------------------- | gpt/p1 | ---------------------- The problem comes when you boot, and the GPTBOOT codes tastes the ad0 GEOM provider. It sees the GPT in the first sector of the disk (which is also the first sector of gm0, and the first sector of gpt/p1), and then automatically looks in the last sector of the disk (ad0) for the secondary GPT ... and finds the gmirror meta-data instead. Thus, it complains about a corrupt secondary GPT. There's no fix as yet. |
| The Following User Says Thank You to phoenix For This Useful Post: | ||
jb_fvwm2 (March 1st, 2011) | ||
|
#12
|
|||
|
|||
|
Ah, thanks for the explanation.
I'm happy it works now, overjoyed Now rebuilding my ports, kernel and I'm up and running again, ready for the next challenge, trying to freebsd-update my jails ![]() Thanks for the great help all! |
|
#13
|
|||
|
|||
|
(Can't edit my last reply, nor the first, not long enough here yet, but if someone could mark it as solved? Thanks)
|
|
#14
|
|||
|
|||
|
Quote:
__________________
http://www.b0rken.org/ |
|
#15
|
|||
|
|||
|
Hello,
I am new Free/PC-BSD user (just migrated from Linux after using it since '99) and your post saved me some more hours of troubleshooting while I was fighting with 9.0 PC-BSD snapshot install and decided to use just one HD. Quote:
I've two identical hard drives and the first one has small UFS /boot, swap and the rest is ZFS tank with {/,/usr,/var}. How to proceed? Last edited by DutchDaemon; April 3rd, 2011 at 22:35. |
![]() |
| Tags |
| boot problem, freebsd-update, generic, gmirror, gpt |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Solved] metadata corrupt ?! | nORKy | Installation and Maintenance of FreeBSD Ports or Packages | 29 | December 15th, 2011 01:10 |
| ZFS GEOM: mfid1: corrupt or invalid GPT detected | nbari | General | 8 | September 7th, 2011 08:39 |
| snapshot is corrupt | SeaHag | Installation and Maintenance of FreeBSD Ports or Packages | 1 | February 6th, 2010 08:56 |
| migrating zfs from opensolaris to freebsd (corrupt gpt) | trash | Installing & Upgrading | 2 | October 16th, 2009 15:50 |
| GEOM: adX: the secondary GPT table is corrupt or invalid | FestusHagen | General | 6 | June 14th, 2009 06:24 |