b31e [Solved] Upgrade 8.2 -> 9.0 : Boot partition table corrupt ? - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Base System > Installing & Upgrading

Installing & Upgrading Installing and upgrading FreeBSD.

Reply
 
Thread Tools Display Modes
  #1  
Old January 14th, 2012, 13:40
ericmacmini ericmacmini is offline
Junior Member
 
Join Date: Jan 2011
Location: Utrecht, the Netherlands
Posts: 34
Thanks: 1
Thanked 7 Times in 7 Posts
Default Upgrade 8.2 -> 9.0 : Boot partition table corrupt ?

After some struggle I managed to finish the upgrade from R8.2 to R9.0 process.

Adding the following option line in /etc/loader.conf was the main thing....
Code:
kern.geom.part.check_integrity="0"
I am using gmirror, but with gpart show I have following problem:

Code:
=>       63  976773104  mirror/gm0  MBR  (465G) [CORRUPT]
         63  976773105           1  freebsd  [active]  (465G)

=>        0  976773105  mirror/gm0s1  BSD  (465G)
          0    2097152             1  freebsd-ufs  (1.0G)
    2097152    2097152             2  freebsd-swap  (1.0G)
    4194304   10485760             4  freebsd-ufs  (5.0G)
   14680064    4194304             5  freebsd-ufs  (2.0G)
   18874368  957898737             6  freebsd-ufs  (456G)
I tried:

Code:
sudo /sbin/gpart bootcode -b /boot/pmbr mirror/gm0
gpart: table 'mirror/gm0' is corrupt: Operation not permitted
What's the best way to correct the partition table ? Thanks in advance

I filed an official Problem Report, because it's probably not so easy....

Last edited by ericmacmini; January 15th, 2012 at 17:04. Reason: filed a Problem Report
Reply With Quote
  #2  
Old January 17th, 2012, 19:44
varda varda is offline
Junior Member
 
Join Date: Mar 2009
Posts: 95
Thanks: 1
Thanked 19 Times in 19 Posts
Default

You're doing something wrong by trying to place pmbr (gpt boot loader) on device in use and labeled as MBR. Probably you need first to backup data. Then step by step remove BSD labels, then MBR partition. And only then partition it to GPT.

Also there always will be conflict because GPT stores it secondary backup table at the last block of disk. And GEOM sheme places own metadata at the last block of storage device.

You need first to create GEOM device on physical drive (in your case gmirror) and then divide this created device with gpart. gm0 --> gpart. Then there will be gmirror metada on last sector of targeted drive and GPT backup table on last block of gmirror.

Also you will get every boot complains from boot loader that there's no secondary GPT table. But everything will work.

You've been warned.
Reply With Quote
  #3  
Old January 17th, 2012, 21:06
wblock@'s Avatar
wblock@ wblock@ is offline
Moderator
 
Join Date: Sep 2009
Location: Milky Way galaxy
Posts: 7,714
Thanks: 432
Thanked 1,759 Times in 1,457 Posts
Default

Quote:
Originally Posted by varda View Post
You're doing something wrong by trying to place pmbr (gpt boot loader) on device in use and labeled as MBR. Probably you need first to backup data. Then step by step remove BSD labels, then MBR partition. And only then partition it to GPT.

Also there always will be conflict because GPT stores it secondary backup table at the last block of disk. And GEOM sheme places own metadata at the last block of storage device.

You need first to create GEOM device on physical drive (in your case gmirror) and then divide this created device with gpart. gm0 --> gpart. Then there will be gmirror metada on last sector of targeted drive and GPT backup table on last block of gmirror.
While I have not heard of data loss from that layout, it's possible. And of course you lose the ability to restore the GPT table. Visually:

Quote:
Also you will get every boot complains from boot loader that there's no secondary GPT table.
Yes, because GPT, by definition, puts the backup partition table at the end of the drive. So a neater way to do this is to use gpart(8) to create identical partitions on two drives, then use gmirror(8) to mirror those. Since GEOM does not put its metadata at the end of the drive but at the end of the logical device it creates, it will leave the GPT backup table alone.

gmirror With Disk Partitions shows creating a split-filesystem layout with a mirror for each filesystem. Creating one big filesystem like FreeBSD-9 does by default is the same, only simpler.
Reply With Quote
Reply

Tags
gpart, mbr

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I restore the original mbr? srivo Storage 3 January 2nd, 2012 16:43
reinstall MBR Hanzo General 13 November 8th, 2011 01:53
[Solved] convert OpenBSD mbr to FreeBSD mbr with FreeBSD boot manager sidney6 Installing & Upgrading 2 July 18th, 2011 23:43
[Solved] Upgrade to 8.2 - GPT became corrupt? CumpsD Installing & Upgrading 14 April 3rd, 2011 08:47
mbr lumiwa Installing & Upgrading 5 December 10th, 2009 00:16


All times are GMT +1. The time now is 21:49.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0