Formatting code for ZFS
{{parent page="GeneralUNIX"}}
===ZFS===
ZFS has many interesting features. The following works on Solaris.
==Memory requirements==
http://docs.freebsd.org/cgi/getmsg.cgi?fetch=8167+0+current/freebsd-fs
%%
vm.kmem_size="1024M"
vm.kmem_size_max="1024M"
%%
==Other ports of ZFS==
FreeBSD http://wiki.freebsd.org/ZFSQuickStartGuide
Fuse http://www.wizy.org/wiki/ZFS_on_FUSE
==Getting the partition/drive names==
First off, use iostat to list all the partition names
%%
bash-3.00# iostat -En
%%
==Create a new raid-1 pool==
%%
bash-3.00# zpool create -f zvol1 mirror c1t1d0 c1t3d0
bash-3.00# zpool status
pool: zvol1
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
zvol1 ONLINE 0 0 0
mirror ONLINE 0 0 0
c1t1d0 ONLINE 0 0 0
c1t3d0 ONLINE 0 0 0
bash-3.00# zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
zvol1 68G 89K 68.0G 0% ONLINE -
%%
==Create filesystem==
As soon as the mirror is created, one can start using the filesystem at for example /zvol1. If you need create "sub-directories" or mount points inside that mount point, use the zfs command:
%%
zfs create zvol1/u01
zfs set quota=30GB zvol1/u01
zfs create zvol1/u02
%%
==Extending mirror==
Suppose you want to extend the mirror volume and you have the new bigger drives (c3txd0) ready.
%%
# zpool replace zvol1 c1t1d0 c3t1d0
# zpool replace zvol1 c1t3d0 c3t3do
%%
==Fixing failed mirror==
Replace the faulty drive then
%%
# zpool replace zvol1 c1t3d0
%%
==Changing mount point==
%%
zfs set mountpoint=none zvol1
zfs set mountpoint=/u01 zvol1/u01
zfs list
%%
==File permission==
Grant full access to multiple users
%%
chmod -R A+user:usera:rwxpd:fd:allow /export/home/share
chmod -R A+user:userb:rwxpd:fd:allow /export/home/share
chmod -R A+user:userc:rwxpd:fd:allow /export/home/share
%%
===ZFS===
ZFS has many interesting features. The following works on Solaris.
==Memory requirements==
http://docs.freebsd.org/cgi/getmsg.cgi?fetch=8167+0+current/freebsd-fs
%%
vm.kmem_size="1024M"
vm.kmem_size_max="1024M"
%%
==Other ports of ZFS==
FreeBSD http://wiki.freebsd.org/ZFSQuickStartGuide
Fuse http://www.wizy.org/wiki/ZFS_on_FUSE
==Getting the partition/drive names==
First off, use iostat to list all the partition names
%%
bash-3.00# iostat -En
%%
==Create a new raid-1 pool==
%%
bash-3.00# zpool create -f zvol1 mirror c1t1d0 c1t3d0
bash-3.00# zpool status
pool: zvol1
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
zvol1 ONLINE 0 0 0
mirror ONLINE 0 0 0
c1t1d0 ONLINE 0 0 0
c1t3d0 ONLINE 0 0 0
bash-3.00# zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
zvol1 68G 89K 68.0G 0% ONLINE -
%%
==Create filesystem==
As soon as the mirror is created, one can start using the filesystem at for example /zvol1. If you need create "sub-directories" or mount points inside that mount point, use the zfs command:
%%
zfs create zvol1/u01
zfs set quota=30GB zvol1/u01
zfs create zvol1/u02
%%
==Extending mirror==
Suppose you want to extend the mirror volume and you have the new bigger drives (c3txd0) ready.
%%
# zpool replace zvol1 c1t1d0 c3t1d0
# zpool replace zvol1 c1t3d0 c3t3do
%%
==Fixing failed mirror==
Replace the faulty drive then
%%
# zpool replace zvol1 c1t3d0
%%
==Changing mount point==
%%
zfs set mountpoint=none zvol1
zfs set mountpoint=/u01 zvol1/u01
zfs list
%%
==File permission==
Grant full access to multiple users
%%
chmod -R A+user:usera:rwxpd:fd:allow /export/home/share
chmod -R A+user:userb:rwxpd:fd:allow /export/home/share
chmod -R A+user:userc:rwxpd:fd:allow /export/home/share
%%