Growing a graid3?

Pawel Jakub Dawidek pjd at FreeBSD.org
Fri May 11 08:40:27 UTC 2007


On Fri, May 11, 2007 at 09:55:33AM +0200, Eike Bernhardt wrote:
> Hello,
> 
> is it possible to expand a existing graid3?
> 
> I have a graid3 consisting of 3x 250GB drives, which is nearly full.
> 
> My idea would be to swap out each disk one after one with a bigger disk,
> let the graid3 rebuild itself between swaps, and then use growfs to
> resize the filesystem to the new availiabale maximum size.
> 
> Is this possible? Has anyone tried this?

It should be possible. First you swap one disk after another waiting for
synchronization. Once you have all new disks in place, you need to
relabel your graid3 (it won't touch your data) and then growfs(8) it.
You can try it with md(4) devices, eg:

	# truncate -s 8m /tmp/disk{0,1,2}
	# mdconfig -a -f /tmp/disk0 -u 0
	# mdconfig -a -f /tmp/disk1 -u 1
	# mdconfig -a -f /tmp/disk2 -u 2
	# graid3 label test md{0,1,2}
	# newfs /dev/raid3/test
	# mount /dev/raid3/test /mnt/test
	# dd if=/dev/random of=/mnt/test/rand bs=1m count=12
	# dd if=/mnt/test/rand bs=1m count=12 | md5
	# umount /mnt/test

	# truncate -s 16m /tmp/disk{3,4,5}
	# mdconfig -a -f /tmp/disk3 -u 3
	# mdconfig -a -f /tmp/disk4 -u 4
	# mdconfig -a -f /tmp/disk5 -u 5
	# graid3 remove -n 0 test
	# graid3 insert -n 0 test md3
	[wait]
	# graid3 remove -n 1 test
	# graid3 insert -n 1 test md4
	[wait]
	# graid3 remove -n 2 test
	# graid3 insert -n 2 test md5
	[wait]

	# graid3 stop test
	# graid3 label test md{3,4,5}	# order is very important
	# mount -o ro /dev/raid3/test /mnt/test
	# dd if=/mnt/test/rand bs=1m count=12 | md5	# verify if file is ok
	# umount /mnt/test
	# growfs /dev/raid3/test
	# mount -o ro /dev/raid3/test /mnt/test
	# dd if=/mnt/test/rand bs=1m count=12 | md5	# verify if file is ok again

Something like this.

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20070511/22b25587/attachment.pgp


More information about the freebsd-geom mailing list