# Creating mirror from existing system



## pcfxer (Apr 24, 2013)

Following the steps for creating a mirror from disk...and running into an issue.

I have two disks /dev/ada0 and /dev/ada1. 


```
root@subsonic:/usr/home/brodey # gpart show ada0
=>       34  156301421  ada0  GPT  (74G)
         34        128     1  freebsd-boot  (64k)
        162  146800512     2  freebsd-ufs  (70G)
  146800674    7815168     3  freebsd-swap  (3.7G)
  154615842    1685613        - free -  (823M)
```

I have free space and yet...


```
root@subsonic:/usr/home/brodey # gpart backup ada0 > table.ada0
root@subsonic:/usr/home/brodey # gpart backup ada0p2 > table.ada0p2
gpart: No such geom: ada0p2.
```


----------



## wblock@ (Apr 24, 2013)

p2 is just a partition, not a geom.  gpart(8) has no information stored there.

Aside from that, GPT and gmirror(8) metadata interfere with each other.  Please follow the Handbook procedure, which uses MBR: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/geom-mirror.html.


----------



## pcfxer (Apr 26, 2013)

20.4.3 Creating a Mirror with an Existing Drive (added: using MBR)

This section makes no mention of the requirement for MBR except for the small indicator of using s1, s2, etc. It's been a while since I tickled the BSD side of things but I figured that since the handbook made no mention of MBR that there was a reason for it.

I have an existing hard disk with an operating install/deployed server. Can I achieve success with a GEOM mirror without having to re partition/reformat my disk?


----------



## wblock@ (Apr 26, 2013)

See the introductory section: Metadata Issues.

It's not necessary to manually repartition the existing drive.  Following those instructions, a one-drive MBR-partitioned mirror is created on the new drive.  The data is copied over, then the old drive is added to the mirror.  That last step will overwrite everything on the original drive, including the partitioning scheme.  Make full backups first.

It's helpful to practice the process on a spare machine or VM.


----------

