# Geom_raid5 on freebsd 8



## astadtler (Dec 5, 2009)

Does anyone have Geom_raid5 (not gvinum) working on freebsd 8?


----------



## red_spirit (Jan 4, 2010)

Hello. I tried to use it but has no luck.
Here is a problem when compiling:


```
myhost# make -C /usr/src/sys/modules/geom/geom_raid5/
Warning: Object directory not changed from original /usr/src/sys/modules/geom/geom_raid5
cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-
unit-growth=100 --param large-function-growth=1000 -fno-common  -mno-align-long-strings -mpreferred-stack-boundary=2  -mno-mmx -mno-3dnow 
-mno-sse -mno-sse2 -mno-sse3 -ffreestanding -fstack-protector -std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls -Wnested-externs 
-Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -c /usr/src
/sys/modules/geom/geom_raid5/../../../geom/raid5/g_raid5.c
/usr/src/sys/modules/geom/geom_raid5/../../../geom/raid5/g_raid5.c: In function 'g_raid5_workerD':
/usr/src/sys/modules/geom/geom_raid5/../../../geom/raid5/g_raid5.c:2015: error: too many arguments to function 'kthread_exit'
/usr/src/sys/modules/geom/geom_raid5/../../../geom/raid5/g_raid5.c: In function 'g_raid5_worker':
/usr/src/sys/modules/geom/geom_raid5/../../../geom/raid5/g_raid5.c:2444: error: too many arguments to function 'kthread_exit'
cc1: warnings being treated as errors
/usr/src/sys/modules/geom/geom_raid5/../../../geom/raid5/g_raid5.c: In function 'g_raid5_create':
/usr/src/sys/modules/geom/geom_raid5/../../../geom/raid5/g_raid5.c:2635: warning: implicit declaration of function 'kthread_create'
/usr/src/sys/modules/geom/geom_raid5/../../../geom/raid5/g_raid5.c:2635: warning: nested extern declaration of 'kthread_create'
*** Error code 1

Stop in /usr/src/sys/modules/geom/geom_raid5.
```

Can anybody help?


----------



## zapher (Jan 5, 2010)

Is this in -CURRENT or in some SVN?


----------



## SirDice (Jan 5, 2010)

There is no geom_raid5 in 8.0. There is a module on perforce however. 

http://tinyurl.com/yahbdlh


----------



## astadtler (Jan 5, 2010)

They changed how kthread works and the compile commands thats where the errors come from.  I think you just have to update the geom files to the current code.  I'll update later with more detailed information, since I'm writing this vaguely from memory.


----------



## red_spirit (Jan 15, 2010)

I just update files from http://tinyurl.com/yahbdlh

but same error occurs...
can you tell more detail about this?
Thanks


----------



## astadtler (Jan 18, 2010)

In FreeBSD 8.0, the kthread*(9) family of functions was renamed to be the
     kproc*(9) family of functions, as they were misnamed and actually pro-
     duced kernel processes.  A new family of different kthread_*(9) functions
     was added to produce real kernel threads.	See the kthread(9) man page
     for more information on those calls.  Also note that the
     kproc_kthread_add(9) function appears in both pages as its functionality
     is split.

From kproc manpage for FreeBSD 8: http://www.freebsd.org/cgi/man.cgi?query=kproc&apropos=0&sektion=0&manpath=FreeBSD+8.0-RELEASE&format=html

I'm pretty sure the problem is related to this.


----------



## astadtler (Jan 20, 2010)

*Fix*

Ok try this and let me know if it works, it compiled fine for me but it was on a virtual machine.  You just need the geom_raid5.c file but I included a tar of the whole directory too.

http://prozium.us/g_raid5.c

http://prozium.us/geom_raid5_fbsd8.tar.gz

and the correct path would be /usr/src/sys/geom/raid5/g_raid5.c


----------



## astadtler (Jan 20, 2010)

there is also an version available in svn with this patch and some additional patches I don't know about the stability http://svn.freebsd.org/base/projects/geom_raid5/


----------



## red_spirit (Jan 21, 2010)

*yahoo!!!*

It works fine! many thanks to you!


----------



## edwtjo (May 4, 2010)

@red_spirit what code are you using? 

I needed to change the subversion code thusly. Since the code in SVN doesn't compile, that code does panic however.


----------



## dennylin93 (May 4, 2010)

Perhaps a bit unrelated, but does anyone know why geom_raid5 hasn't been added to HEAD yet?


----------



## edwtjo (May 4, 2010)

*so much to do, so little time*



			
				dennylin93 said:
			
		

> Perhaps a bit unrelated, but does anyone know why geom_raid5 hasn't been added to HEAD yet?



Because the code doesn't work? As said, the SVN code doesn't even compile and if you try to run it it panics. 

It could also be that it is more prioritized to put available efforts into ZFS, since there is a raid5 alternative through GEOM.


----------

