# [UFS] Destroying incorrectly created gmirror?



## luxmust (Sep 24, 2013)

Hi!

Trying to set up a RAID 1 for the first time, or any RAID for that matter. After the first few step of following this guide I realized I've made a mistake.

In this step:

```
# geom zero load
# gnop create -s 1000204821504 gzero
# gmirror label -v gm0 gzero.nop ada1
# gmirror forget gm0
```

I misunderstood the file system I'm on and did  `# gmirror label -v gm0 gzero.nop ada0p5`. So to revert this I tried to deactivate the mirroring, but I get an error saying that ada0p5 isn't the provider:

```
$ sudo gmirror deactivate gm0 ada0p5
gmirror: No such provider: ada0p5.
```

Any hints or ideas of how to solve this?


----------



## J65nko (Sep 24, 2013)

What is the output of `# gmirror status`, `# gmirror list`, `# gpart show`? 

Or just use the commands described in 20.4.1. Metadata Issues to start all over


----------



## wblock@ (Sep 24, 2013)

Use `gmirror remove gm0 ada0p5`.  Be warned that the Handbook section was written for mirroring entire drives, not just individual partitions, and it's easy to encounter metadata conflicts with GPT.  Also, mirroring more than one partition on a drive can be a problem.


----------



## luxmust (Sep 27, 2013)

Results of `gmirror status`, `gmirror list` and `gpart show`;

```
$ gmirror status
      Name    Status  Components
mirror/gm0  COMPLETE  ufsid/5229e765eff8648d (ACTIVE)
```


```
$ gmirror list
Geom name: gm0
State: COMPLETE
Components: 1
Balance: load
Slice: 4096
Flags: NONE
GenID: 0
SyncID: 1
ID: 1759841546
Providers:
1. Name: mirror/gm0
   Mediasize: 79456894464 (74G)
   Sectorsize: 512
   Mode: r0w0e0
Consumers:
1. Name: ufsid/5229e765eff8648d
   Mediasize: 165356109824 (154G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 2147632128
   Mode: r1w1e1
   State: ACTIVE
   Priority: 1
   Flags: NONE
   GenID: 0
   SyncID: 1
   ID: 190108834
```


```
$ gpart show
=>       34  488397101  ada0  GPT  (232G)
         34        128     1  freebsd-boot  (64k)
        162  155189248     2  freebsd-ufs  (74G)
  155189410        128     4  freebsd-boot  (64k)
  155189538  322961152     5  freebsd-ufs  (154G)
  478150690    8388608     3  freebsd-swap  (4.0G)
  486539298    1857837        - free -  (907M)

=>       34  156249933  ada1  GPT  (74G)
         34  156249933        - free -  (74G)
```



			
				wblock@ said:
			
		

> Use `gmirror remove gm0 ada0p5`.  Be warned that the Handbook section was written for mirroring entire drives, not just individual partitions, and it's easy to encounter metadata conflicts with GPT.  Also, mirroring more than one partition on a drive can be a problem.



I tried the `gmirror remove` command but that didn't help :/

```
$ sudo gmirror remove gm0 ada0p5
Password:
gmirror: No such provider: ada0p5.
```

And mirroring a partition wasn't the intended result. It was a side-effect of a misunderstanding, so I should be able to follow the manual once were back on track


----------



## luxmust (Sep 27, 2013)

We solved the problem. The problem was that when you tried to stop the label (`gmirror stop gm0`) it relaunched but with an invalid(?) component name. so you had to do `gmirror stop` once again. Output from terminal:

```
$ sudo gmirror status gm0
      Name    Status  Components
mirror/gm0  COMPLETE  ada0p5 (ACTIVE)
$ sudo gmirror stop gm0
$ sudo gmirror status gm0
      Name    Status  Components
mirror/gm0  COMPLETE  ufsid/5229e765eff8648d (ACTIVE)
$ sudo gmirror stop gm0
$ sudo gmirror status gm0
      Name    Status  Components
mirror/gm0  COMPLETE  ada0p5 (ACTIVE)
```
and after this you could deactivate it according to the advice in this thread
`$ sudo gmirror deactivate gm0 ada0p5`


----------



## wblock@ (Sep 27, 2013)

deactivate just marks the component as inactive, it does not remove the metadata.  That's what `gmirror remove` or `gmirror clear` do.


----------

