add/remove disks in gmirror

Eugene M. Minkovskii emin at
Tue Dec 4 07:45:43 PST 2007

Hi all!

I use FreeBSD 6.2

I want to try use gmirror to constract raid5, so I do following:

# dd if=/dev/zero of=zero0 bs=1024 count=102400
# dd if=/dev/zero of=zero1 bs=1024 count=102400
# dd if=/dev/zero of=zero2 bs=1024 count=102400
# mdcontrol -a -t vnode zero0
# mdcontrol -a -t vnode zero1
# mdcontrol -a -t vnode zero2

# cat /boot/propeller
drive b0 device /dev/md0
drive b1 device /dev/md1
drive b2 device /dev/md2
volume propeller
    plex org raid5 512k
    sd drive b0
    sd drive b1
    sd drive b2

# gvinum create /boot/propeller
# newfs /dev/gvinum/propeller
# mount /dev/gvinum/propeller mountpoint/

This working excellent, but I want to try what can I do if some
of the disk crashed? So, I do following:

# gvinum rm b2
# mdcontrol -d -u md2
# dd if=/dev/zero of=zero2 bs=1024 count=102400
# mdcontrol -a -t vnode zero2

So, I see files in mountpoint, but what should I do to attach new
disk /dev/md2 into raid5? Perhaps I need to use rebuildparity,
but I see following line in man gvinum:

All subdisks in the plex must be up for a parity check

So, how can I up subdisk?

# gvinum l
3 drives:
D b2                    State: down     /dev/md2        A: 99/99 MB (100%)
D b0                    State: up       /dev/md0        A: 0/99 MB (0%)
D b1                    State: up       /dev/md1        A: 0/99 MB (0%)

1 volume:
V propeller             State: up       Plexes:       1 Size: 99 MB

1 plex:
P propeller.p0       R5 State: up       Subdisks:     2 Size: 99 MB

2 subdisks:
S propeller.p0.s0       State: up       D: b0           Size: 99 MB
S propeller.p0.s1       State: up       D: b1           Size: 99 MB

Sensory  yours, Eugene  Minkovskii
Сенсорно ваш,   Евгений Миньковский

More information about the freebsd-questions mailing list