Dienstag, November 25th, 2008 | Author: jean

Hello,

today i wanna have a short look at ZFS, everytime i look at ZFS news and videos i get more interested into this filesystem but i bet i’m not alone. My first try getting opensolaris working within qemu failed. So i’ll try for now zfs-fuse (the linux port over fuse) with a bit luck i can play arround with ZFS then.

By the way, as i’m using “files” instead of real devices i can’t say anything to the performance.

first i need to install fuse and scons


root@chani ~ # lin -cr fuse scons
...

then i need libaio. doesn’t seem to be in my distribution, so i googled for it and installed it manually.

after wget’ing the zfs-fuse bz2 i compiled it


root@chani /home/wdp/Desktop # tar -xjvf
zfs-fuse-0.5.0.tar.bz2
root@chani /home/wdp/Desktop # cd zfs-fuse-0.5.0
root@chani /home/wdp/Desktop/zfs-fuse-0.5.0 # cd src
root@chani /home/wdp/Desktop/zfs-fuse-0.5.0/src # scons
...
root@chani /home/wdp/Desktop/zfs-fuse-0.5.0/src # scons install

then i had to start zfs-fuse


root@chani ~ # zfs-fuse

and then i created the first pool


root@chani /home/wdp # zpool create zfsmagic
raidz2 /home/wdp/disk1_zfs \
         /home/wdp/disk2_zfs \
         /home/wdp/disk3_zfs \
         /home/wdp/disk4_zfs \
         /home/wdp/disk5_zfs \
         /home/wdp/disk6_zfs \
         /home/wdp/disk7_zfs \
         /home/wdp/disk8_zfs \
         /home/wdp/disk9_zfs \
         /home/wdp/disk10_zfs \
         /home/wdp/disk11_zfs \
         /home/wdp/disk12_zfs
root@chani /zfsmagic # df -hT | grep zfs
zfsmagic      fuse     30G   45K   30G   1% /zfsmagic

seems nice so far


root@chani /zfsmagic # zpool status
  pool: zfsmagic
 state: ONLINE
 scrub: none requested
config:

        NAME                      STATE     READ WRITE CKSUM
        zfsmagic                  ONLINE       0     0     0
          raidz2                  ONLINE       0     0     0
            /home/wdp/disk1_zfs   ONLINE       0     0     0
            /home/wdp/disk2_zfs   ONLINE       0     0     0
            /home/wdp/disk3_zfs   ONLINE       0     0     0
            /home/wdp/disk4_zfs   ONLINE       0     0     0
            /home/wdp/disk5_zfs   ONLINE       0     0     0
            /home/wdp/disk6_zfs   ONLINE       0     0     0
            /home/wdp/disk7_zfs   ONLINE       0     0     0
            /home/wdp/disk8_zfs   ONLINE       0     0     0
            /home/wdp/disk9_zfs   ONLINE       0     0     0
            /home/wdp/disk10_zfs  ONLINE       0     0     0
            /home/wdp/disk11_zfs  ONLINE       0     0     0
            /home/wdp/disk12_zfs  ONLINE       0     0     0

errors: No known data errors
root@chani /home/wdp # zpool list
NAME       SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
zfsmagic  35.8G  3.00G  32.7G     8%  ONLINE  -

okay. so far so good. let’s now copy over some files. cp not mv. we just use to check some things. I just copy over some music songs (7 GB) let’s check again how much space we use, using df and zpool list:


root@chani /home/wdp # zpool list
NAME       SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
zfsmagic  35.8G  9.07G  26.7G    25%  ONLINE  -

root@chani /home/wdp # df -hT | grep zfs
zfsmagic      fuse     30G  7.6G   22G  26% /zfsmagic

As you can see, some differences in displaying the amount of used data. though this shouldn’t be a problem.

Now let’s do a .. crashtest. I’m first running zpool scrub to to make sure that integrety is okay.. after it i’ll check for the biggest zfs device file and remove this one using mv. at the same time i’ll play a song from that disc. Let’s see whether it works or not.


root@chani ~ # zpool scrub zfsmagic
root@chani ~ # zpool status
  pool: zfsmagic
 state: ONLINE
 scrub: scrub in progress for 0h9m, 48.38% done, 0h10m to go
config:

        NAME                      STATE     READ WRITE CKSUM
        zfsmagic                  ONLINE       0     0     0
          raidz2                  ONLINE       0     0     0
            /home/wdp/disk1_zfs   ONLINE       0     0     0
            /home/wdp/disk2_zfs   ONLINE       0     0     0
            /home/wdp/disk3_zfs   ONLINE       0     0     0
            /home/wdp/disk4_zfs   ONLINE       0     0     0
            /home/wdp/disk5_zfs   ONLINE       0     0     0
            /home/wdp/disk6_zfs   ONLINE       0     0     0
            /home/wdp/disk7_zfs   ONLINE       0     0     0
            /home/wdp/disk8_zfs   ONLINE       0     0     0
            /home/wdp/disk9_zfs   ONLINE       0     0     0
            /home/wdp/disk10_zfs  ONLINE       0     0     0
            /home/wdp/disk11_zfs  ONLINE       0     0     0
            /home/wdp/disk12_zfs  ONLINE       0     0     0

errors: No known data errors

let’s wait 10 minutes… :)


root@chani /home/wdp # du -h disk*
784M    disk10_zfs
784M    disk11_zfs
784M    disk12_zfs
784M    disk1_zfs
784M    disk2_zfs
784M    disk3_zfs
784M    disk4_zfs
784M    disk5_zfs
784M    disk6_zfs
784M    disk7_zfs
784M    disk8_zfs
784M    disk9_zfs

okay.. that will not be very useful. i just remove 1 random file.


root@chani /home/wdp # mkdir zfs_old
root@chani /home/wdp # mv disk6_zfs zfs_old/
root@chani /home/wdp # zpool scrub zfsmagic

at the same time i play a song on a different console.


root@chani ~ # zpool status
  pool: zfsmagic
 state: DEGRADED
status: One or more devices could not be opened.  Sufficient replicas exist for
        the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
   see: http://www.sun.com/msg/ZFS-8000-2Q
 scrub: scrub in progress for 0h0m, 0.00% done, 208h30m to go
config:

        NAME                      STATE     READ WRITE CKSUM
        zfsmagic                  DEGRADED     0     0     0
          raidz2                  DEGRADED     0     0     0
            /home/wdp/disk1_zfs   ONLINE       0     0     0
            /home/wdp/disk2_zfs   ONLINE       0     0     0
            /home/wdp/disk3_zfs   ONLINE       0     0     0
            /home/wdp/disk4_zfs   ONLINE       0     0     0
            /home/wdp/disk5_zfs   ONLINE       0     0     0
            /home/wdp/disk6_zfs   UNAVAIL      0     0     0  cannot open
            /home/wdp/disk7_zfs   ONLINE       0     0     0
            /home/wdp/disk8_zfs   ONLINE       0     0     0
            /home/wdp/disk9_zfs   ONLINE       0     0     0
            /home/wdp/disk10_zfs  ONLINE       0     0     0
            /home/wdp/disk11_zfs  ONLINE       0     0     0
            /home/wdp/disk12_zfs  ONLINE       0     0     0

errors: No known data errors

wow! okay.. let’s remove one more. by the way, song is still playing.


root@chani /home/wdp # mv disk4_zfs zfs_old/
root@chani /home/wdp # zpool scrub zfsmagic

wow! still working… let’s remove one more.


root@chani /home/wdp # mv disk12_zfs zfs_old/

crashed. :)


root@chani /home/wdp # zpool scrub zfsmagic
zfsfuse_ioctl_read_loop(): file descriptor closed
cannot scrub zfsmagic: I/O error
root@chani /home/wdp # 

root@chani /home/wdp/Desktop/zfs-fuse-0.5.0 # zpool status
connect: Connection refused
Please make sure that the zfs-fuse daemon is running.
internal error: failed to initialize ZFS library
root@chani /home/wdp/Desktop/zfs-fuse-0.5.0 #

I don’t know what exactly was causing this, anyway, it seems like something with zfs-fuse as the daemon got killed by itself. i’ve seen that removing two discs from a pool is working and that the whole pool was still running. ZFS is a really really nice filesystem, if i could i would use it within my linux, but for now.. it’s probably not ready enough well. at least not zfs-fuse.

By the way, some more Information about ZFS can be obtained here:

zfs-fuse
ZFS OpenSolaris Community

And here’s a nice Video i found in Martin’s Blog:
ZFS-Video by Systemhelden

Category: Linux
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

2 Responses

  1. 1
    TheBonsai (2 comments) 

    That’s why nobody wants FUSE crap in a productive environment. Not for ZFS, not for NTFS.

    F.U.S.E..I.S..C.R.A.P.!.!

  2. 2
    jean (12 comments) 

    As long as Sun isn’t going to release it under both licenses or the linux kernel guys find a way for this, fuse will be the only way to get it running with linux. Anyway, i’ve seen it could work using solaris zones (running linux within solaris) – i’ll try with opensolaris if i get it working within qemu or some other emulator :)

Leave a Reply » Log in

Please copy the string Ml37s0 to the field below: