ZFS File System

ZFS Installation on Ubuntu-10.04.3 LTS lucid
——————————————–

Step 1: Build the spl packages

apt-get install build-essential gawk alien fakeroot linux-headers-$(uname -r)

( http://zfsonlinux.org/spl-building-deb.html )

Step 2: Build the zfs packages.

apt-get install zlib1g-dev uuid-dev libblkid-dev libselinux-dev parted lsscsi
( http://zfsonlinux.org/spl-building-deb.html )

Step 3: apt-get install python-software-properties
apt-add-repository ppa:zfs-native/daily
apt-get update
apt-get install debootstrap ubuntu-zfs

Step 4: dkms statuszfs li

Step 5: modprobe splat
splat -a

( http://zfsonlinux.org/spl-regression-suite.html )

Step 6: modprobe zfs
lsmod | grep zfs
zfs list
zpool status
zpool list

Download : https://github.com/zfsonlinux/zfs/downloads

Configuration with RPM : http://zfsonlinux.org/zfs-building-rpm.html

ZFS Installation and configuration : http://zfsonlinux.org/faq.html

Build SPL for our own : http://zfsonlinux.org/spl-building-deb.html

Build ZFS for our own : http://zfsonlinux.org/zfs-building-deb.html

Issue ZFS : https://github.com/zfsonlinux/zfs/issues

Install and configuration the ZFS : https://github.com/dajhorn/pkg-zfs/wiki/HOWTO-install-Ubuntu-to-a-Native-ZFS-Root-Filesystem
http://zfsonlinux.org/faq.html

Download the ZFS in Tar file : https://github.com/zfsonlinux/zfs/downloads
####################################################################################################################
ZFS file system Step by Step

ZFS stands for Zettabyte File System .
It is designed by Sun Microsystems for the Solaris Operating.
The features of ZFS include support for high storage capacities, integration of the concepts of filesystem and volume management, snapshots and copy-on-write clones, continuous integrity checking and automatic repair, RAID-Z and native NFSv4 ACLs. ZFS is implemented as open-source software, licensed under the Common Development and Distribution License (CDDL).

Some of the benefits of the ZFS file system:
Filesystem and Volumemanger in one system
Easy administration with only 2 commands – #zpool and #zfs
advanced raid level and functions
snapshots
automatic checksum over all data
128 Bit
automatic shrinking and growing volumes
No RAID cards required, using ZFS built in RAID-Z redundancy. (reduces hardware cost drastically)
Effective and Optimal SnapShots
Compressed Zpools.
Built in NFS/ISCSI/SMB Sharing
Support PNFS for high speed interconnects. (Will use all the 6 GigE ports)
Configuring ZFS

Permitted subcommands are list, iostat, status, online,
offline, scrub, import, and history.

Find version of ZFS
# kextstat | grep zfs

zpool – configuring zfs storage pools

# zpool create myzfs /disk1 /disk2

# zpool create mypool mirror disk1s1 disk0s1 mirror disk1s2 disk0s2

# mkfile 100m disk1 disk2 disk3 disk5# mkfile 50m disk4
# ls -l disk*
-rw——T 1 root root 104857600 Sep 11 12:15 disk1
-rw——T 1 root root 104857600 Sep 11 12:15 disk2
-rw——T 1 root root 104857600 Sep 11 12:15 disk3
-rw——T 1 root root 52428800 Sep 11 12:15 disk4
-rw——T 1 root root 104857600 Sep 11 12:15 disk5

Creating hot spares

when any disk goes down the disk marked as hotspare will
automatically take its functionality after it gets replaced.

# zpool create pool mirror disk0 disk1 spare disk2 disk3

These spares can be across multiple pools and can be added
with zpool add and removed with zpool remove
#####################################################################################################################
http://docs.oracle.com/cd/E19963-01/html/821-1448/gbscy.html
http://docs.oracle.com/cd/E19963-01/html/821-1448/zfsover-2.html
Create a mirrored pool named “tank”
# zpool create tank mirror c2d0 c3d0

Create home directory filesystem, mounted at /export/home
# zfs create tank/home
# zfs set mountpoint=/export/home tank/home

Create home directories for several users
Note: automatically mounted at /export/home/{ahrens,bonwick,billm} thanks to inheritance
# zfs create tank/home/ahrens
# zfs create tank/home/bonwick
# zfs create tank/home/billm

Add more space to the pool
# zpool add tank mirror c4d0 c5d0

Automatically NFS-export all home directories
# zfs set sharenfs=rw tank/home

Turn on compression for everything in the pool
# zfs set compression=on tank

Limit Eric to a quota of 10g
# zfs set quota=10g tank/home/eschrock

Guarantee Tabriz a reservation of 20g
# zfs set reservation=20g tank/home/tabriz

Take a snapshot of Mark’s home directory
# zfs snapshot tank/home/marks@tuesday

Roll back to a previous snapshot
# zfs rollback tank/home/perrin@monday

Create a clone of your OpenSolaris source coded
# zfs clone tank/solaris@monday tank/ws/lori/fix

Generate a full backup
# zfs send tank/fs@A >/backup/A

Generate an incremental backup
# zfs send -i tank/fs@A tank/fs@B >/backup/B-A

Remote replication: send incremental once per minute
# zfs send -i tank/fs@11:31 tank/fs@11:32 | ssh host zfs receive -d /tank/fs

Export pool from the old server
old# zpool export tank

Physically move disks and import pool to the new server
new# zpool import tank

In the following example, a mount point of /export/zfs is specified and is created for the
tank/home file system.
# zfs create -o mountpoint=/export/zfs tank/home

zfs destroy tank/home/tabriz

zfs destroy -f tank/home/ahrens

zfs rename tank/home/kustarz tank/home/kustarz_old

zfs list -t snapshot

zfs snapshot -r tank/home@now

Repairing the pool using zpool replace

#zpool replace myzpool sde sdf
#zpool status myzpool

#zpool scrub myzpool
#zpool status myzpool

Get all information about pool
#zpool get all storage

zfs send -i tank/dana@snap2 tank/dana@snap3 | ssh host2 zfs recv -F newtank/dana

zfs receive -d -F pool/fs /snaps/fsclonesnap-I
# zfs destroy pool/clone@snapA
# zfs destroy pool/clone
# zfs receive -F pool/clone backupfile.gz

Receiving a ZFS Snapshot

###########################################################################################################

http://www.princeton.edu/~unix/Solaris/troubleshoot/zfs.html

###########################################################################################################

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: