Solved freebsd 12 / gmirror

r00ty

New Member


Messages: 16

#1
Greetings,

I'm playing with gmirror, trying to understand what I'm doing wrong.

Bash:
[root@stanbox999 /usr/home/stan]# gpart list
Geom name: ada0
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 104857559
first: 40
entries: 152
scheme: GPT
Providers:
1. Name: ada0p1
   Mediasize: 524288 (512K)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 20480
   Mode: r1w1e1
   efimedia: HD(1,GPT,78571f74-f950-11e8-a05a-08002720cab1,0x28,0x400)
   rawuuid: 78571f74-f950-11e8-a05a-08002720cab1
   rawtype: 83bd6b9d-7f41-11dc-be0b-001560b84f0f
   label: (null)
   length: 524288
   offset: 20480
   type: freebsd-boot
   index: 1
   end: 1063
   start: 40
2. Name: ada0p2
   Mediasize: 50465341440 (47G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 544768
   Mode: r1w1e1
   efimedia: HD(2,GPT,785795e3-f950-11e8-a05a-08002720cab1,0x428,0x5dffc00)
   rawuuid: 785795e3-f950-11e8-a05a-08002720cab1
   rawtype: 516e7cb6-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 50465341440
   offset: 544768
   type: freebsd-ufs
   index: 2
   end: 98566183
   start: 1064
3. Name: ada0p3
   Mediasize: 2684354560 (2.5G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 3221245952
   Mode: r1w1e0
   efimedia: HD(3,GPT,78581cdc-f950-11e8-a05a-08002720cab1,0x5e00028,0x500000)
   rawuuid: 78581cdc-f950-11e8-a05a-08002720cab1
   rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 2684354560
   offset: 50465886208
   type: freebsd-swap
   index: 3
   end: 103809063
   start: 98566184
Consumers:
1. Name: ada0
   Mediasize: 53687091200 (50G)
   Sectorsize: 512
   Mode: r3w3e5

Geom name: ada1
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 104857559
first: 40
entries: 152
scheme: GPT
Providers:
1. Name: ada1p1
   Mediasize: 524288 (512K)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 20480
   Mode: r1w1e1
   efimedia: HD(1,GPT,331ebf16-f98f-11e8-9608-08002720cab1,0x28,0x400)
   rawuuid: 331ebf16-f98f-11e8-9608-08002720cab1
   rawtype: 83bd6b9d-7f41-11dc-be0b-001560b84f0f
   label: boot1
   length: 524288
   offset: 20480
   type: freebsd-boot
   index: 1
   end: 1063
   start: 40
2. Name: ada1p2
   Mediasize: 50465865728 (47G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 1048576
   Mode: r0w0e0
   efimedia: HD(2,GPT,7b97ed4e-f98f-11e8-9608-08002720cab1,0x800,0x5e00000)
   rawuuid: 7b97ed4e-f98f-11e8-9608-08002720cab1
   rawtype: 516e7cb6-6ecf-11d6-8ff8-00022d09712b
   label: root1
   length: 50465865728
   offset: 1048576
   type: freebsd-ufs
   index: 2
   end: 98568191
   start: 2048
3. Name: ada1p3
   Mediasize: 2684354560 (2.5G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 3222274048
   Mode: r0w0e0
   efimedia: HD(3,GPT,5adb50e4-f990-11e8-9608-08002720cab1,0x5e00800,0x500000)
   rawuuid: 5adb50e4-f990-11e8-9608-08002720cab1
   rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
   label: swap1
   length: 2684354560
   offset: 50466914304
   type: freebsd-swap
   index: 3
   end: 103811071
   start: 98568192
Consumers:
1. Name: ada1
   Mediasize: 53687091200 (50G)
   Sectorsize: 512
   Mode: r1w1e2
Bash:
[root@stanbox999 /usr/home/stan]# gpart show
=>       40  104857520  ada0  GPT  (50G)
         40       1024     1  freebsd-boot  (512K)
       1064   98565120     2  freebsd-ufs  (47G)
   98566184    5242880     3  freebsd-swap  (2.5G)
  103809064    1048496        - free -  (512M)

=>       40  104857520  ada1  GPT  (50G)
         40       1024     1  freebsd-boot  (512K)
       1064        984        - free -  (492K)
       2048   98566144     2  freebsd-ufs  (47G)
   98568192    5242880     3  freebsd-swap  (2.5G)
  103811072    1046488        - free -  (511M)

[root@stanbox999 /usr/home/stan]# sysctl kern.geom.debugflags
kern.geom.debugflags: 16
I'm getting this
Bash:
[root@stanbox999 /usr/home/stan]# gmirror label root /dev/ada0p2 /dev/ada1p2
gmirror: Can't store metadata on /dev/ada0p2: Operation not permitted.

[root@stanbox999 /usr/home/stan]# tunefs -j disable /dev/ada0p2
Clearing journal flags from inode 4
tunefs: Failed to write journal inode: Operation not permitted
tunefs: soft updates journaling cleared but soft updates still set.
tunefs: remove .sujournal to reclaim space
tunefs: /dev/ada0p2: failed to open disk for writing
 

Phishfry

Son of Beastie

Thanks: 1,049
Messages: 3,092

#2
gmirror label root /dev/ada0p2 /dev/ada1p2
Why is root used here? That is not a good volume name choice. Look at the handbook you want a volume name here.
The handbook uses gm0 as a volume name.
gmirror label -v root /dev/ada0p2 /dev/ada1p2
.
Secondly you are trying to mirror partitions when you need to mirror the whole drive.
Look at the handbook example:
gmirror label -v gm0 /dev/ada1 /dev/ada2
https://www.freebsd.org/doc/handbook/geom-mirror.html

Section 18.3.3 does cover using existing disks. Is that what you are trying to do?
 

ShelLuser

Son of Beastie

Thanks: 1,569
Messages: 3,411

#4
Most likely the filesystems are already in use (mounted), also possible is that they're already filled with data (filesystem) which overlaps with the area where gmirror stores its meta data.
 
Top