Login Barrapunto


[ Crear nueva cuenta ]

TooMany (4713)

  (email no mostrado públicam.)

Down Kill Up Publicidad

Bitácora de TooMany (4713)

Martes, 22 de Agosto 2006

Portando el filesystem ZFS a FreeBSD; una realidad.


Me acaba de llegar un correo de la lista de desarrollo de FreeBSD donde se dá, oficialmente (por así decirlo), es pistoletazo de salida al port del filesystem ZFS de Sun a FreeBSD. Toda una alegría que junto al ya casi terminado port del DTrace, y a la versión ya beta del GJournal (journaling para el filesystem UFS2), están haciendo este verano harto interesante.

Paso a realizar ahora un copy&paste del correo que me ha llegado, por si a cualquiera le pudiese interesar:


I started porting the ZFS file system to the FreeBSD operating system.

There is a lot to do, but I'm making good progress, I think.

I'm doing my work in those directories:

        contrib/opensolaris/ - userland files taken directly from

                OpenSolaris (libzfs, zpool, zfs and others)

        sys/contrib/opensolaris/ - kernel files taken directly from

                OpenSolaris (zfs, taskq, callb and others)

        compat/opensolaris/ - compatibility userland layer, so I can

                reduce diffs against vendor files

        sys/compat/opensolaris/ - compatibility kernel layer, so I can

                reduce diffs against vendor files (kmem based on

                malloc(9) and uma(9), mutexes based on our sx(9) locks,

                condvars based on sx(9) locks and more)

        cddl/ - FreeBSD specific makefiles for userland bits

        sys/modules/zfs/ - FreeBSD specific makefile for the kernel


You can find all those on FreeBSD perforce server:

        http://perforce.freebsd.org/depotTreeBrowser.cgi?F SPC=//depot/user/pjd/zfs&HIDEDEL=NO

Ok, so where am I?

I ported the userland bits (libzfs, zfs and zpool). I had ztest and
libzpool compiling and working as well, but I left them behind for now
to focus on kernel bits.

I'm building in all (except 2) files into zfs.ko (kernel module).

I created new VDEV - vdev_geom, which fits to FreeBSD's GEOM
infrastructure, so basically you can use any GEOM provider to build your
ZFS pool. VDEV_GEOM is implemented as consumers-only GEOM class.

I reimplemented ZVOL to also export storage as GEOM provider. This time
it is providers-only GEOM class.

This way one can create for example RAID-Z on top of GELI encrypted
disks or encrypt ZFS volume. The order is free.
Basically you can put UFS on ZFS volumes already and it behaves really
stable even under heavy load.

Currently I'm working on file system bits (ZPL), which is the most hard
part of the entire ZFS port, because it talks to one of the most complex
part of the FreeBSD kernel - VFS.

I can already mount ZFS-created file systems (with 'zfs create'
command), create files/directories, change permissions/owner/etc., list
directories content, and perform few other minor operation.

Some "screenshots":

        lcf:root:~# uname -a

        FreeBSD lcf 7.0-CURRENT FreeBSD 7.0-CURRENT #74: Tue Aug 22 03:04:01 UTC 2006 root@lcf:/usr/obj/zoo/pjd/lcf/sys/LCF i386

        lcf:root:~# zpool create tank raidz /dev/ad4a /dev/ad6a /dev/ad5a

        lcf:root:~# zpool list


        tank 35,8G 11,7M 35,7G 0% ONLINE -

        lcf:root:~# zpool status

            pool: tank

          state: ONLINE

          scrub: none requested


                        NAME STATE READ WRITE CKSUM

                        tank ONLINE 0 0 0

                            raidz1 ONLINE 0 0 0

                                ad4a ONLINE 0 0 0

                                ad6a ONLINE 0 0 0

                                ad5a ONLINE 0 0 0

        errors: No known data errors

        lcf:root:# zfs create -V 10g tank/vol

        lcf:root:# newfs /dev/zvol/tank/vol

        lcf:root:# mount /dev/zvol/tank/vol /mnt/test

        lcf:root:# zfs create tank/fs

        lcf:root:~# mount -t zfs,ufs

        tank on /tank (zfs, local)

        tank/fs on /tank/fs (zfs, local)
/dev/zvol/tank/vol on /mnt/test (ufs, local)

        lcf:root:~# df -ht zfs,ufs

        Filesystem Size Used Avail Capacity Mounted on

        tank 13G 34K 13G 0% /tank

        tank/fs 13G 33K 13G 0% /tank/fs
/dev/zvol/tank/vol 9.7G 4.0K 8.9G 0% /mnt/test

        lcf:root:~# mkdir /tank/fs/foo

        lcf:root:~# touch /tank/fs/foo/bar

        lcf:root:~# chown root:operator /tank/fs/foo /tank/fs/foo/bar

        lcf:root:~# chmod 500 /tank/fs/foo

        lcf:root:~# ls -ld /tank/fs/foo /tank/fs/foo/bar

        dr-x------ 2 root operator 3 22 sie 05:41 /tank/fs/foo

        -rw-r--r-- 1 root operator 0 22 sie 05:42 /tank/fs/foo/bar

The most important missing pieces:

- Most of the ZPL layer.

- Autoconfiguration. I need implement vdev discovery based on GEOM's taste

- .zfs/ control directory (entirely commented out for now).

And many more, but hey, this is after 10 days of work.

PS. Please contact me privately if your company would like to donate to the
        ZFS effort. Even without sponsorship the work will be finished, but
        your contributions will allow me to spend more time working on ZFS.

Pawel Jakub Dawidek http://www.wheel.pl
pjd@FreeBSD.org http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!

Este hilo ha sido archivado. No pueden publicarse nuevos comentarios.
Mostrar opciones Umbral:
Y recuerda: Los comentarios que siguen pertenecen a las personas que los han enviado. No somos responsables de los mismos.