ZFS on Linux只支持64bits平台,包括兩個組件SPL(Solaris Porting Layer)和ZFS,當前版本為0.6.0-rc10,支持的zfs pool版本為28,文件系統版本為5。
安裝solaris移植層SPL
下載spl-0.6.0-rc10.tar.gz,解壓生成spl-0.6.0-rc10子目錄,進入該目錄執行以下操作
$ sudo apt-get install build-essential gawk alien fakeroot linux-headers-$(uname -r)
$ ./configure
$ make deb
這會在當前目錄下生成三個deb包
spl_0.6.0-1_amd64.deb
spl-modules_0.6.0-1_amd64.deb
spl-modules-devel_0.6.0-1_amd64.deb
安裝生成的deb包
$sudo dpkg -i *_amd64.deb
安裝ZFS
sudo apt-get install zlib1g-dev
sudo apt-get install uuid-dev
下載zfs-0.6.0-rc10.tar.gz,解壓縮生成zfs-0.6.0-rc10子目錄,進入該目錄執行以下操作
$ sudo apt-get install zlib1g-dev uuid-dev libblkid-dev libselinux-dev parted lsscsi
$ ./configure
$ make deb
這會在當前目錄下生成六個deb包
zfs_0.6.0-1_amd64.deb
zfs-dracut_0.6.0-1_amd64.debls
zfs-modules-devel_0.6.0-1_amd64.deb
zfs-devel_0.6.0-1_amd64.deb
zfs-modules_0.6.0-1_amd64.deb
zfs-test_0.6.0-1_amd64.deb
安裝生成的deb包
$sudo dpkg -i *_amd64.deb
讓系統啟動時自動加載zfs內核模塊,編輯/etc/modules文件,zfs作為單獨的一行添加到文件中。
測試
加載ZFS模塊
# modprobe zfs
查看zfs模塊信息
$ lsmod
grep zfs
Module Size Used by
zfs 791314 0
zunicode 324466 1 zfs
zavl 13115 1 zfs
zcommon 35811 1 zfs
znvpair 31373 2 zcommon,zfs
spl 120446 6 znvpair,zcommon,zavl,zunicode,zfs,splat
加載splat(Solaris Porting LAyer Test)模塊
#modprobe splat
查看splat使用說明
#splat
usage: splat [hvla] [-t >]
–help -h This help
–verbose -v Increase verbosity
–list -l List all tests in all subsystems
–all -a Run all tests in all subsystems
–test -t Run 『test』 in subsystem 『sub』
–exit -x Exit on first test error
–nocolor -c Do not colorize output
Examples:
splat -t kmem:all # Runs all kmem tests
splat -t taskq:0×201 # Run taskq test 0×201
執行kmem測試
#splat -t kmem:all
———–Running SPLAT Tests —————-
kmem:kmem_alloc Pass
kmem:kmem_zalloc Pass
kmem:vmem_alloc Pass
kmem:vmem_zalloc Pass
kmem:slab_small Pass
kmem:slab_large Pass
kmem:slab_align Pass
kmem:slab_reap Pass
kmem:slab_age Pass
kmem:slab_lock Pass
kmem:slab_overcommit Pass