Upload
mohsaif786
View
2
Download
1
Embed Size (px)
DESCRIPTION
zfs imp
Citation preview
Submitted by: Prabhakar JaiswalEmployee ID: 818089Enterprise Services
ZFS
Introduction to the ZFS File System
Objectives• Describe the Solaris ZFS file system• Create new ZFS pools and file
systems• Modify ZFS file system properties• Mount and unmount ZFS file systems• Destroy ZFS pools and file systems
What Is ZFS?• ZFS SnapshotsZFS snapshots are read-only copies of file
systemsthat initially consume no additional space in
apool.
• Simplified AdministrationZFS uses a simplified command set, uses anhierarchical file system layout, supports file
systemproperty inheritance and automatic mount
points.
ZFS Terminology
• dataset - A generic name for the following ZFS entities:
clones, file systems, snapshots, or volumes.
• mirror - A virtual device that stores identical copies of data on two or more disks.
• pool - A logical group of devices describing the layout
and physical characteristics of the available storage.
• RAID-Z - A virtual device that stores data and parity
on multiple disks, similar to RAID-5.
• resilvering -The process of transferring data from one
device to another device is known as resilvering.
• snapshot - A read-only image of a file system orvolume at a given point in time.
• virtual device - A logical device in a pool, which can be
a physical device, a file, or a collection of devices.
• volume - A dataset used to emulate a physical device.
ZFS Component Naming RequirementsEmpty components are not allowed.Each component can only contain
alphanumeric characters in addition to the following four special characters:
• Underscore (_)• Hyphen (-)• Colon (:)• Period (.)
Pool names must begin with a letter, except that the beginning
sequence c[0-9] is not allowed. In addition, pool names that begin with mirror, raidz, or spare are not allowed as these name are reserved.
Dataset names must begin with an alphanumeric character.
• The minimum disk size is 128 Mbytes. For good ZFS performance, at least one Gbyte or
more of memory is recommended.
Creating ZFS File SystemsOne goal of the ZFS design is to reduce the number
ofcommands needed to create a usable file system.When you create a new pool, a new ZFS file system
is created and mounted automatically.Within a pool, you will probably want to create
additional file systems.In most cases, you will probably want to create and
organize a hierarchy of file systems that matches your organizationalneeds.
A storage device can be a whole disk (c1t0d0) or an
individual slice (c0t0d0s7).The recommended mode of operation
is to use an entire disk.ZFS applies an EFI label when you
create a storage pool withwhole disks
mirror c1t0d0 c2t0d0Creating a Basic Storage PoolThe following command creates a new pool named tank thatconsists of the disk c1t0d0# zpool create tank c1t0d0
You can request specific statistics by using the -o option.
For example, to list only the name and size of each pool, you use the following syntax:
# zpool list -o name,sizeNAME SIZEtank 80.0Gdozer 1.2T
• The simplest way to request a quick overview of pool health status is to use the zpool status command:
# zpool status -xall pools are healthy
• ONLINE The device is in normal working order.
• DEGRADED The virtual device has experienced failure but is still able to function.
• FAULTED The virtual device is completely inaccessible. This status typically indicates total failure of the device, such that ZFS is incapable of sending or receiving data from it.
• If a top-level virtual device is in this state, then the pool is completely inaccessible.
• OFFLINE The virtual device has been explicitly taken offline by the administrator.
• UNAVAILABLE The device or virtual device cannot be opened. In some cases, pools with UNAVAILABLE devices appear in DEGRADED mode. If a top-level virtual device
• is unavailable, then nothing in the pool can be accessed.
zfs create tank/home/bonwickZFS automatically mounts the newly
created file system if it is created successfully.
Renaming a ZFS File System (cont.)The following example uses the rename
subcommand to simply rename a file system:
# zfs rename tank/home/kustarz tank/home/kustarz_old
The following example shows how to use zfs rename to
relocate a file system.# zfs rename tank/home/maybee
tank/ws/maybee
# zfs set mountpoint=legacy tank/home/eschrock
# mount -F zfs tank/home/eschrock /mnt
The zfs mount command with no argument shows all currently mounted file systems that are managed by ZFS.
# zfs mounttank /tanktank/home /tank/hometank/home/bonwick
/tank/home/bonwick
You can use the -a option to mount all ZFS managed file
systems. For example:# zfs mount -aThis command does not mount legacy
managed file systems.
ZFS SnapshotsA snapshot is a read-only copy of a file system or
volume.Snapshots are created almost instantly, and initially
consume no additional disk space within the pool.
ZFS snapshots include the following features:• Snapshots persist across system reboots.• The theoretical maximum number of snapshots is
264.• Snapshots use no separate backing store.
Snapshotsconsume disk space directly from the same storagepool as the file system from which they were
created.
Creating and Destroying ZFS SnapshotsYou use the zfs snapshot command to create ZFSsnapshots. The zfs snapshot command takes the
name ofthe snapshot to create as its only argument.Snapshot names use the following format:filesystem@snapnamevolume@snapnameThe following example creates a snapshot of
tank/home/ahrens that is named friday.# zfs snapshot tank/home/ahrens@friday
You use the zfs destroy command to destroy a ZFS
snapshot. For example:# zfs destroy
tank/home/ahrens@fridayAdataset cannot be destroyed if
snapshots of the dataset exist.
The End