# Migrating MBR to GPT with gmirror and raidz1



## eyescream (Jan 26, 2012)

Hello,

I recently updated to FreeBSD 9.0-RELEASE and as per the release notes I disabled the integrity check for my mirror so my system would boot. Now, I would either like to migrate to GPT or restore the integrity of my mirror and keep my MBR setup but I don't know what the best way to do that would be in my particular case. So my question is how do I best set up my mirror again using gmirror? And will that have any effect on my zpool or can that stay in place?

My current setup is as follows:

`$ gpart show`

```
=>       63  976773105  ada0  MBR  (465G)
         63   65010897     1  freebsd  [active]  (31G)
   65010960    2797200     2  freebsd  (1.3G)
   67808160  908965008     3  freebsd  (433G)

=>      0  2797200  ada0s2  BSD  (1.3G)
        0  2797200       2  freebsd-swap  (1.3G)

=>       63  976773105  ada1  MBR  (465G)
         63   65010897     1  freebsd  [active]  (31G)
   65010960    2797200     2  freebsd  (1.3G)
   67808160  908965008     3  freebsd  (433G)

=>       63  976773105  ada2  MBR  (465G)
         63   65010897     1  freebsd  [active]  (31G)
   65010960    2797200     2  freebsd  (1.3G)
   67808160  908965008     3  freebsd  (433G)

=>      0  2797200  ada1s2  BSD  (1.3G)
        0  2797200       2  freebsd-swap  (1.3G)

=>      0  2797200  ada2s2  BSD  (1.3G)
        0  2797200       2  freebsd-swap  (1.3G)

=>       0  65010896  mirror/gm0s1  BSD  (31G) [CORRUPT]
         0  10485760             1  freebsd-ufs  (5.0G)
  10485760   8388608             4  freebsd-ufs  (4.0G)
  18874368   4194304             5  freebsd-ufs  (2.0G)
  23068672  41942225             6  freebsd-ufs  (20G)
```

`$ gpart status`

```
Name   Status  Components
       ada0s1       OK  ada0
       ada0s2       OK  ada0
       ada0s3       OK  ada0
      ada0s2b       OK  ada0s2
       ada1s1       OK  ada1
       ada1s2       OK  ada1
       ada1s3       OK  ada1
       ada2s1       OK  ada2
       ada2s2       OK  ada2
       ada2s3       OK  ada2
      ada1s2b       OK  ada1s2
      ada2s2b       OK  ada2s2
mirror/gm0s1a  CORRUPT  mirror/gm0s1
mirror/gm0s1d  CORRUPT  mirror/gm0s1
mirror/gm0s1e  CORRUPT  mirror/gm0s1
mirror/gm0s1f  CORRUPT  mirror/gm0s1
```

`$ zpool status`

```
NAME        STATE     READ WRITE CKSUM
	tank        ONLINE       0     0     0
	  raidz1-0  ONLINE       0     0     0
	    ada0s3  ONLINE       0     0     0
	    ada1s3  ONLINE       0     0     0
	    ada2s3  ONLINE       0     0     0
```

`$ cat /etc/fstab`

```
# Device		Mountpoint	FStype	Options		Dump	Pass#
/dev/ada0s2b		none		swap	sw		0	0
/dev/ada1s2b		none		swap	sw		0	0
/dev/ada2s2b		none		swap	sw		0	0
/dev/mirror/gm0s1a		/		ufs	rw		1	1
/dev/mirror/gm0s1e		/tmp		ufs	rw		2	2
/dev/mirror/gm0s1f		  /usr		ufs	rw		2	2
/dev/mirror/gm0s1d		/var		ufs	rw		2	2
#/dev/acd0		/cdrom		cd9660	ro,noauto	0	0
linsys			/usr/compat/linux/sys	linsysfs	rw	0	0
linproc			/usr/compat/linux/proc	linprocfs	rw	0	0
```

I found this very nice how to in another thread. Could I just leave my zpool in place and create the rest of the partitions as described there?


----------



## wblock@ (Jan 27, 2012)

I would avoid mixing in any more technologies than necessary.  ZFS can probably do the same RAID configuration natively.  (It might not be wise to mix GEOM stuff with ZFS, but I don't know.)


----------

