############################ ZFS ######################################
Zettabyte File System (ZFS)
CLI,GUI,Mirroring,Raid-z,snapshots,clones
Features:
supports Very large Storage Space --
It can address 256 Quadrilion Zettabytes
Quadrilion - 1 million
1 256 Quadrillion Zettabytes (Terrbytes - Perabytes - Exabytes - Zettabytes ) ( 1024 Exabytes - 1 Zettabyte)
2 File system for the Feature
3. RAID -0/1 Mirroring,striping & RAID-Z ( RAID-5 with enhancements ) ( 2-required virtual devices )
4. Snapshots - Great Features - Read-only copies of file systems or volumes.. Be able to take a snapshot of current filesytem ...can revert back to the previous file system
5. Uses Storage Pools to manage storage - aggregates virtual devices .. Since the filesystems are attached to pools... They can dynamically grow
6. File Systems attached to pools grow dynamically as storage is added
7. We can attach the filesystem with out interupting any transaction
8. File systems may span multiple physical disks
9. ZFS is transactional (less likely to corrupt data)
Eg; Traditional file system 100 MB 80% is written 20% failed due to some reason which leads to data corruption...
But in zfs if it writes total 100 or nothing written ... After writing 100 MB it will do commit... so there is less channe of data corruption. Important feature of mission critical information .. 100 Mb will be written or nothing will be written
10. Pools & file systems are auto-mouted. NO need to maintain /etc/vfstab ... (Virtual file system tab ) Pools should have unique names ... Pools name must be unique... Within pool filesystem should also be unique
11. Supports file system hierarchies: /pool1/{home (5GB) ,var (10 GB) ,etc (15 gb)}
12. Supports reservation of storage: 36 /pool1/{home,var} .. We put reservation .. ensuring the home always get 10Gb ...
Inshort a specific filesystem will have it's specified size always...
13. Provides a secure web-based management tool - https://localhost:6789/zfs
Note: Compiling Reasons... Above about Zfs file system
################# ZFS CLI ###########################
Command Line Interface
which zpool
zpool list - lists known pools
zpool create pool_name(alphaanumeric,_,-,:,.)
Pool Name Constraints: Reserved name (Do Not Use These Names For your Pool Names):
1. mirror
2. raidz
zpool create pool_name devices_name1, device_name2, device_name3, etc
Eg;
zpool create pool1 c0t1d0 | /dev/dsk/c0td10
Note: format (searches for disks )
It will scan for the connected disks.
Eg:
- zpool create pool1 c0t1d0
- echo $?
- mount
- ls -l /pool1/
- zpool list
ZFS Pool Statuses:
1. ONLINE - available
2. DEGRADED - failed or mirror failed
3. FAULTED - In Accessible, Before removing a HD make it offline a remove it
4. OFFLINE
5. UNAVAILABLE
zfs list - returns ZFS dataset info
zfs mount - returns pools and mount points
zpool status - returns virtual devices - The most important command to run ... probably after creation of pools
zpool status -v pool_name - To get verbose information about the pool
Note: ZFS requires a minimum of 128 MB virtual device to create a pool
zpool destroy pool1 - Destroys pool and associated file systems
############## Create file systems within pool1 ##############
zfs create pool1/home - creates file system named 'home' in pool1
home is subset of pool1
Note: Default action of 'zfs create pool1/home' assigns all storage available to 'pool1`, to 'pool1/home'
############# Set Quota on existing file System ########
- zfs set quota=10G pool1/home
- zfs list
############## Create user-based file system beneath pool1/home ###########
- zfs create pool1/home/vxadmin ( We can specify the size as well)
- zfs list
Note: ZFS inherits properties from immediate ancestor
- zfs set quota=2G pool1/home/gyani
- zfs get -r quota pool1
- zfs get -r compression pool1 - returns compression property for file systems associated with 'pool1'
Note: Be default the compression will be in off state to the filesystems
############# Rename File System ####################
zfs rename pool1/home/unixcbt pool1/home/unixcbt2
########## Extending dynamically, Pool #####################
- format - Search out the available disks
- zpool add pool1 c0t2d0 (device_name) [ Able to address dynamically added storage ]
- zfs list
- zpool status
################## ZFS WEB GUI #############################3
ls -ltr /usr/sbin/smcwebserver
netstat -anP -tcp | grep 6789
Note: By Default Nfs doesn't share, due to security reason
legacy filesystem - means /etc/vfstab
############## ZFS Redundancy/Replication ################
1. Mirroring - RAID-1
2. RAID-5 - RAID-Z
Virtual Devices:
#Mirroring
- zpool create poolmirror1 mirror c0t1d0 c0t2d0
- zfs create poolmirror1/home
- zfs set quota=10G poolmirror1/home
# RaidZ
2 - minimum number of disks required
format -> 1 -> partition -> print
#Create the pool
/usr/sbin/zpool create -f poolraidz1 raidz c0t1d0 c0t2d0
- zfs list
# Change a mount point
/usr/sbin/zfs set mountpoint=/poolraidz2 poolraidz1
zfs et quota=10G poolraidz1/home
# Change a mount point back to inherited
/usr/sbin/zfs inherit mountpoint poolraidz1
########### ZFS Snapshots/Clones #################
Snapshots allows as to create a readonly copy of file systems or volume
Commerical products like NetApps,SAN,EMC's similar capabilities
Features:
1. Read-only copies of volumes or file systems
2. Use no additional space, initially
- zfs list -t snapshot - returns available snapshots
#snap shot syntax
- zfs snapshot poolraidz1/home@homesnap1
- zfs list -t snapshot
- snapshots are stored inside the hidden directory
/poolrraidz1/home/.zfs/snapshot/homesnap1
#Destroy the snapshot
- zfs destroy poolraidz1/home@homesnap1
# Rename Snapshot
- zfs rename poolraidz1/home@homesnap3 poolraidz/home@homesnap20060703
- zfs list -t snapshot
# Snapshots Roleback... It has to unmount and mount
- zfs rollback -f poolraidz1/home@homesnap20060703
### Clones
Clones are writeable copies.
Features:
1. Writable file systems or volumes
2. Linked to a snapshot... We cannot create a clone withoaut snapshot
3. Clone can be stored anywhere in ZFS hierarchy
###ZFS Clone
- zfs clone poolraidz1/home@homesnap20060703 poolraidz1/homeclone1
Note: Clones will inherit the attributes whereas snapshots won't inherits anything.
Note: clone is writeable whereas snapshot is not
Note: It we delete the snapshot... It will delete the clone as well.. Directly propotional
### Zfs Share
ZFS specific Settings :
zfs sharenfs=on vxpool
zfs set sharenfs=rw=@10.10.20.0/24,root=@10.10.20.0/24 vxpool
sharemgr show -pv
sharemgr show -pvx
1 comment:
Are you looking to earn money from your visitors by popup advertisments?
In case you do, have you ever used Propeller Ads?
Post a Comment