Tuesday, May 20, 2008

ZFS - Introduction

###Zettabyte File System (ZFS)###

Some Features:
1. Supports storage space of upto 256 quadrillion zettabytes (Terabytes - Petabytes - Exabytes - Zettabytes(1024 Exabytes))
2. Supports RAID-0/1 & RAID-Z(which is nothing but RAID-5 with enhancements. Best part is you dont need 3 disks to achieve RAID-5 on ZFS, even with 2 virtual devices, ZFS provides and good amount of redundancy.)
3. Support File System Snapshots (read-only copies of file systems or volumes.)
4. Supports creation of volumes (which can contain disks, partitions, files)
5. Uses storage pools to manage storage - aggregates virtual devices
6. ZFS File system attached to storage pool can grow dynamically as storage is added. No need to reformat or backup your data before you add any extra storage.
7. File systems may span multiple physical disks without any extra software or even efforts.
8. ZFS is transactional so its all or nothing. If a write / read operation fails for some reason, the entire transaction is rolled back.
9. Pools & file systems are auto-mounted. No need to maintain /etc/vfstab (automatically handled through XML Files.)
10. Supports file system hierarchies: /storage1/{home(50GB),var(100GB),etc.}
11. Supports reservation of storage: /storage1/{home(50GB),var}
12. Solaris 10, provides a secure web-based ZFS management tool @ https://localhost:6789/zfs


###ZFS - Quick Command Reference###
zpool list - lists known ZFS pools
zpool create pool_name device_name1, device_name2, device_name3, etc.
zpool create storage1 c0t1d0|/dev/dsk/c0t1d0
zfs list - returns ZFS dataset info.
zfs mount - returns pools and mount points
zpool status - returns virtual devices that constitute pools
zpool destroy storage1 - Destroys pool and associated file systems


###Create file systems within storage1###
zfs create storage1/home - creates file system named 'home' in storage1

###Set quota on existing file system###
zfs set quota=10G storage1/home

###Create user-based file system beneath storage1/home###
zfs create storage1/home/vishal

zfs get -r compression storage1 - returns compression property for file systems associated with 'storage1'

###Rename ZFS File System###
zfs rename storage1/home/vishal storage1/home/vishalnew

###Extending dynamically, pool storage###
zpool add storage1 c0t2d0


###ZFS Redundancy/Replication###
1. Mirroring - RAID-1
2. RAID-5 - RAID-Z


Virtual Devices:
1. c0t1d0 - 72GB
2. c0t2d0 - 72GB

Note: Redundancy/Replication is associated directly with the pool

zpool create storagemirror1 mirror c0t1d0 c0t2d0

###ZFS Snapshots###
It’s a read only copy of Volumes and File Systems
Use no additional space, initially

List ZFS Snapshots
zfs list –t snapshot

Create a snapshot
zfs snapshot snapraidz1/home@homesnap1 (highest number is the most recent snapshot)

zfs list –t snapshot

snapshots can be viewed within the filesystem it was created

cd /snapraidz1/home

cd .zfs (hidden directory. Wont be visible even with ls -a.)

cd snapshot
cd homesnap1

zfs destroy snapraidz1/home@homesnap1

rename a snapshot

zfs rename snapraidz1/home@homesnap3 snapraidz1/home@homesnap4

rename between different pool names is not possible.

Rollback a zfs snapshot

zfs rollback snapraidz1/home@homesnap4

File systems need to be remounted for roll back to work. Solution is use –f

zfs rollback –f snapraidz1/home@homesnap4

ZFS Clones

Features:
Writeable file systems / Volumes.
Clones are linked to snapshots.
Clone can be stored anywhere in zfs hierarchy

Create a clone

zfs clone snapraidz1/home@homesnap4 snapraidz1/homeclone1 (directory would be created)

1 comments:

G.Rengarajan said...

Really it is very useful.Keep update like this....

Thanks,
G.Rengarajan

BLOG Maintained by - Vishal Sharma | GetQuickStart