Solaris OpenSolaris
Judy Chen's Blog
« Creating ad-hoc... | Main | 打造Source Insigh风格的XE... »
星期三 一月 23, 2008
Getting Started with ZFS

I installed Solaris Developer Release 1/08 on my machine and tried with ZFS. I have to say that I was impressed by the powerful functionality and easy usage model of ZFS. I used to maintain a website server which is based on LAMP. Now I would take SAMP + ZFS as a better solution. In SDR 1/08, Web Stack Admin provides easy access to Apache2, MySQL and PHP, while ZFS shows immense scalability, great data integrity and simple administration. SAMP would be another topic. Here I just want to focus on how to start using ZFS.


After installation, the default root system is UFS. ZFS boot is still in work. I converted Solaris slice c0d0s7, which is mounted on /export to ZFS. Before creating zfs pools, remove "/dev/dsk/c0d0s4 ..." entry from /etc/vfstab and unmount it.

# umount /export


Now create a ZFS pool.

# zpool create zfs_export c0d0s7

invalid vdev specification
use '-f' to override the following errors:
/dev/dsk/c0d0s7 contains a ufs filesystem.

The command failed because the slice contained a ufs filesystem. Add -f option to zpool create command.

# zpool create -f zfs_export c0d0s7
# zpool list

NAME         SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
zfs_export  66.5G   111K  66.5G     0%  ONLINE  -


Change mount point to /export.

# zfs set mountpoint=/export zfs_export
# zfs list
NAME           USED  AVAIL  REFER  MOUNTPOINT
zfs_export     117K  65.5G    18K  /export


Share /export via NFS as read/write.

# zfs set sharenfs=on zfs_export
# share

zfs_export@zfs  /export   rw   ""


Share /export via SMB.

# svcadm enable -r smb/server
   
svcadm: svc:/milestone/network depends on svc:/network/physical, which has multiple instances.
# svcs | grep smb
online         13:28:03 svc:/network/smb/server:default
# zfs set sharesmb=on zfs_export
# zfs set sharesmb=name=myshare zfs_export
i# sharemgr show -vp                      

default smb=() nfs=()
zfs
    zfs/zfs_export nfs=()
          /export
                  myshare=/export
                  zfs_export=/export


Recover 'rm' ed files?

AFAIK, the answer is noway.


Make zfs root filesystem and boot from it?

Please refer to: Manuual Setup to Boot ZFS on x86


Useful zfs links

Official Getting Started
7 Easy Tips for ZFS Starters
ZFS Community at OpenSolaris.org


Posted at 04:49下午 一月 23, 2008 by judy in Solaris  |  评论[2]

评论:

发表于 198.201.23.10 在 2008年02月01日, 08:42 上午 CST #

"Recover 'rm' ed files?

AFAIK, the answer is noway."

Oh, no.. You could create snapshot on the filesystem

# zfs snapshot zfs_export@snap

Then you could recover the 'rm' ed files by 'zfs rollback' command, or could observe the content of that file through hidden directory

# zfs rollback -R zfs_export@snap
or
# cat /export/.zfs/snapshot/snap/<path of file>

发表于 robin guo 在 2008年02月03日, 02:49 下午 CST #

发表一条评论:
  • HTML语法: 禁用