# Problem with GEOM



## SomeUser (May 27, 2014)

Hello, I try to add kernel support GEOM, try compiling the kernel by adding the option 
	
	



```
options GEOM_MIRROR
```
 as a result of the system will not boot and shows invitation. If I add a new kernel support GEOM when you try to boot from this kernel, I see:

```
Trying to mount root from ufs:/dev/ada0p2 [rw]...
mountroot: waiting for device /dev/ada0p2...
Mounting from ufs:/dev/ada0p2 failed with error 19.

montroot>
```
When I enter "?" I see the device:


```
gm0, ada0, ada1
```

I try to boot from one of them, `ufs:/dev/ada0p2` or `ufs:/dev/gm0`

Result:  error 19.

Also I tried to load the module dynamically adding loader.conf line

```
geom_mirror_load = "YES"
```
but the result is the same, when you reboot, I see "mountroot>"

But with all this, if I try to `gmirror load` the module is successfully loaded (just checking that you can with the module).

```
Id Refs Address    Size     Name
 1    3 0xc0400000 1245098  kernel
 2    1 0xc858a000 15000    geom_mirror.ko
```

Result: When this option is enabled in the configuration Loader.Tsonf system is not loaded. When you add this option to the kernel, the system also is not loaded. Tried to connect and disconnect the second hard drive, the result in all cases is the same.

I don't know much about freebsd FreeBSD, I will be very grateful for tips / advice, if necessary, will show any output of commands.

`uname -a`

```
FreeBSD localhost 9.2-STABLE FreeBSD 9.2-STABLE #1 r265456: Sun May 11 15:16:35 UTC 2014     root@localhost:/usr/obj/usr/src/sys/GENERIC  i386
```
As always when the system boots I see on the screen.

```
gptboot: invalid backup GPT header
```


----------



## SirDice (May 27, 2014)

SomeUser said:
			
		

> Also I tried to load the module dynamically adding loader.tsonf line
> 
> ```
> geom_mirror_load = "YES"
> ```


The file is called /boot/loader.conf not loader.tsonf. And you need to remove the spaces:

```
geom_mirror_load="YES"
```


----------



## wblock@ (May 27, 2014)

A couple of things:

1.  The file name is /boot/loader.conf.
2.  Using GPT with gmirror(8) is not recommended.  The backup GPT table is overwritten by the gmirror(8) data, as shown above.  The Handbook shows how to set this up with MBR: RAID1 - Mirroring.


----------



## SomeUser (May 27, 2014)

SirDice said:
			
		

> SomeUser said:
> 
> 
> 
> ...



typo)





			
				wblock@ said:
			
		

> A couple of things:
> 
> 1.  The file name is /boot/loader.conf.
> 2.  Using GPT with gmirror(8) is not recommended.  The backup GPT table is overwritten by the gmirror(8) data, as shown above.  The Handbook shows how to set this up with MBR: RAID1 - Mirroring.



Thank you! I heard about it! I understand GPT is a table with information on all sections of my system? also very strange that the kernel at all going to first notify about problemmu using GPT... I have hope will solve this problem without reinstalling system?


----------



## wblock@ (May 27, 2014)

GPT is a newer and better partitioning scheme.  It puts a partition table at the beginning of the disk, and a backup copy of that table at the end.  Unfortunately, the end of the disk is where gmirror(1) puts its metadata also, and overwrites that backup table.

The boot loader checks the consistency of the GPT tables, and complains if they don't match.

Another way around this is to use ZFS with a ZFS mirror.  Generally, this will use more memory, but it is safer due to data integrity measures.


----------



## SomeUser (May 27, 2014)

wblock@ said:
			
		

> GPT is a newer and better partitioning scheme.  It puts a partition table at the beginning of the disk, and a backup copy of that table at the end.  Unfortunately, the end of the disk is where gmirror(1) puts its metadata also, and overwrites that backup table.
> 
> The boot loader checks the consistency of the GPT tables, and complains if they don't match.
> 
> Another way around this is to use ZFS with a ZFS mirror.  Generally, this will use more memory, but it is safer due to data integrity measures.



Tell me how to better and easier to solve my problem? really do not want to reinstall and configure the system again ... please tell me.


----------



## wblock@ (May 27, 2014)

Sorry, I don't know of an easier way to deal with this, but you don't have to reinstall everything.  Backup Options For FreeBSD shows how to back up a system.  The Handbook section above shows how to set up the disks for gmirror(8), and restore from a backup onto that mirror.

The second part of the Handbook section also shows how to set up a mirror with one existing drive and do an in-place copy.  Please make a backup onto other media before attempting that.


----------

