Сборка gmirror без перезагрузки
В сети есть достаточное количество описаний, как на FreeBSD собрать программный RAID-1, он же gmirror. Все они требуют в определенный момент перезагрузки сервера между включением в зеркало первого диска и остальных. Однако, бывают ситуации, когда она нежелательна либо невозможна. Прямо сейчас строю такую машинку, соответственно, пришлось выкручиваться. Итак, начнем:
Включаем в ядро поддержку gmirror после перезагрузки:
# echo 'geom_mirror_load=YES' >> /boot/loader.conf
Даем системе доступ для изменения конфигурации дисков:
# sysctl kern.geom.debugflags=16
kern.geom.debugflags: 0 -> 16
Вставляем первый диск:
# gmirror label -v -b round-robin gm0 /dev/ad4
Metadata value stored on /dev/ad4.
Done.
Правим /etc/fstab. В нем меняем все вхождения /dev/ad4 на /dev/mirror/gm0, например, /dev/ad4s1a станет /dev/mirror/gm0s1a и т.п.
Дальше самая хитрость — вместо перезагрузки подгружаем ядру модуль gmirror и вставляем второй диск:
# kldload geom_mirror
# gmirror insert gm0 /dev/ad6
Проверяем:
# gmirror list
Geom name: gm0
State: DEGRADED
Components: 2
Balance: round-robin
Slice: 4096
Flags: NONE
GenID: 0
SyncID: 1
ID: 1867633513
Providers:
1. Name: mirror/gm0
Mediasize: 750156373504 (699G)
Sectorsize: 512
Mode: r1w0e0
Consumers:
1. Name: ad4
Mediasize: 750156374016 (699G)
Sectorsize: 512
Mode: r1w1e1
State: ACTIVE
Priority: 0
Flags: NONE
GenID: 0
SyncID: 1
ID: 129648194
2. Name: ad6
Mediasize: 750156374016 (699G)
Sectorsize: 512
Mode: r1w1e1
State: SYNCHRONIZING
Priority: 0
Flags: DIRTY, SYNCHRONIZING
GenID: 0
SyncID: 1
Synchronized: 0%
ID: 3539837274
Видим, что зеркало соорудилось и пошла синхронизация. Далее остается периодически поглядывать за ее ходом:
# gmirror status
Name Status Components
mirror/gm0 DEGRADED ad4
ad6 (22%)
По окончании процесса можно и перегрузиться с собранным зеркалом.
12 thoughts on “Сборка gmirror без перезагрузки”
It’s amazing to pay a visit this web site and reading the views
of all mates concerning this post, while I am also eager of getting familiarity.
My brother suggested I might like this blog.
He was entirely right. This submit actually made my day.
You cann’t consider just how much time I had spent for this
information! Thanks!
Why users still use to read news papers when in this technological globe the whole thing is presented
on net?
Hi there, everything is going fine here and ofcourse every one is sharing information, that’s in fact excellent,
keep up writing.
This article gives clear idea designed for the new people of blogging, that in fact how to do blogging.
This paragraph presents clear idea for the new users
of blogging, that genuinely how to do blogging and
site-building.
Unquestionably imagine that that you stated. Your favorite
justification appeared to be on the net the
simplest thing to keep in mind of. I say to you, I definitely get annoyed while other
folks think about worries that they just don’t know about.
You controlled to hit the nail upon the top as smartly
as defined out the entire thing without having side-effects , other folks can take a signal.
Will probably be again to get more. Thank
you
Hi friends, how is all, and what you wish for to say about this article,
in my view its truly amazing designed for me.
Superb blog! Do you have any recommendations for aspiring writers?
I’m hoping to start my own blog soon but I’m a little lost on everything.
Would you recommend starting with a free platform like WordPress or go for a paid option? There are so many choices out there that I’m
completely confused .. Any ideas? Many thanks!
I’m impressed, I have to admit. Seldom do I encounter a blog that’s both equally educative and entertaining, and
let me tell you, you have hit the nail on the head.
The issue is something that too few men and women are speaking intelligently about.
I’m very happy that I came across this in my hunt for something concerning this.
looking for doctor types of asthma inhaler medications. tadalafil 20mg Ujilewy qgme85
Have you ever considered publishing an ebook or guest authoring on other websites?
I have a blog centered on the same subjects you discuss and would
love to have you share some stories/information. I
know my audience would appreciate your work.
If you’re even remotely interested, feel free to send me an e mail.